Source for file menus.php
Documentation is available at menus.php
* @author xing <xing@synapse.plus.com>
* @version $Revision: 1.12 $
require_once( '../bit_setup_inc.php' );
require_once( NEXUS_PKG_PATH. 'Nexus.php');
include_once( NEXUS_PKG_PATH. 'menu_lookup_inc.php' );
$gBitSystem->verifyPermission( 'p_nexus_create_menus' );
if( isset ( $_REQUEST['action'] ) ) {
if( $_REQUEST['action'] == 'edit' ) {
$gBitSmarty->assign( 'editMenu', $gNexus->getMenu() );
if( $_REQUEST['action'] == 'remove' ) {
$formHash['remove'] = TRUE;
$formHash['menu_id'] = $menuId;
'label' => 'Delete Menu',
'confirm_item' => $gNexus->mInfo['title'],
'warning' => 'This will remove this menu including all menu items associated with it.<br />This cannot be undone!',
$gBitSystem->confirmDialog( $formHash,$msgHash );
if( $_REQUEST['action'] == 'remove_dead' ) {
if( $deadLinks = $gNexus->expungeDeadItems( $menuId ) ) {
foreach( $deadLinks as $dead ) {
$deadHtml .= '<li>'. $dead. '</li>';
$formfeedback['warning'] = tra( 'Links that were dead and removed from ' ). ": ". $gNexus->mInfo['title']. $deadHtml;
$formfeedback['success'] = tra( 'No dead links were found for this menu.' );
if( $_REQUEST['action'] == 'convert_structure' ) {
if( $gNexus->importStructure( $_REQUEST['structure_id'] ) ) {
$formfeedback['success'] = tra( 'The structure was successfully imported as menu.' );
if( isset ( $_REQUEST['confirm'] ) ) {
if( $gNexus->expungeMenu( $menuId ) ) {
header ("Location: ". NEXUS_PKG_URL. "menus.php");
if( isset ( $_REQUEST['store_menu'] ) ) {
$menu_id = $gNexus->storeMenu( $_REQUEST );
// redirect to menu items page if this is a new menu
header( 'Location: '. NEXUS_PKG_URL. 'menu_items.php?menu_id='. $menu_id );
$formfeedback['success'] = tra( "The following menu was updated successfully" ). ": ". $gNexus->mInfo['title'] ;
$gBitSmarty->assign( 'menuList', $menuList = $gNexus->getMenuList() );
$gBitSmarty->assign( 'formfeedback', $formfeedback );
// options only available if there is a top bar menu
// if the top bar is set and we don't need it, remove it.
foreach( $menuList as $menu ) {
if( !empty( $nuke_top_bar ) ) {
if( !empty( $_REQUEST['store_pos'] ) ) {
$gBitSmarty->assign( 'use_custom_top_bar', TRUE );
$gBitSystem->storeConfig( 'nexus_top_bar', !empty( $_REQUEST['nexus_top_bar'] ) ? $_REQUEST['nexus_top_bar'] : NULL, NEXUS_PKG_NAME );
$gBitSystem->setBrowserTitle( 'Nexus Menus' );
$gBitSystem->display( 'bitpackage:nexus/menus.tpl' );
|