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.php36
1 files changed, 23 insertions, 13 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
index 5f1fdef..66dc8e0 100644..100755
--- a/includes/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -2,39 +2,49 @@
/**
* @package blogs
*/
+namespace Bitweaver\Blogs;
+use Bitweaver\KernelTools;
global $gBitSystem, $gBitUser, $gBitSmarty;
define( 'LIBERTY_SERVICE_BLOGS', 'blogs' );
-$registerHash = array(
+$pRegisterHash = [
'package_name' => 'blogs',
'package_path' => dirname( dirname( __FILE__ ) ).'/',
- 'homeable' => TRUE,
-);
-$gBitSystem->registerPackage( $registerHash );
+ 'homeable' => true,
+];
+
+// fix to quieten down VS Code which can't see the dynamic creation of these ...
+define( 'BLOGS_PKG_NAME', $pRegisterHash['package_name'] );
+define( 'BLOGS_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'BLOGS_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'BLOGS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
+define( 'BLOGS_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/');
+define( 'BLOGS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
+
+$gBitSystem->registerPackage( $pRegisterHash );
if( $gBitSystem->isPackageActive( 'blogs' ) ) {
if( $gBitUser->hasPermission( 'p_blogs_view' ) ) {
- $menuHash = array(
+ $menuHash = [
'package_name' => BLOGS_PKG_NAME,
'index_url' => BLOGS_PKG_URL.'index.php',
'menu_template' => 'bitpackage:blogs/menu_blogs.tpl',
'admin_comments_url' => KERNEL_PKG_URL.'admin/index.php?page=blogs',
- );
+ ];
$gBitSystem->registerAppMenu( $menuHash );
$gLibertySystem->registerService(
LIBERTY_SERVICE_BLOGS,
BLOGS_PKG_NAME,
- array( 'module_display_function' => 'blogs_module_display', ),
- array(
- 'description' => tra( 'A module display service which helps hook in javascript necessary when using the center module on other pages. This is a temporary fix to address a limitation of the rendering order in BitThemes and only applies to blog content.' ),
- 'required' => TRUE,
- )
+ [ 'module_display_function' => 'blogs_module_display', ],
+ [
+ 'description' => KernelTools::tra( 'A module display service which helps hook in javascript necessary when using the center module on other pages. This is a temporary fix to address a limitation of the rendering order in BitThemes and only applies to blog content.' ),
+ 'required' => true,
+ ]
);
}
- $gBitSystem->registerNotifyEvent( array( "blog_post" => tra("An entry is posted to a blog") ) );
-
+ $gBitSystem->registerNotifyEvent( [ "blog_post" => KernelTools::tra("An entry is posted to a blog") ] );
}