array( 'panel' => true, 'panel-default' => true, ), ); protected $_title; protected $_groups = array(); protected $_collapsible; public function __construct($title, $id = "", $collapsible = false, $startcollapsed = false) { if (!empty($id)) { $this->_attributes['id'] = $id; } $this->_title = $title; $this->_collapsible = $collapsible; $this->_startcollapsed = $startcollapsed; } public function add(Form_Group $group) { array_push($this->_groups, $group); $group->_setParent($this); return $group; } // Shortcut, adds a group for the specified input public function addInput(Form_Input $input) { $group = new Form_Group($input->getTitle()); $group->add($input); $this->add($group); return $input; } public function __toString() { $element = parent::__toString(); $title = htmlspecialchars(gettext($this->_title)); $body = implode('', $this->_groups); $hdricon = ""; $bodyclass = '
'; if ($this->_collapsible) { $hdricon = '' . '' . '' . '' . ''; $bodyclass = '
'; } else { $bodyclass .= 'in">'; } } return <<

{$title}{$hdricon}

{$bodyclass} {$body}
EOT; } }