summaryrefslogtreecommitdiff
path: root/includes/bit_setup_inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/bit_setup_inc.php')
-rwxr-xr-x[-rw-r--r--]includes/bit_setup_inc.php31
1 files changed, 21 insertions, 10 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
index 8914323..4faf129 100644..100755
--- a/includes/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -5,29 +5,41 @@
* @package Nexus
* @subpackage functions
*/
+use Bitweaver\Nexus\NexusSystem;
+
global $gBitSystem, $gBitUser, $gLibertySystem, $gBitThemes;
-$registerHash = array(
+$pRegisterHash = [
'package_name' => 'nexus',
'package_path' => dirname( dirname( __FILE__ ) ).'/',
'service' => LIBERTY_SERVICE_MENU,
-);
-$gBitSystem->registerPackage( $registerHash );
+];
+
+// fix to quieten down VS Code which can't see the dynamic creation of these ...
+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_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/');
+define( 'NEXUS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
+
+$gBitSystem->registerPackage( $pRegisterHash );
if( $gBitSystem->isPackageActive( 'nexus' ) ) {
// load nexus plugins
- require_once( NEXUS_PKG_PATH.'NexusSystem.php' );
+
global $gNexusSystem;
$gNexusSystem = new NexusSystem();
+
if( !$gBitSystem->isFeatureActive( NEXUS_PKG_NAME.'_plugin_file_suckerfish' ) ) {
$gNexusSystem->scanAllPlugins( NEXUS_PKG_PATH.'plugins/' );
} else {
$gNexusSystem->loadActivePlugins();
}
- $gBitSmarty->assignByRef( 'gNexusSystem', $gNexusSystem );
+ $gBitSmarty->assign( 'gNexusSystem', $gNexusSystem );
// include service functions
- require_once( NEXUS_PKG_INCLUDE_PATH.'servicefunctions_inc.php' );
+ require_once NEXUS_PKG_INCLUDE_PATH.'servicefunctions_inc.php';
$gLibertySystem->registerService( LIBERTY_SERVICE_MENU, NEXUS_PKG_NAME, array(
'content_store_function' => 'nexus_content_store',
@@ -37,21 +49,20 @@ if( $gBitSystem->isPackageActive( 'nexus' ) ) {
) );
if( $gBitUser->hasPermission( 'p_nexus_create_menus' ) ) {
- $menuHash = array(
+ $menuHash = [
'package_name' => NEXUS_PKG_NAME,
'index_url' => NEXUS_PKG_URL.'index.php',
'menu_template' => 'bitpackage:nexus/menu_nexus.tpl',
- );
+ ];
$gBitSystem->registerAppMenu( $menuHash );
}
if( is_dir( TEMP_PKG_PATH.'nexus/modules/' ) ) {
// make sure the template knows about the custom top bar
if( is_file( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ) ) {
- $gBitSmarty->assign( 'use_custom_top_bar', TRUE );
+ $gBitSmarty->assign( 'use_custom_top_bar', true );
}
}
$gBitThemes->loadCss( NEXUS_PKG_PATH.'css/nexus.css' );
}
-?>