XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
tableform.php
Go to the documentation of this file.
1 <?php
20 defined('XOOPS_ROOT_PATH') or die('Restricted access');
21 
23 
29 class XoopsTableForm extends XoopsForm
30 {
44  function render()
45  {
46  $ret = $this->getTitle() . NWLINE
47  . '<form name="' . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>'
48  . NWLINE . '<table border="0" width="100%">' . NWLINE;
49  $hidden = "";
50  foreach ($this->getElements() as $ele) {
51  if (!$ele->isHidden()) {
52  if (!$ele->getNocolspan()) {
53  $ret .= '<tr valign="top" align="left"><td>' . $ele->getCaption();
54  if ($ele_desc = $ele->getDescription()) {
55  $ret .= '<br /><br /><span style="font-weight: normal;">' . $ele_desc . '</span>';
56  }
57  $ret .= '</td><td>' . $ele->render() . '</td></tr>';
58  } else {
59  $ret .= '<tr valign="top" align="left"><td colspan="2">' . $ele->getCaption();
60  $ret .= '</td></tr><tr valign="top" align="left"><td>' . $ele->render() . '</td></tr>';
61  }
62  } else {
63  $hidden .= $ele->render() . NWLINE;
64  }
65  }
66  $ret .= '</table>' . NWLINE . ' ' . $hidden . '</form>' . NWLINE;
67  return $ret;
68  }
69 }
70 
71 ?>