summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-14 09:51:41 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-14 09:51:41 +0100
commit8b9137c1358fde8e4c74b05a08da8a6a86e2094b (patch)
tree4552157203fe759e8f6dc9ede6362f8ea2ead6ad
parentd8bcfdfa9987b9207acc38fc417897af45d623d8 (diff)
downloadnexus-8b9137c1358fde8e4c74b05a08da8a6a86e2094b.tar.gz
nexus-8b9137c1358fde8e4c74b05a08da8a6a86e2094b.tar.bz2
nexus-8b9137c1358fde8e4c74b05a08da8a6a86e2094b.zip
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xadmin/schema_inc.php8
-rwxr-xr-x[-rw-r--r--]css/nexus.css0
-rwxr-xr-x[-rw-r--r--]icons/pkg_nexus.gifbin914 -> 914 bytes
-rwxr-xr-x[-rw-r--r--]icons/pkg_nexus.pngbin1484 -> 1484 bytes
-rwxr-xr-xincludes/bit_setup_inc.php8
-rwxr-xr-xincludes/classes/Nexus.php86
-rwxr-xr-xincludes/classes/NexusSystem.php1
-rwxr-xr-xmenu_items.php1
-rwxr-xr-xmenu_sort.php2
-rwxr-xr-xmenus.php10
-rwxr-xr-x[-rw-r--r--]plugins/menu.formelements.js0
-rwxr-xr-xplugins/menu.formelements.php20
-rwxr-xr-xplugins/menu.suckerfish.php14
-rwxr-xr-xplugins/menu.tikiwiki.php20
-rwxr-xr-x[-rw-r--r--]templates/admin_nexus.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_details_inc.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_items.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_items_details_inc.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_items_edit_inc.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_items_organise_inc.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_items_preview_inc.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_nexus.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_nexus_admin.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_sort.tpl0
-rwxr-xr-x[-rw-r--r--]templates/suckerfish/item.tpl0
25 files changed, 86 insertions, 84 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index fe85df5..4155f50 100755
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -1,6 +1,6 @@
<?php
-$tables = [
+$tables = [
'nexus_menus' => "
menu_id I4 AUTO PRIMARY,
plugin_guid C(16) NOTNULL,
@@ -30,18 +30,18 @@ foreach( array_keys( $tables ) AS $tableName ) {
$gBitInstaller->registerSchemaTable( NEXUS_PKG_NAME, $tableName, $tables[$tableName] );
}
-$gBitInstaller->registerPackageInfo( NEXUS_PKG_NAME, [
+$gBitInstaller->registerPackageInfo( NEXUS_PKG_NAME, [
'description' => 'Nexus allows you to create multi level menus using a simple and intuitive interface. Menus can be of a dropdown style using css.',
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
] );
// ### Default UserPermissions
-$gBitInstaller->registerUserPermissions( NEXUS_PKG_NAME, [
+$gBitInstaller->registerUserPermissions( NEXUS_PKG_NAME, [
[ 'p_nexus_insert_item', 'Can insert menu item in a menu while editing a page', 'registered', NEXUS_PKG_NAME],
[ 'p_nexus_create_menus', 'Can create new menus using Nexus', 'editors', NEXUS_PKG_NAME],
] );
// ### Default Preferences
-$gBitInstaller->registerPreferences( NEXUS_PKG_NAME, [
+$gBitInstaller->registerPreferences( NEXUS_PKG_NAME, [
[ NEXUS_PKG_NAME, 'nexus_menu_text', 'Menus' ],
] );
diff --git a/css/nexus.css b/css/nexus.css
index e771df1..e771df1 100644..100755
--- a/css/nexus.css
+++ b/css/nexus.css
diff --git a/icons/pkg_nexus.gif b/icons/pkg_nexus.gif
index 924bd11..924bd11 100644..100755
--- a/icons/pkg_nexus.gif
+++ b/icons/pkg_nexus.gif
Binary files differ
diff --git a/icons/pkg_nexus.png b/icons/pkg_nexus.png
index 5b39f3b..5b39f3b 100644..100755
--- a/icons/pkg_nexus.png
+++ b/icons/pkg_nexus.png
Binary files differ
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
index 4faf129..dfcb41f 100755
--- a/includes/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -19,9 +19,9 @@ $pRegisterHash = [
define( 'NEXUS_PKG_NAME', $pRegisterHash['package_name'] );
define( 'NEXUS_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' );
define( 'NEXUS_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' );
-define( 'NEXUS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
+define( 'NEXUS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
define( 'NEXUS_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/');
-define( 'NEXUS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
+define( 'NEXUS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
$gBitSystem->registerPackage( $pRegisterHash );
@@ -41,12 +41,12 @@ if( $gBitSystem->isPackageActive( 'nexus' ) ) {
// include service functions
require_once NEXUS_PKG_INCLUDE_PATH.'servicefunctions_inc.php';
- $gLibertySystem->registerService( LIBERTY_SERVICE_MENU, NEXUS_PKG_NAME, array(
+ $gLibertySystem->registerService( LIBERTY_SERVICE_MENU, NEXUS_PKG_NAME, [
'content_store_function' => 'nexus_content_store',
'content_edit_function' => 'nexus_content_edit',
'content_preview_function' => 'nexus_content_preview',
'content_edit_tab_tpl' => 'bitpackage:nexus/insert_menu_item_inc.tpl',
- ) );
+ ] );
if( $gBitUser->hasPermission( 'p_nexus_create_menus' ) ) {
$menuHash = [
diff --git a/includes/classes/Nexus.php b/includes/classes/Nexus.php
index f688590..a3bdd00 100755
--- a/includes/classes/Nexus.php
+++ b/includes/classes/Nexus.php
@@ -12,11 +12,11 @@
* required setup
*/
namespace Bitweaver\Nexus;
+
use Bitweaver\BitBase;
use Bitweaver\Fisheye\FisheyeGallery;
use Bitweaver\Liberty\LibertyStructure;
use Bitweaver\KernelTools;
-use Bitweaver\Themes\BitweaverExtension;
/**
* @package nexus
@@ -65,7 +65,7 @@ class Nexus extends NexusSystem {
$query = 'SELECT nm.* FROM `'.BIT_DB_PREFIX.'nexus_menus` nm';
if( is_numeric( $pMenuId ) ) {
$query .= ' WHERE nm.`menu_id`=?';
- $bindVars = array( $pMenuId );
+ $bindVars = [ $pMenuId ];
}
if( $result = $this->mDb->query( $query, $bindVars ) ) {
$ret = $result->fields;
@@ -240,12 +240,12 @@ class Nexus extends NexusSystem {
$this->mDb->StartTrans();
if( !BitBase::verifyId( $pParamHash['menu_id'] ?? 0 ) ) {
$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'] ) );
+ $result = $this->mDb->query( $query, [ $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'] ] );
$query = "SELECT MAX(`menu_id`) FROM `".BIT_DB_PREFIX."nexus_menus`";
$ret = $this->mDb->getOne( $query, [] );
} else {
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menus` SET `title`=?,`description`=?,`menu_type`=?,`plugin_guid`=?,`editable`=? WHERE `".BIT_DB_PREFIX."nexus_menus`.`menu_id`=?";
- $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'], $pParamHash['menu_id'] ) );
+ $result = $this->mDb->query( $query, [ $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'], $pParamHash['menu_id'] ] );
$ret = $pParamHash['menu_id'];
}
$this->mDb->CompleteTrans();
@@ -268,11 +268,11 @@ class Nexus extends NexusSystem {
// delete menu items
$query = "DELETE FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `menu_id`=?";
- $this->mDb->query( $query, array( $pMenuId ) );
+ $this->mDb->query( $query, [ $pMenuId ] );
// delete menu
$query = "DELETE FROM `".BIT_DB_PREFIX."nexus_menus` WHERE `menu_id`=?";
- $this->mDb->query( $query, array( $pMenuId ) );
+ $this->mDb->query( $query, [ $pMenuId ] );
// rewrite the entire cache, just to make sure everything is in order
$this->rewriteMenuCache();
@@ -292,10 +292,10 @@ class Nexus extends NexusSystem {
$query = 'SELECT nmi.* FROM `'.BIT_DB_PREFIX.'nexus_menu_items` nmi';
if( is_numeric( $pItemId ) ) {
$query .= ' WHERE nmi.`item_id`=?';
- $bindVars = array( $pItemId );
+ $bindVars = [ $pItemId ];
} elseif( is_numeric( $pMenuId ) ) {
$query .= ' WHERE nmi.`menu_id`=?';
- $bindVars = array( $pMenuId );
+ $bindVars = [ $pMenuId ];
}
$query .= ' ORDER BY nmi.`pos`';
$result = $this->mDb->query( $query, $bindVars );
@@ -342,7 +342,7 @@ class Nexus extends NexusSystem {
break;
case 'content_id':
// create *one* object for each object *type* to call virtual methods.
- $row = $this->mDb->getRow( "SELECT `title`,`content_id`,`content_type_guid` FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id`=?", array( $pItemHash['rsrc'] ));
+ $row = $this->mDb->getRow( "SELECT `title`,`content_id`,`content_type_guid` FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id`=?", [ $pItemHash['rsrc'] ]);
if( !empty( $row['content_type_guid'] )) {
$type = &$contentTypes[$row['content_type_guid']];
@@ -405,16 +405,16 @@ class Nexus extends NexusSystem {
$pParamHash['parent_id'] = 0;
// if no parent_id is not known, but we have an after_ref_id, we use that to work out the parent_id
if( BitBase::verifyId( $pParamHash['after_ref_id'] ?? 0 ) ) {
- $pParamHash['parent_id'] = $this->mDb->getOne("SELECT `parent_id` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?", array( (int)$pParamHash['after_ref_id'] ) );
+ $pParamHash['parent_id'] = $this->mDb->getOne("SELECT `parent_id` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?", [ (int)$pParamHash['after_ref_id'] ] );
}
}
$pParamHash['max'] = 0;
if( BitBase::verifyId( $pParamHash['after_ref_id'] ?? 0 ) ) {
- $pParamHash['max'] = $this->mDb->getOne("SELECT `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?", array( (int)$pParamHash['after_ref_id'] ) );
+ $pParamHash['max'] = $this->mDb->getOne("SELECT `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?", [ (int)$pParamHash['after_ref_id'] ] );
if( $pParamHash['max'] > 0 ) {
//If max is 5 then we are inserting after position 5 so we'll insert 5 and move all the others
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=`pos`+1 WHERE `pos`>? AND `parent_id`=?";
- $result = $this->mDb->query( $query, array( (int)$pParamHash['max'], (int)$pParamHash['parent_id'] ) );
+ $result = $this->mDb->query( $query, [ (int)$pParamHash['max'], (int)$pParamHash['parent_id'] ] );
}
}
$this->mDb->CompleteTrans();
@@ -448,12 +448,12 @@ class Nexus extends NexusSystem {
$this->mDb->StartTrans();
if( !BitBase::verifyId( $pParamHash['item_id'] ?? 0 ) ) {
$query = "INSERT INTO `".BIT_DB_PREFIX."nexus_menu_items`( `menu_id`,`parent_id`,`pos`,`title`,`hint`,`rsrc`,`rsrc_type`,`perm` ) VALUES( ?,?,?,?,?,?,?,? )";
- $result = $this->mDb->query( $query, array( (int)$pParamHash['menu_id'], (int)$pParamHash['parent_id'], (int)$pParamHash['max'], $pParamHash['title'], $pParamHash['hint'], $pParamHash['rsrc'], $pParamHash['rsrc_type'], $pParamHash['perm'] ) );
+ $result = $this->mDb->query( $query, [ (int)$pParamHash['menu_id'], (int)$pParamHash['parent_id'], (int)$pParamHash['max'], $pParamHash['title'], $pParamHash['hint'], $pParamHash['rsrc'], $pParamHash['rsrc_type'], $pParamHash['perm'] ] );
$query = "SELECT MAX(`item_id`) FROM `".BIT_DB_PREFIX."nexus_menu_items`";
$ret = $this->mDb->getOne( $query, [] );
} else {
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `title`=?, `hint`=?, `rsrc`=?, `rsrc_type`=?, `perm`=? WHERE `item_id`=?";
- $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['hint'], $pParamHash['rsrc'], $pParamHash['rsrc_type'], $pParamHash['perm'], $pParamHash['item_id'] ) );
+ $result = $this->mDb->query( $query, [ $pParamHash['title'], $pParamHash['hint'], $pParamHash['rsrc'], $pParamHash['rsrc_type'], $pParamHash['perm'], $pParamHash['item_id'] ] );
$ret = $pParamHash['item_id'];
}
$this->mDb->CompleteTrans();
@@ -478,7 +478,7 @@ class Nexus extends NexusSystem {
$this->mDb->StartTrans();
// get all items that are on the same level
$query = "SELECT * FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `parent_id`=? ORDER BY `pos`";
- $result = $this->mDb->query( $query, array( $pItemId ) );
+ $result = $this->mDb->query( $query, [ $pItemId ] );
// this value is needed to correclty position items that are moved up a level
$pos_count = 0;
// first we move children up one level
@@ -486,33 +486,33 @@ class Nexus extends NexusSystem {
$item = $result->fields;
//Make a space for the item after its parent
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=`pos`+1 WHERE `pos`>?+".$pos_count." AND `parent_id`=? AND `menu_id`=?";
- $res = $this->mDb->query( $query, array( (int)$remItem['pos'], (int)$remItem['parent_id'], (int)$remItem['menu_id'] ) );
+ $res = $this->mDb->query( $query, [ (int)$remItem['pos'], (int)$remItem['parent_id'], (int)$remItem['menu_id'] ] );
// increase insertion count here
$pos_count++;
// move item up one level
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `parent_id`=?, `pos`=?+".$pos_count." WHERE `item_id`=?";
- $this->mDb->query( $query, array( (int)$remItem['parent_id'], (int)$remItem['pos'], (int)$item['item_id'] ) );
+ $this->mDb->query( $query, [ (int)$remItem['parent_id'], (int)$remItem['pos'], (int)$item['item_id'] ] );
$result->MoveNext();
}
// all items below remItem have to be shifted up by one
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=`pos`-1 WHERE `pos`>? AND `parent_id`=? AND `menu_id`=?";
- $this->mDb->query( $query, array( (int)$remItem['pos'], (int)$remItem['parent_id'], (int)$remItem['menu_id'] ) );
+ $this->mDb->query( $query, [ (int)$remItem['pos'], (int)$remItem['parent_id'], (int)$remItem['menu_id'] ] );
// finally, we are ready do delete remItem
$query = "DELETE FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?";
- $result = $this->mDb->query( $query, array( $pItemId ) );
+ $result = $this->mDb->query( $query, [ $pItemId ] );
$this->mDb->CompleteTrans();
if( $pWriteCache ) {
$this->writeMenuCache( $remItem['menu_id'] );
}
return $remItem;
- } else {
+ }
$this->mErrors['remove_item'] = KernelTools::tra( "There was a problem trying to remove the menu item." );
return false;
- }
- } else {
+
+ }
$this->mErrors['remove_item_id'] = KernelTools::tra( "The menu item could not be removed because no valid item id was given." );
return false;
- }
+
}
/**
@@ -554,16 +554,16 @@ class Nexus extends NexusSystem {
$parentItem = $parentItem[$item["parent_id"]];
$this->mDb->StartTrans();
if( !BitBase::verifyId( $parentItem["parent_id"] ) ) {
- $max_row = $this->mDb->getOne("SELECT `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?", array( $item['parent_id'] ) );
+ $max_row = $this->mDb->getOne("SELECT `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `item_id`=?", [ $item['parent_id'] ] );
$parent_item['pos'] = $max_row;
$parent_item['parent_id'] = 0;
}
//Make a space for the item after its parent
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=`pos`+1 WHERE `pos`>? AND `parent_id`=?";
- $this->mDb->query( $query, array( (int)$parentItem["pos"], (int)$parentItem["parent_id"] ) );
+ $this->mDb->query( $query, [ (int)$parentItem["pos"], (int)$parentItem["parent_id"] ] );
//Move the item up one level
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `parent_id`=?, `pos`=(? + 1) WHERE `item_id`=?";
- $this->mDb->query($query, array( (int)$parentItem["parent_id"], (int)$parentItem["pos"], $pItemId ) );
+ $this->mDb->query($query, [ (int)$parentItem["parent_id"], (int)$parentItem["pos"], $pItemId ] );
$this->mDb->CompleteTrans();
$this->writeMenuCache( $item['menu_id'] );
}
@@ -580,17 +580,17 @@ class Nexus extends NexusSystem {
$item = $this->mInfo["items"][$pItemId];
$this->mDb->StartTrans();
$query = "SELECT `item_id`, `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `pos`<? AND `parent_id`=? AND `menu_id`=? ORDER BY `pos` DESC";
- $result = $this->mDb->query( $query, array( (int)$item["pos"], (int)$item["parent_id"], (int)$item["menu_id"] ) );
+ $result = $this->mDb->query( $query, [ (int)$item["pos"], (int)$item["parent_id"], (int)$item["menu_id"] ] );
if( $previous = $result->fetchRow() ) {
//Get last child item for previous sibling
$query = "SELECT `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `parent_id`=? AND `menu_id`=? ORDER BY `pos` DESC";
- $result = $this->mDb->query( $query, array( (int)$previous["item_id"], (int)$item["menu_id"] ) );
+ $result = $this->mDb->query( $query, [ (int)$previous["item_id"], (int)$item["menu_id"] ] );
$pos = ( $res = $result->fetchRow() ) ? $res["pos"] : 0;
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `parent_id`=?, `pos`=(? + 1) WHERE `item_id`=?";
- $this->mDb->query( $query, array( (int)$previous["item_id"], (int)$pos, (int)$item["item_id"] ) );
+ $this->mDb->query( $query, [ (int)$previous["item_id"], (int)$pos, (int)$item["item_id"] ] );
//Move items up below that had previous parent and pos
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=`pos`-1 WHERE `pos`>? AND `parent_id`=? AND `menu_id`=?";
- $this->mDb->query( $query, array( $item["pos"], $item["parent_id"], $item["menu_id"] ) );
+ $this->mDb->query( $query, [ $item["pos"], $item["parent_id"], $item["menu_id"] ] );
$this->mDb->CompleteTrans();
$this->writeMenuCache( $item['menu_id'] );
}
@@ -607,12 +607,12 @@ class Nexus extends NexusSystem {
$item = $this->mInfo["items"][$pItemId];
$this->mDb->StartTrans();
$query = "SELECT `item_id`, `pos` FROM `".BIT_DB_PREFIX."nexus_menu_items` WHERE `pos`>? AND `parent_id`=? ORDER BY `pos` ASC";
- $result = $this->mDb->query( $query, array( (int)$item["pos"], (int)$item["parent_id"] ) );
+ $result = $this->mDb->query( $query, [ (int)$item["pos"], (int)$item["parent_id"] ] );
if( $res = $result->fetchRow() ) {
//Swap position values
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=? WHERE `item_id`=?";
- $this->mDb->query( $query, array( (int)$item["pos"], (int)$res["item_id"] ) );
- $this->mDb->query( $query, array( (int)$res["pos"], (int)$item["item_id"] ) );
+ $this->mDb->query( $query, [ (int)$item["pos"], (int)$res["item_id"] ] );
+ $this->mDb->query( $query, [ (int)$res["pos"], (int)$item["item_id"] ] );
}
$this->mDb->CompleteTrans();
$this->writeMenuCache( $item['menu_id'] );
@@ -629,12 +629,12 @@ class Nexus extends NexusSystem {
$item = $this->mInfo["items"][$pItemId];
$this->mDb->StartTrans();
$query = "SELECT `item_id`, `pos` from `".BIT_DB_PREFIX."nexus_menu_items` WHERE `pos`<? AND `parent_id`=? ORDER BY `pos` desc";
- $result = $this->mDb->query( $query, array((int)$item["pos"], (int)$item["parent_id"] ) );
+ $result = $this->mDb->query( $query, [(int)$item["pos"], (int)$item["parent_id"] ] );
if( $res = $result->fetchRow() ) {
//Swap position values
$query = "UPDATE `".BIT_DB_PREFIX."nexus_menu_items` SET `pos`=? WHERE `item_id`=?";
- $this->mDb->query( $query, array( (int)$res["pos"], (int)$item["item_id"] ) );
- $this->mDb->query( $query, array( (int)$item["pos"], (int)$res["item_id"] ) );
+ $this->mDb->query( $query, [ (int)$res["pos"], (int)$item["item_id"] ] );
+ $this->mDb->query( $query, [ (int)$item["pos"], (int)$res["item_id"] ] );
}
$this->mDb->CompleteTrans();
$this->writeMenuCache( $item['menu_id'] );
@@ -666,14 +666,14 @@ class Nexus extends NexusSystem {
$menuHash['title'] = $rootStructure->mInfo['title'];
if( $menu_id = $this->storeMenu( $menuHash ) ) {
// we need to insert the structure title manually, as this is not part of the structure
- $itemHash = array(
+ $itemHash = [
'menu_id' => $menu_id,
'title' => $rootStructure->mInfo['title'],
'pos' => 1,
'parent_id' => 0,
'rsrc' => $rootStructure->mInfo['structure_id'],
- 'rsrc_type' => 'structure_id'
- );
+ 'rsrc_type' => 'structure_id',
+ ];
$storedItem = $this->storeItem( $itemHash );
// insert all nodes in structure as menu items
@@ -691,14 +691,14 @@ class Nexus extends NexusSystem {
} else {
// save the item in the menu
$tmpItem = $rootStructure->getNode( $structureItem['structure_id'] );
- $itemHash = array(
+ $itemHash = [
'menu_id' => $menu_id,
'title' => $structureItem['title'],
'pos' => $tmpItem['pos'],
'parent_id' => $parent_id,
- 'rsrc' => isset( $structureItem['structure_id'] ) ? $structureItem['structure_id'] : null,
- 'rsrc_type' => 'structure_id'
- );
+ 'rsrc' => $structureItem['structure_id'] ?? null,
+ 'rsrc_type' => 'structure_id',
+ ];
$storedItem = $this->storeItem( $itemHash );
}
}
diff --git a/includes/classes/NexusSystem.php b/includes/classes/NexusSystem.php
index 9c08e3a..7414dac 100755
--- a/includes/classes/NexusSystem.php
+++ b/includes/classes/NexusSystem.php
@@ -14,6 +14,7 @@
* Setup
*/
namespace Bitweaver\Nexus;
+
use Bitweaver\Liberty\LibertySystem;
define( 'NEXUS_DEFAULT_MENU', 'suckerfish' );
diff --git a/menu_items.php b/menu_items.php
index 4c33b74..c31aff4 100755
--- a/menu_items.php
+++ b/menu_items.php
@@ -10,6 +10,7 @@
* required setup
*/
namespace Bitweaver\Liberty;
+
require_once '../kernel/includes/setup_inc.php';
use Bitweaver\KernelTools;
include_once NEXUS_PKG_INCLUDE_PATH.'menu_lookup_inc.php';
diff --git a/menu_sort.php b/menu_sort.php
index a242f78..ea52add 100755
--- a/menu_sort.php
+++ b/menu_sort.php
@@ -44,4 +44,4 @@ if( isset( $_REQUEST['tab'] ) ) {
$gBitSmarty->assign( 'nexus_file', strtolower( 'mod_'.preg_replace( "/ /", "_", $gNexus->mInfo['title'] ).'_'.$gNexus->mInfo['menu_id'].'.tpl' ) );
$gBitSystem->setBrowserTitle( 'Nexus Menus' );
-$gBitSystem->display( 'bitpackage:nexus/menu_sort.tpl' , null, array( 'display_mode' => 'display' ));
+$gBitSystem->display( 'bitpackage:nexus/menu_sort.tpl' , null, [ 'display_mode' => 'display' ]);
diff --git a/menus.php b/menus.php
index 136bc89..9e8ff30 100755
--- a/menus.php
+++ b/menus.php
@@ -26,12 +26,12 @@ if( isset( $_REQUEST['action'] ) ) {
if( $_REQUEST['action'] == 'remove' ) {
$formHash['remove'] = true;
$formHash['menu_id'] = $menuId;
- $msgHash = array(
+ $msgHash = [
'label' => KernelTools::tra('Delete Menu'),
'confirm_item' => $gNexus->mInfo['title'],
'warning' => KernelTools::tra('Remove this menu including all menu items associated with it.'),
'error' => KernelTools::tra('This cannot be undone!'),
- );
+ ];
$gBitSystem->confirmDialog( $formHash,$msgHash );
}
@@ -61,9 +61,9 @@ if( isset( $_REQUEST['confirm'] ) ) {
if( $gNexus->expungeMenu( $menuId ) ) {
header ("Location: ".NEXUS_PKG_URL."menus.php");
die;
- } else {
- $gBitSystem->fatalError( KernelTools::tra("There was an error deleting the menu ").\Bitweaver\vc( $gNexus->mErrors ));
}
+ $gBitSystem->fatalError( KernelTools::tra("There was an error deleting the menu ").\Bitweaver\vc( $gNexus->mErrors ));
+
}
if( isset( $_REQUEST['store_menu'] ) ) {
@@ -96,4 +96,4 @@ if( is_file( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ) ) {
}
$gBitSystem->setBrowserTitle( 'Nexus Menus' );
-$gBitSystem->display( 'bitpackage:nexus/menus.tpl' , null, array( 'display_mode' => 'display' ));
+$gBitSystem->display( 'bitpackage:nexus/menus.tpl' , null, [ 'display_mode' => 'display' ]);
diff --git a/plugins/menu.formelements.js b/plugins/menu.formelements.js
index dbf9562..dbf9562 100644..100755
--- a/plugins/menu.formelements.js
+++ b/plugins/menu.formelements.js
diff --git a/plugins/menu.formelements.php b/plugins/menu.formelements.php
index 1b4e87e..2c4d8ec 100755
--- a/plugins/menu.formelements.php
+++ b/plugins/menu.formelements.php
@@ -17,7 +17,7 @@ global $gNexusSystem;
*/
define( 'NEXUS_PLUGIN_GUID_FORMELEMENTSMENU', 'formelements' );
-$pluginParams = array(
+$pluginParams = [
'auto_activate' => false,
'write_cache_function' => 'write_form_menu_cache',
'title' => 'Formelements menu',
@@ -27,14 +27,14 @@ $pluginParams = array(
'edit_label' => 'Menus using form elements',
'include_js_in_head' => '/nexus/plugins/menu.formelements.js',
'plugin_type' => 'nexus_plugin',
- 'menu_types' => array(
- 'sdd' => array( 'label' => 'Standard DropDown', 'note' => 'drop-down menu using select with menu name on top' ),
- 'qdd' => array( 'label' => 'Quick DropDown', 'note' => 'drop-down menu using select with menu name in drop-down select box'),
- 's3' => array( 'label' => '3-Line Box', 'note' => 'select menu with 3 lines showing' ),
- 's5' => array( 'label' => '5-Line Box', 'note' => 'select menu with 5 lines showing' ),
- 'sal' => array( 'label' => 'Full Text Box', 'note' => 'select menu with all menu items showing' ),
- ),
-);
+ 'menu_types' => [
+ 'sdd' => [ 'label' => 'Standard DropDown', 'note' => 'drop-down menu using select with menu name on top' ],
+ 'qdd' => [ 'label' => 'Quick DropDown', 'note' => 'drop-down menu using select with menu name in drop-down select box'],
+ 's3' => [ 'label' => '3-Line Box', 'note' => 'select menu with 3 lines showing' ],
+ 's5' => [ 'label' => '5-Line Box', 'note' => 'select menu with 5 lines showing' ],
+ 'sal' => [ 'label' => 'Full Text Box', 'note' => 'select menu with all menu items showing' ],
+ ],
+];
$gNexusSystem->registerPlugin( NEXUS_PLUGIN_GUID_FORMELEMENTSMENU, $pluginParams );
@@ -86,7 +86,7 @@ function write_form_menu_cache( $pMenuHash ) {
}
if ( $pMenuHash->mInfo['menu_type'] == 'qdd' ) {
$data .= '<option value="">'.$pMenuHash->mInfo['title'].'</option>' ;
- }
+ }
} else {
$data .= '>';
}
diff --git a/plugins/menu.suckerfish.php b/plugins/menu.suckerfish.php
index bbb5321..cadfe43 100755
--- a/plugins/menu.suckerfish.php
+++ b/plugins/menu.suckerfish.php
@@ -17,7 +17,7 @@ global $gNexusSystem;
// GUID should be a maximum of 16 chars
define( 'NEXUS_PLUGIN_GUID_SUCKERFISH', 'suckerfish' );
-$pluginParams = array(
+$pluginParams = [
'auto_activate' => true,
'write_cache_function' => 'write_suckerfish_cache',
'title' => 'Suckerfish Menus',
@@ -26,12 +26,12 @@ $pluginParams = array(
'browser_requirements' => 'Many modern browsers support suckerfish menus inherently using CSS.',
'edit_label' => 'CSS based menus',
'plugin_type' => 'nexus_plugin',
- 'menu_types' => array(
- 'nor' => array( 'label' => 'Normal', 'note' => 'Nested list of menu items using "ul" and "li" HTML tags.' ),
- 'ver' => array( 'label' => 'Vertical', 'note' => 'Vertical dropdown menu that usually resides in one of the side modules.' ),
- 'hor' => array( 'label' => 'Horizontal', 'note' => 'Horizontal menu which you can use to insert in or replace the top menu bar.' ),
- ),
-);
+ 'menu_types' => [
+ 'nor' => [ 'label' => 'Normal', 'note' => 'Nested list of menu items using "ul" and "li" HTML tags.' ],
+ 'ver' => [ 'label' => 'Vertical', 'note' => 'Vertical dropdown menu that usually resides in one of the side modules.' ],
+ 'hor' => [ 'label' => 'Horizontal', 'note' => 'Horizontal menu which you can use to insert in or replace the top menu bar.' ],
+ ],
+];
$gNexusSystem->registerPlugin( NEXUS_PLUGIN_GUID_SUCKERFISH, $pluginParams );
diff --git a/plugins/menu.tikiwiki.php b/plugins/menu.tikiwiki.php
index a0c071d..2da342c 100755
--- a/plugins/menu.tikiwiki.php
+++ b/plugins/menu.tikiwiki.php
@@ -16,7 +16,7 @@ global $gNexusSystem;
// GUID should be a maximum of 16 chars
define( 'NEXUS_PLUGIN_GUID_TIKIWIKI', 'tikiwiki' );
-$pluginParams = array(
+$pluginParams = [
'auto_activate' => true,
'write_cache_function' => 'write_tikiwiki_cache',
'title' => 'TikiWiki menus',
@@ -25,15 +25,15 @@ $pluginParams = array(
'browser_requirements' => 'Most browsers that support javascript should support these menus.',
'edit_label' => 'TikiWiki menus',
'plugin_type' => 'nexus_plugin',
- 'menu_types' => array(
- 'heo' => array( 'label' => 'head expands - open', 'note' => 'Head item serves merely as container and clicking on it will expand the underlying items (initial setting is open).' ),
- 'iho' => array( 'label' => 'head expands (with icon) - open', 'note' => 'Head item serves merely as container and clicking on it will expand the underlying items (initial setting is open). Displays an icon along with it.' ),
- 'hec' => array( 'label' => 'head expands - closed', 'note' => 'Initial setting is closed.' ),
- 'ihc' => array( 'label' => 'head expands (with icon) - closed', 'note' => 'Initial setting is closed. Displays an icon along with it.' ),
- 'ieo' => array( 'label' => 'icon expands - open', 'note' => 'Menu head item serves as link and there is an icon to expand the menu (initial setting is open).' ),
- 'iec' => array( 'label' => 'icon expands - closed', 'note' => 'Initial setting is closed.' ),
- ),
-);
+ 'menu_types' => [
+ 'heo' => [ 'label' => 'head expands - open', 'note' => 'Head item serves merely as container and clicking on it will expand the underlying items (initial setting is open).' ],
+ 'iho' => [ 'label' => 'head expands (with icon) - open', 'note' => 'Head item serves merely as container and clicking on it will expand the underlying items (initial setting is open). Displays an icon along with it.' ],
+ 'hec' => [ 'label' => 'head expands - closed', 'note' => 'Initial setting is closed.' ],
+ 'ihc' => [ 'label' => 'head expands (with icon) - closed', 'note' => 'Initial setting is closed. Displays an icon along with it.' ],
+ 'ieo' => [ 'label' => 'icon expands - open', 'note' => 'Menu head item serves as link and there is an icon to expand the menu (initial setting is open).' ],
+ 'iec' => [ 'label' => 'icon expands - closed', 'note' => 'Initial setting is closed.' ],
+ ],
+];
$gNexusSystem->registerPlugin( NEXUS_PLUGIN_GUID_TIKIWIKI, $pluginParams );
diff --git a/templates/admin_nexus.tpl b/templates/admin_nexus.tpl
index 9fbb7da..9fbb7da 100644..100755
--- a/templates/admin_nexus.tpl
+++ b/templates/admin_nexus.tpl
diff --git a/templates/menu_details_inc.tpl b/templates/menu_details_inc.tpl
index ec05d2c..ec05d2c 100644..100755
--- a/templates/menu_details_inc.tpl
+++ b/templates/menu_details_inc.tpl
diff --git a/templates/menu_items.tpl b/templates/menu_items.tpl
index 7bbe953..7bbe953 100644..100755
--- a/templates/menu_items.tpl
+++ b/templates/menu_items.tpl
diff --git a/templates/menu_items_details_inc.tpl b/templates/menu_items_details_inc.tpl
index 9f1eeb0..9f1eeb0 100644..100755
--- a/templates/menu_items_details_inc.tpl
+++ b/templates/menu_items_details_inc.tpl
diff --git a/templates/menu_items_edit_inc.tpl b/templates/menu_items_edit_inc.tpl
index 1dade30..1dade30 100644..100755
--- a/templates/menu_items_edit_inc.tpl
+++ b/templates/menu_items_edit_inc.tpl
diff --git a/templates/menu_items_organise_inc.tpl b/templates/menu_items_organise_inc.tpl
index c6a4709..c6a4709 100644..100755
--- a/templates/menu_items_organise_inc.tpl
+++ b/templates/menu_items_organise_inc.tpl
diff --git a/templates/menu_items_preview_inc.tpl b/templates/menu_items_preview_inc.tpl
index 3ae60e8..3ae60e8 100644..100755
--- a/templates/menu_items_preview_inc.tpl
+++ b/templates/menu_items_preview_inc.tpl
diff --git a/templates/menu_nexus.tpl b/templates/menu_nexus.tpl
index dbda709..dbda709 100644..100755
--- a/templates/menu_nexus.tpl
+++ b/templates/menu_nexus.tpl
diff --git a/templates/menu_nexus_admin.tpl b/templates/menu_nexus_admin.tpl
index 1d7d1ad..1d7d1ad 100644..100755
--- a/templates/menu_nexus_admin.tpl
+++ b/templates/menu_nexus_admin.tpl
diff --git a/templates/menu_sort.tpl b/templates/menu_sort.tpl
index 4a610a3..4a610a3 100644..100755
--- a/templates/menu_sort.tpl
+++ b/templates/menu_sort.tpl
diff --git a/templates/suckerfish/item.tpl b/templates/suckerfish/item.tpl
index 940ec8d..940ec8d 100644..100755
--- a/templates/suckerfish/item.tpl
+++ b/templates/suckerfish/item.tpl