From 7b089f1513145f3d06a0e56eedf424c07b1d5fdd Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 5 Oct 2010 15:08:38 +0000 Subject: [PATCH] Fixed a small bug in main menu block; Hopefully finally finished the menu block; --- root/portal/modules/portal_main_menu.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/root/portal/modules/portal_main_menu.php b/root/portal/modules/portal_main_menu.php index 27e15a4a..770c1e73 100644 --- a/root/portal/modules/portal_main_menu.php +++ b/root/portal/modules/portal_main_menu.php @@ -344,23 +344,10 @@ class portal_main_menu_module if (confirm_box(true)) { - $cur_link_title = $links_titles[$link_id]; - // make sure we don't delete links that weren't supposed to be deleted, i.e. duplicate links - $del_ary = array( - 'title' => '{remove_link}', - 'url' => '{remove_link}', - 'type' => '{remove_link}', - 'permission' => '{remove_link}', - ); - - $links[$link_id] = array( - 'title' => '{remove_link}', - 'url' => '{remove_link}', - 'type' => '{remove_link}', - 'permission' => '{remove_link}', - ); - - $links = array_diff($links, $del_ary); + $cur_link_title = $links[$link_id]['title']; + // delete the selected link and reset the array numbering afterwards + array_splice($links, $link_id, 1); + $links = array_merge($links); $board3_menu_array = serialize($links); set_portal_config('board3_menu_array_' . $module_id, $board3_menu_array); @@ -463,7 +450,7 @@ class portal_main_menu_module for ($i = 0; $i < sizeof($links); $i++) { $template->assign_block_vars('links', array( - 'LINK_TITLE' => ($action != 'add') ? $links[$i]['title'] : '', + 'LINK_TITLE' => ($action != 'add') ? ((isset($user->lang[$links[$i]['title']])) ? $user->lang[$links[$i]['title']] : $links[$i]['title']) : '', 'LINK_URL' => ($action != 'add') ? str_replace('&', '&', $links[$i]['url']) : '', 'U_EDIT' => $u_action . '&action=edit&id=' . $i,