diff --git a/application/controllers/api/frontend/v1/LvMenu.php b/application/controllers/api/frontend/v1/LvMenu.php index f7f5d2557..84cdd3f62 100644 --- a/application/controllers/api/frontend/v1/LvMenu.php +++ b/application/controllers/api/frontend/v1/LvMenu.php @@ -277,11 +277,23 @@ class LvMenu extends FHCAPI_Controller foreach ($menu as $key => $row){ $pos[$key] = $row['position']; - // replace the path to the icon - $menu[$key]['icon'] = base_url(str_replace("../../..","",$row['icon'])); - // replace the quatations in the link_onclick + + // adds new key with modified icon path to the menu + $menu[$key]['cis4_icon'] = base_url(str_replace("../../..","",$row['icon'])); + + // adds new key with modified link_onclick link to the menu if(array_key_exists("link_onclick",$menu[$key])){ - $menu[$key]['link_onclick'] = str_replace("\"","'",$menu[$key]['link_onclick']); + $menu[$key]['cis4_link_onclick'] = str_replace("\"","'",$menu[$key]['link_onclick']); + } + + // adds new key with modified link to the menu + if(array_key_exists("link",$menu[$key])){ + // only replace the link key if the link has an old path + if(strpos($menu[$key]['link'],"../../..") != false){ + $menu[$key]['cis4_link'] = base_url(str_replace("../../..","",$row['link'])); + }else{ + $menu[$key]['cis4_link'] = $menu[$key]['link']; + } } } diff --git a/public/js/components/Cis/Mylv/LvUebersicht.js b/public/js/components/Cis/Mylv/LvUebersicht.js index 2e14a11fd..d0f0ea09e 100644 --- a/public/js/components/Cis/Mylv/LvUebersicht.js +++ b/public/js/components/Cis/Mylv/LvUebersicht.js @@ -20,8 +20,8 @@ export default { }, methods:{ showModal: function(){ - //this.$fhcApi.factory.addons.getLvMenu(this.event.lehrveranstaltung_id, this.event.studiensemester_kurzbz).then(res =>{ - this.$fhcApi.factory.addons.getLvMenu(750, "WS2005").then(res =>{ + this.$fhcApi.factory.addons.getLvMenu(this.event.lehrveranstaltung_id, this.event.studiensemester_kurzbz).then(res =>{ + //this.$fhcApi.factory.addons.getLvMenu(750, "WS2005").then(res =>{ this.menu = res.data; }); }, @@ -32,15 +32,16 @@ export default { template:/*html*/`