| 1: | <?php | 
| 2: |  | 
| 3: |  | 
| 4: |  | 
| 5: |  | 
| 6: |  | 
| 7: |  | 
| 8: |  | 
| 9: |  | 
| 10: |  | 
| 11: |  | 
| 12: |  | 
| 13: |  | 
| 14: |  | 
| 15: |  | 
| 16: |  | 
| 17: |  | 
| 18: |  | 
| 19: | defined('XOOPS_ROOT_PATH') || exit('Restricted access'); | 
| 20: |  | 
| 21: | xoops_load('XoopsForm'); | 
| 22: |  | 
| 23: |  | 
| 24: |  | 
| 25: |  | 
| 26: |  | 
| 27: |  | 
| 28: | class XoopsTableForm extends XoopsForm | 
| 29: | { | 
| 30: |  | 
| 31: |  | 
| 32: |  | 
| 33: |  | 
| 34: |  | 
| 35: |  | 
| 36: |  | 
| 37: |  | 
| 38: |  | 
| 39: |  | 
| 40: |  | 
| 41: |  | 
| 42: |  | 
| 43: | public function render() | 
| 44: | { | 
| 45: | $ret    = $this->getTitle() . NWLINE . '<form name="' . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>' . NWLINE . '<table border="0" width="100%">' . NWLINE; | 
| 46: | $hidden = ''; | 
| 47: | foreach ($this->getElements() as $ele) { | 
| 48: | if (!$ele->isHidden()) { | 
| 49: | if (!$ele->getNocolspan()) { | 
| 50: | $ret .= '<tr valign="top" align="left"><td>' . $ele->getCaption(); | 
| 51: | if ($ele_desc = $ele->getDescription()) { | 
| 52: | $ret .= '<br><br><span style="font-weight: normal;">' . $ele_desc . '</span>'; | 
| 53: | } | 
| 54: | $ret .= '</td><td>' . $ele->render() . '</td></tr>'; | 
| 55: | } else { | 
| 56: | $ret .= '<tr valign="top" align="left"><td colspan="2">' . $ele->getCaption(); | 
| 57: | $ret .= '</td></tr><tr valign="top" align="left"><td>' . $ele->render() . '</td></tr>'; | 
| 58: | } | 
| 59: | } else { | 
| 60: | $hidden .= $ele->render() . NWLINE; | 
| 61: | } | 
| 62: | } | 
| 63: | $ret .= '</table>' . NWLINE . ' ' . $hidden . '</form>' . NWLINE; | 
| 64: |  | 
| 65: | return $ret; | 
| 66: | } | 
| 67: | } | 
| 68: |  |