diff options
author | Sjon Hortensius <sjon@hortensius.net> | 2015-04-25 16:17:27 +0200 |
---|---|---|
committer | Sjon Hortensius <sjon@hortensius.net> | 2015-04-25 16:17:27 +0200 |
commit | 9ba6f7087103871d7b719712e16bc15e976a8e4d (patch) | |
tree | 8af1139f36a4961c25856a55280bae2d9456f754 /usr | |
parent | b49f31d04cb7a559a4164c5eddbe2d6b6abf78bb (diff) | |
download | pfsense-9ba6f7087103871d7b719712e16bc15e976a8e4d.zip pfsense-9ba6f7087103871d7b719712e16bc15e976a8e4d.tar.gz |
Form - show all global Buttons in a single wrapper
fixes #135
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/classes/Form.class.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr/local/www/classes/Form.class.php b/usr/local/www/classes/Form.class.php index c656140..83652bf 100644 --- a/usr/local/www/classes/Form.class.php +++ b/usr/local/www/classes/Form.class.php @@ -100,17 +100,23 @@ class Form extends Form_Element { $element = parent::__toString(); $html = implode('', $this->_sections); + $buttons = ''; foreach ($this->_global as $global) { - if (!$global instanceof Form_Button) - continue; - - $global->setWidth(12 - $this->getLabelWidth()); - $global->column->addClass('col-sm-offset-'. $this->_labelWidth); + if ($global instanceof Form_Button) + $buttons .= $global; + else + $html .= $global; } - $html .= implode('', $this->_global); + if (!empty($buttons)) + { + $group = new Form_Element; + $group->addClass('col-sm-offset-'. $this->_labelWidth, 'col-sm-'. (12 - $this->_labelWidth)); + + $html .= $group . $buttons .'</div>'; + } return <<<EOT {$element} |