Move LvVerwaltung treemenu config to config file and disable groups & verband per default

This commit is contained in:
chfhtw
2026-07-21 14:57:41 +02:00
parent 22b1f2822a
commit ae56a4f2ed
2 changed files with 37 additions and 12 deletions
@@ -0,0 +1,32 @@
<?php
/**
* Copyright (C) 2026 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['root'] = [
'stg' => [
'semester' => [
/*'group',
'verband' => [
'group'
]*/
],
'orgform'
]
];
+5 -12
View File
@@ -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",' .