Extensions Extend Navigation Menu Estimated reading: 4 minutes New Main Menu Item If you want to extend the main menus you first have to create an new Menu item at admin->setup->menu functions. This item must be in the main category “Main menu” and in the sub category “Main menu”. Beside the name no other parameter is neccessary. The ID of this new menue item is needed to to extend the left navigation menue. After a reset and a reload of the page the new menue item is shown next to the existing items in the top main menue. If there is nothing written in the column “URL” the navigation menue with the new menue ID is shown. (Menu Points) New Navigation Menu The own navigation menue must be created in the extension file “ext_nav.inc” in the extension directory. To do this a blank file with the name “ext_nav.inc” is created in the EXTENSION directory or in a subdirectory. There the existing menue array can be extended (Script Extensions).. The own menue array is inserted by its ID. The used IDs are arbitrary but they should begin at 1000 so they don’t override a limbas menue. A good way to do is to create ID blocks for the group containers and the corresponding menues. The range of these ID blocks should be wide enough to allow additional menue items. $menu[1000] = $meinmenue1; $menu[1001] = $meinmenue2; A new menu item must be created for each sub-item in the navigation menu, which should have its own extension (admin-> setup-> menu items).This must be under the main category “extensions” and must also have a unique action name. Parameters id : unique number name: text for the name of the menu bg: background color link_url: ClickEvent of the menu item (URL Syntax) gicon: displayed image before naming the group container icon_url: displayed image before naming the menu Example ext_nav.inc <?php # check for rights if(!$LINK[1000]){return;} # first group-item $ebzm = 1100; $LINK["id"][$ebzm] = $ebzm; $LINK["name"][$ebzm] = lmb_utf8_decode("Customers"); $LINK["gicon"][$ebzm] = "EXTENSIONS/pic/supplier.png"; # first sub-item $ebzm = 1101; $LINK["id"][$ebzm] = $ebzm; $LINK["name"][$ebzm] = lmb_utf8_decode("new Customers"); $LINK["link_url"][$ebzm] = "parent.main.document.location.href='main.php?&action=gtab_neu>abid=1&form_id=1'"; $LINK["bg"][$ebzm] = '#FFFFFF'; $LINK["icon_url"][$ebzm] = 'pic/silk_icons/page_code.gif'; # second sub-item $ebzm = 1102; $LINK["id"][$ebzm] = $ebzm; $LINK["name"][$ebzm] = lmb_utf8_decode("Summary"); $LINK["link_url"][$ebzm] = "parent.main.document.location.href='main.php?action=gtab_erg>abid=1&form_id=2'"; $LINK["bg"][$ebzm] = '#FFFFFF'; $ebzm++; $LINK["icon_url"][$ebzm] = 'pic/silk_icons/page_code.gif'; # second group-item $ebzm = 1200; $LINK["id"][$ebzm] = $ebzm; $LINK["name"][$ebzm] = lmb_utf8_decode("Visitors"); $LINK["gicon"][$ebzm] = "EXTENSIONS/pic/visitors.png"; $ebzm++; # first sub-item $ebzm = 1201; $LINK["id"][$ebzm] = $ebzm; $LINK["name"][$ebzm] = lmb_utf8_decode("new Visitors"); $LINK["link_url"][$ebzm] = "parent.main.document.location.href='main.php?&action=gtab_neu>abid=2'"; $LINK["bg"][$ebzm] = '#FFFFFF'; # second sub-item $ebzm = 1202; $LINK["id"][$ebzm] = $ebzm; $LINK["name"][$ebzm] = lmb_utf8_decode("Summary"); $LINK["link_url"][$ebzm] = "parent.main.document.location.href='main.php?action=gtab_erg>abid=2'"; $LINK["bg"][$ebzm] = '#FFFFFF'; $ebzm++; $menu1 = array(); $menu0 = menu_get_standard(1100,0); $menus1 = array(); for ($i=1101;$i<=1102;$i++){ $menus0 = menu_get_standard($i,0);$menus1 = array_merge($menus1,$menus0); } $menu0[0]["child"] = $menus1; $menu1 = array_merge($menu1,$menu0); # --------------------------------- $menu0 = menu_get_standard(1200,0); $menus1 = array(); for ($i=1201;$i<=1202;$i++){ $menus0 = menu_get_standard($i,0);$menus1 = array_merge($menus1,$menus0); } $menu0[0]["child"] = $menus1; $menu1 = array_merge($menu1,$menu0); # adding new menu for mainmenu-item with id = 1000 $menu[1000] = $menu1; # show menu with id 1000 as default menu $displayMainMenu = "mainMenu('1000')"; ?>