From f8126b70cf8e4c9a744a99a3eb41de158a26a517 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 12 Jun 2016 19:11:04 -0400 Subject: Add functions to Common model for assigning CSS to setting tabs The setting modal window will need to support showing unknown tabs at the beginning of the tab list. These functions handle assigning specific CSS classes to tab-panes ONLY if that tab will appear in the left-most position in the modal's tab list. --- app/model/common.mod.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'app/model/common.mod.php') diff --git a/app/model/common.mod.php b/app/model/common.mod.php index 07b86df..e478e9d 100644 --- a/app/model/common.mod.php +++ b/app/model/common.mod.php @@ -34,6 +34,8 @@ class CommonModel extends MasterModel function __construct() { parent::__construct(); + $this->first_setting_tab_active = 0; + $this->first_setting_tab_disp = 0; $this->common_handleFormSubmissions($_REQUEST['input'], $_FILES['attachment']); $this->common_deflt(); } @@ -363,6 +365,34 @@ class CommonModel extends MasterModel $this->redirectTo($this->ar() . "/"); } } + + /* + * Set CSS class for the first tab title in the setting modal only + */ + function getSettingModalTabActiveClass() + { + if (!$this->first_setting_tab_active) + { + $this->first_setting_tab_active = 1; + return "active"; + } + + return ""; + } + + /* + * Set CSS classes for the first tab in the setting modal only + */ + function getSettingModalTabDispClasses() + { + if (!$this->first_setting_tab_disp) + { + $this->first_setting_tab_disp = 1; + return "in active"; + } + + return ""; + } } ?> -- cgit v1.2.3