From bc9f24732384e89fc24fdd705c264decba196ed8 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 10 Jul 2024 09:10:35 +0200 Subject: [PATCH] replaces wrong quatations in the menu items if the link_onclick array key is defined --- application/controllers/api/frontend/v1/LvMenu.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/controllers/api/frontend/v1/LvMenu.php b/application/controllers/api/frontend/v1/LvMenu.php index d1ca7e8d6..f7f5d2557 100644 --- a/application/controllers/api/frontend/v1/LvMenu.php +++ b/application/controllers/api/frontend/v1/LvMenu.php @@ -248,7 +248,8 @@ class LvMenu extends FHCAPI_Controller // Addons Menu Logic // ########################################################################################## - $params = [ + + $params = [ 'user'=>$user, 'lvid'=>$lvid, 'studiensemester_kurzbz'=>$studiensemester_kurzbz, @@ -271,12 +272,17 @@ class LvMenu extends FHCAPI_Controller $params ); - // Menu sortieren // ########################################################################################## + 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 + if(array_key_exists("link_onclick",$menu[$key])){ + $menu[$key]['link_onclick'] = str_replace("\"","'",$menu[$key]['link_onclick']); + } } array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);