diff options
| author | lsces <lester@lsces.co.uk> | 2016-02-07 21:00:49 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2016-02-07 21:00:49 +0000 |
| commit | 37481e8a1ab4354237c1080143d89a7752d78546 (patch) | |
| tree | 245311f7c1ac1ec4e8a20cc469058314301dd911 | |
| parent | 489cf4b07256a72505c578c2f52e7cb530901d7b (diff) | |
| parent | 26c65cdc6941f6d5d347b65c38bc24d23ff04a66 (diff) | |
| download | nexus-37481e8a1ab4354237c1080143d89a7752d78546.tar.gz nexus-37481e8a1ab4354237c1080143d89a7752d78546.tar.bz2 nexus-37481e8a1ab4354237c1080143d89a7752d78546.zip | |
Merge with older github view
| -rw-r--r-- | Nexus.php | 4 | ||||
| -rw-r--r-- | menu_items.php | 6 |
2 files changed, 6 insertions, 4 deletions
@@ -236,6 +236,7 @@ class Nexus extends NexusSystem { function storeMenu( &$pParamHash ) { $ret = FALSE; if( $this->verifyMenu( $pParamHash ) ) { + $this->mDb->StartTrans(); if( !@BitBase::verifyId( $pParamHash['menu_id'] ) ) { $query = "INSERT INTO `".BIT_DB_PREFIX."nexus_menus`( `title`,`description`,`menu_type`,`plugin_guid`,`editable` ) VALUES(?,?,?,?,?)"; $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'] ) ); @@ -246,6 +247,7 @@ class Nexus extends NexusSystem { $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'], $pParamHash['menu_id'] ) ); $ret = $pParamHash['menu_id']; } + $this->mDb->CompleteTrans(); $this->writeMenuCache( $ret ); } else { error_log( "Error storing menu: " . vc($this->mErrors) ); @@ -295,7 +297,7 @@ class Nexus extends NexusSystem { $bindVars = array( $pMenuId ); } $query .= ' ORDER BY nmi.`pos`'; - $result = $this->mDb->query( $query, array( $bindVars ) ); + $result = $this->mDb->query( $query, $bindVars ); while( !$result->EOF ) { $item = $result->fields; $item['display_url'] = $this->printUrl( $item ); diff --git a/menu_items.php b/menu_items.php index ffac5a1..c912490 100644 --- a/menu_items.php +++ b/menu_items.php @@ -16,7 +16,7 @@ include_once( NEXUS_PKG_PATH.'menu_lookup_inc.php' ); $gBitSystem->verifyPermission( 'p_nexus_create_menus' ); if( empty( $_REQUEST['menu_id'] ) ) { - header( 'Location:'.NEXUS_PKG_URL.'index.php' ); + bit_redirect( NEXUS_PKG_URL.'index.php' ); } // get content and pass it on @@ -37,7 +37,7 @@ if( isset( $_REQUEST['store_item'] ) ) { } else { $formfeedback['error'] = $gNexus->mErrors; } - $gNexus->load(); + bit_redirect( NEXUS_PKG_URL.'menu_items.php?menu_id='.$_REQUEST['menu_id'] ); } if( isset( $_REQUEST['remove_item'] ) && is_array( $_REQUEST['remove_item'] ) ) { @@ -52,8 +52,8 @@ if( isset( $_REQUEST['remove_item'] ) && is_array( $_REQUEST['remove_item'] ) ) $formfeedback['success'] = tra( 'The following items were successfully removed from the menu' ).': '; $gBitSmarty->assign( 'delList', $delList ); } - $gNexus->load(); $gNexus->writeMenuCache(); + bit_redirect( NEXUS_PKG_URL.'menu_items.php?menu_id='.$_REQUEST['menu_id'] ); } if( !empty( $_REQUEST['item_id'] ) ) { |
