diff options
Diffstat (limited to 'includes/bit_setup_inc.php')
| -rwxr-xr-x[-rw-r--r--] | includes/bit_setup_inc.php | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index c61aa3e..f048d3c 100644..100755 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -1,25 +1,34 @@ <?php +use \Bitweaver\Fisheye\FisheyeGallery; global $gBitSystem, $gBitUser, $gBitSmarty, $gBitThemes; -$registerHash = array( +$pRegisterHash = [ 'package_name' => 'fisheye', '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( 'FISHEYE_PKG_NAME', $pRegisterHash['package_name'] ); +define( 'FISHEYE_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' ); +define( 'FISHEYE_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' ); +define( 'FISHEYE_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); +define( 'FISHEYE_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/'); +define( 'FISHEYE_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); -if( $gBitSystem->isPackageActive( 'fisheye' ) ) { +$gBitSystem->registerPackage( $pRegisterHash ); + +if( $gBitSystem->isPackageActive( 'fisheye' ) ) { // && $gBitUser->hasPermission( 'p_fisheye_view' )) { // Default Preferences Defines define ( 'FISHEYE_DEFAULT_ROWS_PER_PAGE', 5 ); define ( 'FISHEYE_DEFAULT_COLS_PER_PAGE', 2 ); define ( 'FISHEYE_DEFAULT_THUMBNAIL_SIZE', 'large' ); - $menuHash = array( + $menuHash = [ 'package_name' => FISHEYE_PKG_NAME, 'index_url' => FISHEYE_PKG_URL.'index.php', 'menu_template' => 'bitpackage:fisheye/menu_fisheye.tpl', - ); + ]; $gBitSystem->registerAppMenu( $menuHash ); define( 'LIBERTY_SERVICE_PHOTOSHARING', 'photosharing'); @@ -34,15 +43,12 @@ if( $gBitSystem->isPackageActive( 'fisheye' ) ) { $query = "SELECT fg.`content_id` FROM `".BIT_DB_PREFIX."fisheye_gallery` fg INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON(fg.`content_id`=lc.`content_id`) WHERE lc.`user_id`=?"; if( $galleries = $gBitDb->getCol( $query, array( $pObject->mUserId ) ) ) { foreach( $galleries as $contentId ) { - $delGallery = new FisheyeGallery( NULL, $contentId ); + $delGallery = new FisheyeGallery( null, $contentId ); if( $delGallery->load() ) { - $delGallery->expunge( TRUE ); + $delGallery->expunge(); } } } } } - - include_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php' ); -} -?> +}
\ No newline at end of file |
