mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
loads the menu for the CISVUE-Header in the server side instead of the client side
This commit is contained in:
@@ -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' => []];
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -7,7 +7,8 @@ export default {
|
||||
FhcSearchbar
|
||||
},
|
||||
props: {
|
||||
rootUrl: String,
|
||||
menu: Array,
|
||||
rootUrl: String,
|
||||
logoUrl: String,
|
||||
avatarUrl: String,
|
||||
logoutUrl: String,
|
||||
@@ -27,11 +28,9 @@ export default {
|
||||
this.activeEntry = content_id;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/CisVue/Menu').then(res => {
|
||||
this.entries = res.data.retval.childs;
|
||||
});
|
||||
},
|
||||
mounted(){
|
||||
this.entries = this.menu;
|
||||
},
|
||||
template: /*html*/`
|
||||
<!--<p>CISVUE HEADER</p>
|
||||
<p>active entry content_id : {{activeEntry}}</p>
|
||||
|
||||
Reference in New Issue
Block a user