summaryrefslogtreecommitdiff
path: root/menus.php
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:57:03 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:57:03 +0000
commit2608b4b3f9d1e5cf430a6c03019f24b9f136c4d5 (patch)
treeaa8478622110f4ee1df73bba4541a40120bf1f2d /menus.php
downloadnexus-2608b4b3f9d1e5cf430a6c03019f24b9f136c4d5.tar.gz
nexus-2608b4b3f9d1e5cf430a6c03019f24b9f136c4d5.tar.bz2
nexus-2608b4b3f9d1e5cf430a6c03019f24b9f136c4d5.zip
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'menus.php')
-rw-r--r--menus.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/menus.php b/menus.php
new file mode 100644
index 0000000..6a35d70
--- /dev/null
+++ b/menus.php
@@ -0,0 +1,70 @@
+<?php
+require_once( '../bit_setup_inc.php' );
+global $gBitSystem;
+require_once( NEXUS_PKG_PATH.'Nexus.php');
+include_once( NEXUS_PKG_PATH.'menu_lookup_inc.php' );
+
+$gBitSystem->verifyPermission( 'bit_p_create_nexus_menus' );
+
+if( isset( $_REQUEST['action'] ) ) {
+ if( $_REQUEST['action'] == 'edit' ) {
+ $smarty->assign( 'editMenu', $gNexus->getMenu() );
+ }
+ if( $_REQUEST['action'] == 'remove' ) {
+ $formHash['remove'] = TRUE;
+ $formHash['menu_id'] = $menuId;
+ $msgHash = array(
+ '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 ) ) {
+ $deadHtml = '<ul>';
+ foreach( $deadLinks as $dead ) {
+ $deadHtml .= '<li>'.$dead.'</li>';
+ }
+ $deadHtml .= '</ul>';
+ $formfeedback['warning'] = 'Links that were dead and removed from '.$gNexus->mInfo['title'].$deadHtml;
+ } else {
+ $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.';
+ } else {
+ vd( $gNexus->mErrors );
+ }
+ }
+}
+if( isset( $_REQUEST['confirm'] ) ) {
+ if( $gNexus->expungeMenu( $menuId ) ) {
+ header ("Location: ".NEXUS_PKG_URL."menus.php");
+ die;
+ } else {
+ vd( $gNexus->mErrors );
+ }
+}
+
+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' );
+ 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 );
+}
+
+$gBitSystem->setBrowserTitle( 'Nexus Menus' );
+$gBitSystem->display( 'bitpackage:nexus/menus.tpl' );
+?>