21 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
33 var $_elements = array();
40 var $_required = array();
57 $this->setName( $name );
58 $this->setCaption( $caption );
59 $this->_delimeter = $delimeter;
77 return !empty( $this->_required );
85 function addElement( &$formElement, $required =
false ) {
86 $this->_elements[] = $formElement;
87 if ( !$formElement->isContainer() ) {
89 $formElement->_required =
true;
90 $this->_required[] = $formElement;
93 $required_elements = $formElement->getRequired();
94 $count = count( $required_elements );
95 for (
$i = 0 ;
$i < $count;
$i++ ) {
96 $this->_required[] = &$required_elements[
$i];
107 return $this->_required;
118 return $this->_elements;
121 $count = count( $this->_elements );
122 for (
$i = 0;
$i < $count;
$i++ ) {
123 if ( !$this->_elements[
$i]->isContainer() ) {
124 $ret[] = &$this->_elements[
$i];
126 $elements = &$this->_elements[
$i]->getElements(
true );
127 $count2 = count( $elements );
128 for (
$j = 0;
$j < $count2;
$j++ ) {
145 return $encode ? htmlspecialchars( str_replace(
' ',
' ', $this->_delimeter ) ) : $this->_delimeter;
156 foreach ( $this->getElements() as $ele ) {
158 $ret .= $this->getDelimeter();
160 if ( $ele->getCaption() !=
'' ) {
161 $ret .= $ele->getCaption() .
" ";
163 $ret .= $ele->render() . NWLINE ;
164 if ( !$ele->isHidden() ) {