summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]admin/admin_ckeditor_inc.php2
-rwxr-xr-x[-rw-r--r--]admin/schema_inc.php14
-rwxr-xr-x[-rw-r--r--]includes/bit_setup_inc.php31
-rwxr-xr-x[-rw-r--r--]templates/menu_ckeditor_admin.tpl10
4 files changed, 28 insertions, 29 deletions
diff --git a/admin/admin_ckeditor_inc.php b/admin/admin_ckeditor_inc.php
index cfecafb..1008c32 100644..100755
--- a/admin/admin_ckeditor_inc.php
+++ b/admin/admin_ckeditor_inc.php
@@ -42,7 +42,7 @@ $formSkin = array( 'ckedit_skin' => array(
)
);
$gBitSmarty->assign( 'formSkin', $formSkin );
-$skins = array_flip( scandir( CKEDITOR_PKG_PATH.'ckeditor/skins/' ) );
+$skins = array_flip( scandir( CKEDITOR_PKG_PATH.'skins/' ) );
foreach( array( '.', '..' ) as $dir ) {
if( isset( $skins[$dir] ) ) {
unset( $skins[$dir] );
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 67358a5..7ebca97 100644..100755
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -1,15 +1,13 @@
<?php
global $gBitInstaller;
-$gBitInstaller->registerPackageInfo( CKEDITOR_PKG_NAME, array(
+$gBitInstaller->registerPackageInfo( CKEDITOR_PKG_NAME, [
'description' => "CKEditor is a 'What You See Is What You Get' textarea HTML editor. It works with IE 5.5+, Firefox 1.0+, Mozilla 1.3+, and Netscape 7+. ",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
'important' => 'When using this WYSIWYG editor, we recommend that you either use HTML as the only content format or use TikiWiki with the option <kbd>allow HTML</kbd> enabled (formats are set in Administration --> Liberty --> Liberty plugins). It <em>can not</em> be used with competing editor TinyMCE active, and it is largely incompatible with the package Quicktags.',
'version' => '3.1+',
-) );
+] );
-$gBitInstaller->registerPreferences( CKEDITOR_PKG_NAME, array(
- array(CKEDITOR_PKG_NAME,'ckedit_debug','n'),
- array(CKEDITOR_PKG_NAME,'ckedit_toolbars', 'Basic'),
-) );
-
-?>
+$gBitInstaller->registerPreferences( CKEDITOR_PKG_NAME, [
+ [ CKEDITOR_PKG_NAME,'ckedit_debug','n'],
+ [ CKEDITOR_PKG_NAME,'ckedit_toolbars', 'Basic'],
+] );
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
index 1008fe4..1fb5aac 100644..100755
--- a/includes/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -1,25 +1,26 @@
<?php
global $gBitSystem, $gBitThemes;
-$registerHash = array(
+$pRegisterHash = array(
'package_name' => 'ckeditor',
'package_path' => dirname( dirname( __FILE__ ) ).'/',
);
-$gBitSystem->registerPackage( $registerHash );
-function loadCkEditor() {
- global $gBitSystem, $gBitThemes, $gBitUser;
- if( $gBitSystem->isPackageActive( 'ckeditor' ) && $gBitUser->hasPermission( 'p_liberty_enter_html' ) ){
- // same files for now... should choose between .min files
- if( defined( 'IS_LIVE' ) && IS_LIVE ) {
- $jsDir = (file_exists( CONFIG_PKG_PATH.'externals/ckeditor/ckeditor.js' ) ? CONFIG_PKG_PATH.'externals/ckeditor/' : CKEDITOR_PKG_PATH.'ckeditor/');
- $gBitThemes->loadJavascript( $jsDir.'ckeditor.js', FALSE, 600, FALSE );
- $gBitThemes->loadJavascript( $jsDir.'adapters/jquery.js', FALSE, 600, FALSE );
- } else {
- $jsDir = (file_exists( CONFIG_PKG_PATH.'externals/ckeditor/ckeditor.js' ) ? CONFIG_PKG_PATH.'externals/ckeditor/' : CKEDITOR_PKG_PATH.'ckeditor/');
- $gBitThemes->loadJavascript( $jsDir.'ckeditor.js', FALSE, 600, FALSE );
- $gBitThemes->loadJavascript( $jsDir.'adapters/jquery.js', FALSE, 600, FALSE );
- }
+// fix to quieten down VS Code which can't see the dynamic creation of these ...
+define( 'CKEDITOR_PKG_NAME', $pRegisterHash['package_name'] );
+define( 'CKEDITOR_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'CKEDITOR_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'CKEDITOR_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
+define( 'CKEDITOR_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/');
+define( 'CKEDITOR_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
+
+$gBitSystem->registerPackage( $pRegisterHash );
+
+if( $gBitSystem->isPackageActive( 'ckeditor' ) && $gBitUser->isRegistered() && $gBitUser->hasPermission( 'p_liberty_enter_html' ) ){
+ if( defined( 'IS_LIVE' ) && IS_LIVE ) {
+ $gBitThemes->loadJavascript( CKEDITOR_PKG_PATH.'ckeditor.js', false, 600, false );
+ } else {
+ $gBitThemes->loadJavascript( CKEDITOR_PKG_PATH.'ckeditor.js', false, 600, false );
}
}
diff --git a/templates/menu_ckeditor_admin.tpl b/templates/menu_ckeditor_admin.tpl
index b018811..74280e4 100644..100755
--- a/templates/menu_ckeditor_admin.tpl
+++ b/templates/menu_ckeditor_admin.tpl
@@ -1,5 +1,5 @@
-{strip}
-<ul class="{$packageMenuClass}">
- <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=ckeditor">CKEditor Settings</a></li>
-</ul>
-{/strip}
+{strip}
+<ul class="{$packageMenuClass}">
+ <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=ckeditor">CKEditor Settings</a></li>
+</ul>
+{/strip}