summaryrefslogtreecommitdiff
path: root/menus.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-08-01 18:41:13 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-08-01 18:41:13 +0000
commit9c238aa595e3a2ccfad8d4ecbeed2964b0915a1d (patch)
treeceef43ef95b299b58c71462823742fd27089e5e0 /menus.php
parent8e13f91c98f92fa2a523cbbd4e8d874ba3d21958 (diff)
downloadnexus-9c238aa595e3a2ccfad8d4ecbeed2964b0915a1d.tar.gz
nexus-9c238aa595e3a2ccfad8d4ecbeed2964b0915a1d.tar.bz2
nexus-9c238aa595e3a2ccfad8d4ecbeed2964b0915a1d.zip
merge recent changes with HEAD - R1 and HEAD are identical now
Diffstat (limited to 'menus.php')
-rw-r--r--menus.php40
1 files changed, 34 insertions, 6 deletions
diff --git a/menus.php b/menus.php
index 2d4d4d5..86f5207 100644
--- a/menus.php
+++ b/menus.php
@@ -1,7 +1,7 @@
<?php
/**
* @author xing <xing@synapse.plus.com>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
* @package nexus
* @subpackage functions
*/
@@ -14,12 +14,14 @@ global $gBitSystem;
require_once( NEXUS_PKG_PATH.'Nexus.php');
include_once( NEXUS_PKG_PATH.'menu_lookup_inc.php' );
+$formfeedback = '';
$gBitSystem->verifyPermission( 'bit_p_create_nexus_menus' );
if( isset( $_REQUEST['action'] ) ) {
if( $_REQUEST['action'] == 'edit' ) {
- $smarty->assign( 'editMenu', $gNexus->getMenu() );
+ $gBitSmarty->assign( 'editMenu', $gNexus->getMenu() );
}
+
if( $_REQUEST['action'] == 'remove' ) {
$formHash['remove'] = TRUE;
$formHash['menu_id'] = $menuId;
@@ -30,6 +32,13 @@ if( isset( $_REQUEST['action'] ) ) {
);
$gBitSystem->confirmDialog( $formHash,$msgHash );
}
+
+ if( $_REQUEST['action'] == 'rewrite_cache' ) {
+ if( $gNexus->rewriteModuleCache() ) {
+ $formfeedback['success'] = 'The complete menu cache has been rewritten.';
+ }
+ }
+
if( $_REQUEST['action'] == 'remove_dead' ) {
if( $deadLinks = $gNexus->expungeDeadItems( $menuId ) ) {
$deadHtml = '<ul>';
@@ -42,6 +51,7 @@ if( isset( $_REQUEST['action'] ) ) {
$formfeedback['success'] = 'No dead links were found for this menu.';
}
}
+
if( $_REQUEST['action'] == 'convert_structure' ) {
if( $gNexus->importStructure( $_REQUEST['structure_id'] ) ) {
$formfeedback['success'] = 'The structure was successfully imported as menu.';
@@ -50,6 +60,7 @@ if( isset( $_REQUEST['action'] ) ) {
}
}
}
+
if( isset( $_REQUEST['confirm'] ) ) {
if( $gNexus->expungeMenu( $menuId ) ) {
header ("Location: ".NEXUS_PKG_URL."menus.php");
@@ -63,16 +74,33 @@ if( isset( $_REQUEST['store_menu'] ) ) {
$menu_id = $gNexus->storeMenu( $_REQUEST );
// redirect to menu items page if this is a new menu
if( empty( $menuId ) ) {
- header( 'Location: '.NEXUS_PKG_URL.'menu_items.php?menu_id='.$menu_id.'&tab=edit' );
+ header( 'Location: '.NEXUS_PKG_URL.'menu_items.php?menu_id='.$menu_id );
die;
}
$gNexus->load();
$formfeedback['success'] = 'The menu \''.$gNexus->mInfo['title'].'\' was updated successfully.';
}
-$smarty->assign( 'menuList', $gNexus->getMenuList() );
-if( isset( $formfeedback ) ) {
- $smarty->assign( 'formfeedback', $formfeedback );
+$gBitSmarty->assign( 'menuList', $menuList = $gNexus->getMenuList() );
+$gBitSmarty->assign( 'formfeedback', $formfeedback );
+
+// options only available if there is a top bar menu
+if( is_file( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ) ) {
+ // if the top bar is set and we don't need it, remove it.
+ foreach( $menuList as $menu ) {
+ if( !( $menu['plugin_guid'] == NEXUS_PLUGIN_GUID_SUCKERFISH && $menu['type'] == 'hor' ) ) {
+ $nuke_top_bar = TRUE;
+ }
+ }
+
+ if( !empty( $nuke_top_bar ) ) {
+ unlink( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' );
+ }
+
+ if( !empty( $_REQUEST['store_pos'] ) ) {
+ $gBitSmarty->assign( 'use_custom_top_bar', TRUE );
+ $gBitSystem->storePreference( 'top_bar_position', !empty( $_REQUEST['top_bar_position'] ) ? $_REQUEST['top_bar_position'] : NULL, NEXUS_PKG_NAME );
+ }
}
$gBitSystem->setBrowserTitle( 'Nexus Menus' );