From 4a5a0198416772320de83cef2ecb2176d6b73846 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 30 Sep 2024 11:33:55 +0200 Subject: [PATCH] loads the menu for the CISVUE-Header in the server side and not in the client side --- application/models/content/Content_model.php | 22 +++++++++++++++++++ application/views/templates/CISVUE-Header.php | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/application/models/content/Content_model.php b/application/models/content/Content_model.php index ed447b36a..93259a57c 100755 --- a/application/models/content/Content_model.php +++ b/application/models/content/Content_model.php @@ -66,6 +66,28 @@ class Content_model extends DB_Model return success(current(getData($result))); } + /** + * Sucht die content_id fuer den CIS4_Root Menu content + * + * @return integer|null content_id of the Cis4_Root Menu + */ + public function getCIS4_ContentID(){ + $CIS4_ROOT_CONTENT = $this->loadWhere(["beschreibung"=>"CIS4_ROOT"]); + if(isError($CIS4_ROOT_CONTENT)) + { + return null; + } + $CIS4_ROOT_CONTENT = getData($CIS4_ROOT_CONTENT); + if(count($CIS4_ROOT_CONTENT) > 0) + { + return current($CIS4_ROOT_CONTENT)->content_id ?? null; + } + else + { + return null; + } + } + /** * Laedt alle Content Eintraege unterhalb eines Contents * (Ohne Newseintraege) diff --git a/application/views/templates/CISVUE-Header.php b/application/views/templates/CISVUE-Header.php index d738dbde9..692d73b86 100755 --- a/application/views/templates/CISVUE-Header.php +++ b/application/views/templates/CISVUE-Header.php @@ -19,7 +19,8 @@ $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()); + $cis4_content_id = $ci->ContentModel->getCIS4_ContentID(); + $result = $ci->ContentModel->getMenu($cis4_content_id, get_uid()); $menu = getData($result)->childs ?? []; } ?>