nexus
[ class tree: nexus ] [ index: nexus ] [ all elements ]

Source for file menus.php

Documentation is available at menus.php

  1. <?php
  2. /**
  3.  * @author   xing <xing@synapse.plus.com>
  4.  * @version  $Revision: 1.12 $
  5.  * @package  nexus
  6.  * @subpackage functions
  7.  */
  8.  
  9. /**
  10. * required setup
  11. */
  12. require_once'../bit_setup_inc.php' );
  13. global $gBitSystem;
  14. require_onceNEXUS_PKG_PATH.'Nexus.php');
  15. include_onceNEXUS_PKG_PATH.'menu_lookup_inc.php' );
  16.  
  17. $formfeedback '';
  18. $gBitSystem->verifyPermission'p_nexus_create_menus' );
  19.  
  20. ifisset$_REQUEST['action') ) {
  21.     if$_REQUEST['action'== 'edit' {
  22.         $gBitSmarty->assign'editMenu'$gNexus->getMenu() );
  23.     }
  24.  
  25.     if$_REQUEST['action'== 'remove' {
  26.         $formHash['remove'TRUE;
  27.         $formHash['menu_id'$menuId;
  28.         $msgHash array(
  29.             'label' => 'Delete Menu',
  30.             'confirm_item' => $gNexus->mInfo['title'],
  31.             'warning' => 'This will remove this menu including all menu items associated with it.<br />This cannot be undone!',
  32.         );
  33.         $gBitSystem->confirmDialog$formHash,$msgHash );
  34.     }
  35.  
  36.     if$_REQUEST['action'== 'remove_dead' {
  37.         if$deadLinks $gNexus->expungeDeadItems$menuId ) ) {
  38.             $deadHtml '<ul>';
  39.             foreach$deadLinks as $dead {
  40.                 $deadHtml .= '<li>'.$dead.'</li>';
  41.             }
  42.             $deadHtml .= '</ul>';
  43.             $formfeedback['warning'tra'Links that were dead and removed from ' ).": ".$gNexus->mInfo['title'].$deadHtml;
  44.         else {
  45.             $formfeedback['success'tra'No dead links were found for this menu.' );
  46.         }
  47.     }
  48.  
  49.     if$_REQUEST['action'== 'convert_structure' {
  50.         if$gNexus->importStructure$_REQUEST['structure_id') ) {
  51.             $formfeedback['success'tra'The structure was successfully imported as menu.' );
  52.         else {
  53.             vd$gNexus->mErrors );
  54.         }
  55.     }
  56. }
  57.  
  58. ifisset$_REQUEST['confirm') ) {
  59.     if$gNexus->expungeMenu$menuId ) ) {
  60.         header ("Location: ".NEXUS_PKG_URL."menus.php");
  61.         die;
  62.     else {
  63.         vd$gNexus->mErrors );
  64.     }
  65. }
  66.  
  67. ifisset$_REQUEST['store_menu') ) {
  68.     $menu_id $gNexus->storeMenu$_REQUEST );
  69.     // redirect to menu items page if this is a new menu
  70.     ifempty$menuId ) ) {
  71.         header'Location: '.NEXUS_PKG_URL.'menu_items.php?menu_id='.$menu_id );
  72.         die;
  73.     }
  74.     $gNexus->load();
  75.     $formfeedback['success'tra"The following menu was updated successfully" ).": ".$gNexus->mInfo['title';
  76. }
  77.  
  78. $gBitSmarty->assign'menuList'$menuList $gNexus->getMenuList() );
  79. $gBitSmarty->assign'formfeedback'$formfeedback );
  80.  
  81. // options only available if there is a top bar menu
  82. ifis_fileTEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ) ) {
  83.     // if the top bar is set and we don't need it, remove it.
  84.     $nuke_top_bar TRUE;
  85.     foreach$menuList as $menu {
  86.         if(  $menu['plugin_guid'== NEXUS_PLUGIN_GUID_SUCKERFISH && $menu['menu_type'== 'hor'  {
  87.             $nuke_top_bar FALSE;
  88.         }
  89.     }
  90.  
  91.     if!empty$nuke_top_bar ) ) {
  92.         unlinkTEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' );
  93.     }
  94.  
  95.     if!empty$_REQUEST['store_pos') ) {
  96.         $gBitSmarty->assign'use_custom_top_bar'TRUE );
  97.         $gBitSystem->storeConfig'nexus_top_bar'!empty$_REQUEST['nexus_top_bar'$_REQUEST['nexus_top_bar'NULLNEXUS_PKG_NAME );
  98.     }
  99. }
  100.  
  101. $gBitSystem->setBrowserTitle'Nexus Menus' );
  102. $gBitSystem->display'bitpackage:nexus/menus.tpl' );
  103. ?>

Documentation generated on Thu, 15 Feb 2007 20:43:39 +0000 by phpDocumentor 1.3.0