From ae56a4f2edcbb9fefc9d7f63a84dbe96f21e9670 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Tue, 21 Jul 2026 14:57:41 +0200 Subject: [PATCH] Move LvVerwaltung treemenu config to config file and disable groups & verband per default --- application/config/treemenu/custom/lvvw.php | 32 +++++++++++++++++++++ application/libraries/treemenu/LvVwLib.php | 17 ++++------- 2 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 application/config/treemenu/custom/lvvw.php diff --git a/application/config/treemenu/custom/lvvw.php b/application/config/treemenu/custom/lvvw.php new file mode 100644 index 000000000..a1f270e05 --- /dev/null +++ b/application/config/treemenu/custom/lvvw.php @@ -0,0 +1,32 @@ +. + */ + +if (!defined('BASEPATH')) exit('No direct script access allowed'); + +$config['root'] = [ + 'stg' => [ + 'semester' => [ + /*'group', + 'verband' => [ + 'group' + ]*/ + ], + 'orgform' + ] +]; diff --git a/application/libraries/treemenu/LvVwLib.php b/application/libraries/treemenu/LvVwLib.php index bec66a5fb..d3c91a196 100644 --- a/application/libraries/treemenu/LvVwLib.php +++ b/application/libraries/treemenu/LvVwLib.php @@ -34,17 +34,8 @@ class LvVwLib $this->_ci =& get_instance(); // Load Tree-config - $this->config = [ - 'stg' => [ - 'semester' => [ - 'group', - 'verband' => [ - 'group' - ] - ], - 'orgform' - ] - ]; + $this->_ci->load->config('treemenu/custom/lvvw'); + $this->config = $this->_ci->config->item('root'); // Load Libraries $this->_ci->load->library('treemenu/base/StgLib'); @@ -74,13 +65,15 @@ class LvVwLib return $this->_ci->stglib->studiengang($path_template, $permittedStgs); } - public function semester($path_template, $stg) + public function semester($path_template, $has_children, $stg) { $stg = $this->getStgFromUrl($stg); if ($stg === null) return []; + if (!$has_children) + $this->_ci->StudiengangModel->db->select('TRUE AS leaf', false); $this->_ci->StudiengangModel->addSelect("ARRAY['link', FORMAT('{" . '"type": "verband",' . '"id": "lv/%1$s/%2$s",' .