summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/classes
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-12-01 09:41:13 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-12-01 09:41:13 -0500
commitd5d5836c4f94e70f5f4ddf1df8ac8bb6e684202c (patch)
tree277adefba5c50e67650b180ef96063ff559839b5 /src/usr/local/www/classes
parent3c759cafc710ddef828d3bbf28478a6828505808 (diff)
downloadpfsense-d5d5836c4f94e70f5f4ddf1df8ac8bb6e684202c.zip
pfsense-d5d5836c4f94e70f5f4ddf1df8ac8bb6e684202c.tar.gz
Experimental changes to Form_Section() to allow the panel to be made collapsable in the same way that dashboard widgets are.
Currently used on diag_logs_filter.php ONLY
Diffstat (limited to 'src/usr/local/www/classes')
-rw-r--r--src/usr/local/www/classes/Form/Section.class.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php
index bebc11c..d17763e 100644
--- a/src/usr/local/www/classes/Form/Section.class.php
+++ b/src/usr/local/www/classes/Form/Section.class.php
@@ -37,13 +37,15 @@ class Form_Section extends Form_Element
);
protected $_title;
protected $_groups = array();
+ protected $_collapsable;
- public function __construct($title, $id = "")
+ public function __construct($title, $id = "", $collapsable = false)
{
if (!empty($id)) {
$this->_attributes['id'] = $id;
}
$this->_title = $title;
+ $this->_collapsable = $collapsable;
}
public function add(Form_Group $group)
@@ -70,13 +72,24 @@ class Form_Section extends Form_Element
$element = parent::__toString();
$title = htmlspecialchars(gettext($this->_title));
$body = implode('', $this->_groups);
+ $hdricon = "";
+ $bodyclass = '<div class="panel-body">';
+
+ if ($this->_collapsable) {
+ $hdricon = '<span class="widget-heading-icon">' .
+ '<a data-toggle="collapse" href="#' . $this->_attributes['id'] . ' .panel-body">' .
+ '<i class="fa fa-plus-circle"></i>' .
+ '</a>' .
+ '</span>';
+ $bodyclass = '<div class="panel-body collapse in">';
+ }
return <<<EOT
{$element}
<div class="panel-heading">
- <h2 class="panel-title">{$title}</h2>
+ <h2 class="panel-title">{$title}{$hdricon}</h2>
</div>
- <div class="panel-body">
+ {$bodyclass}
{$body}
</div>
</div>
OpenPOWER on IntegriCloud