diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-03 14:50:13 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-03 14:50:13 -0500 |
commit | d47bc2cea9246888652630d3218caf84d820c417 (patch) | |
tree | 7fc5abaf8fa4199bb2b6d5b3b0bdffbcacf6b8f5 /src/usr/local/www/classes | |
parent | 16e4d564fd6bf4767540954a4cabc004e5155bff (diff) | |
download | pfsense-d47bc2cea9246888652630d3218caf84d820c417.zip pfsense-d47bc2cea9246888652630d3218caf84d820c417.tar.gz |
Revise collapsible section behavior to use defines (COLLAPSIBLE, SEC_OPEN, SEC_CLOSED)
Diffstat (limited to 'src/usr/local/www/classes')
-rw-r--r-- | src/usr/local/www/classes/Form/Section.class.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php index baf4d8d..ac1587d 100644 --- a/src/usr/local/www/classes/Form/Section.class.php +++ b/src/usr/local/www/classes/Form/Section.class.php @@ -26,6 +26,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +define(COLLAPSIBLE, 0x08); +define(SEC_CLOSED, 0x04); +define(SEC_OPEN, 0x00); + class Form_Section extends Form_Element { protected $_tagName = 'div'; @@ -39,14 +43,13 @@ class Form_Section extends Form_Element protected $_groups = array(); protected $_collapsible; - public function __construct($title, $id = "", $collapsible = false, $startcollapsed = false) + public function __construct($title, $id = "", $collapsible = 0) { if (!empty($id)) { $this->_attributes['id'] = $id; } $this->_title = $title; $this->_collapsible = $collapsible; - $this->_startcollapsed = $startcollapsed; } public function add(Form_Group $group) @@ -76,14 +79,14 @@ class Form_Section extends Form_Element $hdricon = ""; $bodyclass = '<div class="panel-body">'; - if ($this->_collapsible) { + if ($this->_collapsible & COLLAPSIBLE) { $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 '; - if ($this->_startcollapsed) { + if (($this->_collapsible & SEC_CLOSED)) { $bodyclass .= 'out">'; } else { $bodyclass .= 'in">'; |