further progress on rendering partMenu

This commit is contained in:
Harald Bamberger
2026-05-29 08:42:02 +02:00
parent 861623750d
commit b0fea017f2
6 changed files with 101 additions and 66 deletions
+27 -24
View File
@@ -1,39 +1,42 @@
<?php
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
*/
require_once APPPATH . 'libraries/treemenu/TreeMenuLib.php';
/**
* Description of InOutLib
*
* @author bambi
*/
class InOutLib
class InOutLib extends TreeMenuLib
{
public function getSubMenu()
public function getNodes()
{
return [
'name' => 'International',
'link' => 'inout',
'children' => [
[
'name' => 'Incoming',
'link' => 'inout/incoming',
'leaf' => true
],
[
'name' => 'Outgoing',
'link' => 'inout/outgoing',
'leaf' => true
],
[
'name' => 'Gemeinsame Studien',
'link' => 'inout/gemeinsamestudien',
'leaf' => true
[
'name' => 'International',
'link' => 'inout',
'children' => [
[
'name' => 'Incoming',
'link' => 'inout/incoming',
'leaf' => true
],
[
'name' => 'Outgoing',
'link' => 'inout/outgoing',
'leaf' => true
],
[
'name' => 'Gemeinsame Studien',
'link' => 'inout/gemeinsamestudien',
'leaf' => true
]
]
]
];
}
public function getSubMenu()
{
return [];
}
}
+24 -25
View File
@@ -1,39 +1,38 @@
<?php
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
*/
require_once APPPATH . 'libraries/treemenu/TreeMenuLib.php';
/**
* Description of InOutLib
*
* @author bambi
*/
class StgLib
class StgLib extends TreeMenuLib
{
public function getNodes()
{
$this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
$res = $this->ci->StudiengangModel->loadWhere(array('aktiv' => true));
$stgs = hasData($res) ? getData($res) : array();
$this->ci->addMeta('bhstg', $stgs);
$nodes = array_map(
function($stg) {
return array(
'name' => strtoupper($stg->typ . $stg->kurzbz) . ' ' . $stg->bezeichnung,
'link' => 'stg/' . $stg->studiengang_kz,
'leaf' => false
);
},
$stgs
);
return $nodes;
}
public function getSubMenu()
{
return [
'name' => 'International',
'link' => 'inout',
'children' => [
[
'name' => 'Incoming',
'link' => 'inout/incoming',
'leaf' => true
],
[
'name' => 'Outgoing',
'link' => 'inout/outgoing',
'leaf' => true
],
[
'name' => 'Gemeinsame Studien',
'link' => 'inout/gemeinsamestudien',
'leaf' => true
]
]
'StgLib' => 'test123'
];
}
}
+11 -4
View File
@@ -1,5 +1,5 @@
<?php
require_once APPPATH . 'library/treemenu/TreeMenuLib.php';
require_once APPPATH . 'libraries/treemenu/TreeMenuLib.php';
/**
* Description of StvMenuLib
*
@@ -9,8 +9,15 @@ class StvMenuLib extends TreeMenuLib
{
public function getSubMenu()
{
return [
'StvMenuLib' => null
];
$nodes = array();
foreach($this->children_config as $childconfig)
{
$childlib = basename($childconfig['library']);
$childnodes = $this->ci->$childlib->getNodes();
$nodes = array_merge($nodes, $childnodes);
}
return $nodes;
}
}
@@ -17,12 +17,12 @@ abstract class TreeMenuLib
public function __construct($children_config)
{
$this->ci = get_instance();
$this->ci =& get_instance();
$this->children_config = $children_config;
foreach($this->children_config as $child_config)
{
$grandchildren_config = isset($child_config['children']) ? $child_config['children'] : [];
$this->ci->load->library($child_config->library, $grandchildren_config);
$this->ci->load->library($child_config['library'], $grandchildren_config, basename($child_config['library']));
}
}