diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-03 12:13:11 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-03 14:22:56 -0500 |
commit | 331e063ccac63574dbf725138b2be30e6f072c23 (patch) | |
tree | 39b4b5306444d65156db3011eb6b4bb386e1b46a /src/usr/local/www/classes/Form | |
parent | af28e23103b915061d60e94f6416ad47fd0ed1cd (diff) | |
download | pfsense-331e063ccac63574dbf725138b2be30e6f072c23.zip pfsense-331e063ccac63574dbf725138b2be30e6f072c23.tar.gz |
Further changes to Section.class.php and to diag_logs_filter.php
Experimental section collapse
Form_Section() now accepts up to 4 arguments: Form_section(title, id, collapsable, initiall_collapsed)
collapsable = true specifies that the panel should be collapsable and should have a plus/minus icon in the title bar to allow that. Defaults to false
A unique ID is required when collapsable is specified (per page) so we know which panel to collapse
If initially_collapsed is true, the panel starts out collapsed (defaults to false)
Diffstat (limited to 'src/usr/local/www/classes/Form')
-rw-r--r-- | src/usr/local/www/classes/Form/Section.class.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php index d17763e..e012d14 100644 --- a/src/usr/local/www/classes/Form/Section.class.php +++ b/src/usr/local/www/classes/Form/Section.class.php @@ -39,13 +39,14 @@ class Form_Section extends Form_Element protected $_groups = array(); protected $_collapsable; - public function __construct($title, $id = "", $collapsable = false) + public function __construct($title, $id = "", $collapsable = false, $startcollapsed = false) { if (!empty($id)) { $this->_attributes['id'] = $id; } $this->_title = $title; $this->_collapsable = $collapsable; + $this->_startcollapsed = $startcollapsed; } public function add(Form_Group $group) @@ -81,7 +82,12 @@ class Form_Section extends Form_Element '<i class="fa fa-plus-circle"></i>' . '</a>' . '</span>'; - $bodyclass = '<div class="panel-body collapse in">'; + $bodyclass = '<div class="panel-body collapse '; + if ($this->_startcollapsed) { + $bodyclass .= 'out">'; + } else { + $bodyclass .= 'in">'; + } } return <<<EOT |