XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
forms.php
Go to the documentation of this file.
1 <?php if ($form->getTitle()!=''): ?><h1 class="rmc_titles"><?php echo $form->getTitle(); ?></h1><?php endif; ?>
2 
3 <form name="<?php echo $form->getName() ?>" id="<?php echo $form->getName(); ?>" method="<?php echo $form->method(); ?>" action="<?php echo $form->getAction(); ?>"<?php if($form->getExtra()!=''): echo " ".$form->getExtra(); endif;?>>
4 
5 <div class="form_container">
6 <table class="table_form" cellspacing="0">
7 <?php
8  $elements = $form->elements();
9 
10  foreach ($elements as $data):
11  //print_r($data);
12  $field =& $data['field'];
13 
14  if ($data['class']=='RMFormHidden'):
15  echo $field->render();
16  elseif($data['class']=='RMFormSubTitle'):
17 ?>
18 <tr>
19  <td colspan="2"><?php echo $field->render(); ?>
20 </tr>
21  <?php if($field->getDescription()!=''): ?><tr class="cell_fields"><td colspan="2"><span class="descriptions"><?php echo $field->getDescription(); ?></span></td></tr><?php endif; ?>
22 
23 <?php
24  else:
25  $field->addClass("inputForm");
26 ?>
27 <tr id="row_<?php echo $field->getName(); ?>" class="cell_fields">
28  <td width="30%" class="form_captions">
29  <?php if($field->getCaption()!=''): ?><label for="<?php echo $field->getName(); ?>"><?php echo $field->getCaption(); ?></label><?php else: ?>&nbsp;<?php endif; ?>
30  <?php if($field->getDescription()!=''): ?><span class="descriptions"><?php echo $field->getDescription(); ?></span><?php endif; ?>
31  </td>
32  <td>
33  <?php echo $field->render(); ?>
34  <?php
35  switch(get_class($field)){
36  case 'RMFormButtonGroup':
37  case 'RMFormButton':
38  case 'RMFormHidden':
39  break;
40  default: ?>
41  <label for="<?php echo $field->getName(); ?>" class="error hidden"><?php _e('This is a required field. Please fill it!','rmcommon'); ?></label></td>
42  <?php
43  }
44  ?>
45 
46 </tr>
47 <?php
48  endif;
50 ?>
51 </table>
52 </div>
53 </form>