loads the menu for the CISVUE-Header in the server side instead of the client side

This commit is contained in:
SimonGschnell
2024-09-30 11:14:34 +02:00
parent 0e385e8628
commit 8c6f9d1bc4
3 changed files with 16 additions and 8 deletions
@@ -18,7 +18,7 @@ $this->load->view('templates/FHC-Header', $includesArray);
if (!isset($menu)) {
$ci =& get_instance(); // get CI instance
$ci->load->model('content/Content_model', 'ContentModel');
$result = $ci->ContentModel->getMenu(defined('CIS4_MENU_ENTRY') ? CIS4_MENU_ENTRY : null, get_uid());
$result = $ci->ContentModel->getMenu(null, get_uid());
$menu = getData($result) ?? (object)['childs' => []];
}
?>
+10 -1
View File
@@ -15,6 +15,13 @@ $includesArray = array(
$this->load->view('templates/FHC-Header', $includesArray);
if (!isset($menu)) {
$ci =& get_instance(); // get CI instance
$ci->load->model('content/Content_model', 'ContentModel');
$result = $ci->ContentModel->getMenu(defined('CIS4_MENU_ENTRY') ? CIS4_MENU_ENTRY : null, get_uid());
$menu = getData($result)->childs ?? [];
}
?>
<script type="text/javascript">
@@ -30,7 +37,9 @@ $this->load->view('templates/FHC-Header', $includesArray);
logout-url="<?= site_url('Cis/Auth/logout'); ?>"
:selectedtypes="selectedtypes"
:searchbaroptions="searchbaroptions"
:searchfunction="searchfunction" />
:searchfunction="searchfunction"
:menu="<?= htmlspecialchars(json_encode(array_values($menu)), ENT_QUOTES, 'UTF-8') ?>"
></cis-menu>
</header>
<main id="cis-main" class="flex-grow-1 overflow-scroll p-4">