From 82e546cfa47dbc7d5d7a780c92129a871087ee12 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 26 Mar 2019 12:04:35 +0100 Subject: [inc/Dashboard] Add feature to collapse sections in sidebar mode Modules can now declare that they should be collapsed by default. If a menu category only contains such modules, it will be collapsed in the sidebar mode of the menu. --- inc/module.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc/module.inc.php') diff --git a/inc/module.inc.php b/inc/module.inc.php index 6d160787..5525c0a4 100644 --- a/inc/module.inc.php +++ b/inc/module.inc.php @@ -146,6 +146,7 @@ class Module private $directActivation = false; private $dependencies = array(); private $name; + private $collapse; /** * @var array assoc list of 'filename.css' => true|false (true = always load, false = only if module is main module) */ @@ -167,6 +168,7 @@ class Module if (isset($json['category']) && is_string($json['category'])) { $this->category = $json['category']; } + $this->collapse = isset($json['collapse']) && (bool)$json['collapse']; if (isset($json['client-plugin'])) { $this->clientPlugin = (bool)$json['client-plugin']; } @@ -275,6 +277,11 @@ class Module return Dictionary::getCategoryName($this->category); } + public function doCollapse() + { + return $this->collapse; + } + public function getDir() { return 'modules/' . $this->name; -- cgit v1.2.3-55-g7522