20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
37 function insertBreak($extra =
'', $class =
'')
39 $class = ($class !=
'') ?
" class='" . preg_replace(
'/[^A-Za-z0-9\s\s_-]/i',
'', $class) .
"'" :
'';
42 $extra =
'<tr><td colspan="2" ' . $class .
'>' . $extra .
'</td></tr>';
43 $this->addElement($extra);
45 $extra =
'<tr><td colspan="2" ' . $class .
'> </td></tr>';
46 $this->addElement($extra);
65 $ele_name = $this->getName();
66 $ret =
'<form name="' . $ele_name .
'" id="' . $ele_name .
'" action="' . $this->getAction() .
'" method="' . $this->getMethod() .
'" onsubmit="return xoopsFormValidate_' . $ele_name .
'();"' . $this->getExtra() .
'>
67 <table width="100%" class="outer" cellspacing="1">
68 <tr><th colspan="2">' . $this->getTitle() .
'</th></tr>
72 foreach ($this->getElements() as $ele) {
73 if (!is_object($ele)) {
75 }
else if (!$ele->isHidden()) {
76 if (!$ele->getNocolspan()) {
77 $ret .=
'<tr valign="top" align="left"><td class="head">';
78 if (($caption = $ele->getCaption()) !=
'') {
79 $ret .=
'<div class="xoops-form-element-caption' . ($ele->isRequired() ?
'-required' :
'') .
'">';
80 $ret .=
'<span class="caption-text">' . $caption .
'</span>';
81 $ret .=
'<span class="caption-marker">*</span>';
84 if (($desc = $ele->getDescription()) !=
'') {
85 $ret .=
'<div class="xoops-form-element-help">' . $desc .
'</div>';
87 $ret .=
'</td><td class="' . $class .
'">' . $ele->render() .
'</td></tr>' . NWLINE;
89 $ret .=
'<tr valign="top" align="left"><td class="head" colspan="2">';
90 if (($caption = $ele->getCaption()) !=
'') {
91 $ret .=
'<div class="xoops-form-element-caption' . ($ele->isRequired() ?
'-required' :
'') .
'">';
92 $ret .=
'<span class="caption-text">' . $caption .
'</span>';
93 $ret .=
'<span class="caption-marker">*</span>';
96 $ret .=
'</td></tr><tr valign="top" align="left"><td class="' . $class .
'" colspan="2">' . $ele->render() .
'</td></tr>';
99 $hidden .= $ele->render();
102 $ret .=
'</table>' . NWLINE .
' ' . $hidden .
'</form>' . NWLINE;
103 $ret .= $this->renderValidationJS(
true);