From a4b37ab577f3a4ef18d415dbc1940d71a51bc71d Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Mon, 18 May 2026 09:08:05 +0100 Subject: Trim redundent use of legacy code --- admin/admin_themes_inc.php | 4 --- includes/classes/BitThemes.php | 54 +------------------------------------ js/fancyzoom/js-global/FancyZoom.js | 4 --- smartyplugins/function.textarea.php | 5 ---- 4 files changed, 1 insertion(+), 66 deletions(-) diff --git a/admin/admin_themes_inc.php b/admin/admin_themes_inc.php index ff68a38..54b0668 100755 --- a/admin/admin_themes_inc.php +++ b/admin/admin_themes_inc.php @@ -2,10 +2,6 @@ use \Bitweaver\KernelTools; $themeSettings = [ - 'site_use_jscalendar' => [ - 'label' => 'Enable JSCalendar', - 'note' => 'If checked, a calendar popup allows for easily selecting a date using an appealing interface.', - ], 'themes_collapsible_modules' => [ 'label' => 'Collapsible modules', 'note' => 'This allows users to collapse modules by clicking on their titles. Can be useful if you use many modules.', diff --git a/includes/classes/BitThemes.php b/includes/classes/BitThemes.php index 0d6a07e..32c566c 100755 --- a/includes/classes/BitThemes.php +++ b/includes/classes/BitThemes.php @@ -30,7 +30,6 @@ class BitThemes extends BitSingleton { // an array with style information public $mStyles = []; - // Ajax libraries needed by current Ajax framework (MochiKit libs, etc.) public $mAjaxLibs = []; // Auxiliary Javascript and Css Files @@ -1332,7 +1331,7 @@ class BitThemes extends BitSingleton { /** * Load Ajax libraries * - * @param string $pAjaxLib Name of the library we want to use e.g.: prototype or mochikit + * @param string $pAjaxLib Name of the library we want to use e.g.: jquery or jquerylocal * @param array $pLibHash Array of additional libraries we need to load * @param array $pLibPath Array of additional libraries we need to load * @param boolean $pPack Set to true if you want to pack the javascript file @@ -1347,10 +1346,6 @@ class BitThemes extends BitSingleton { // set the javascript lib path if not set yet if( empty( $pLibPath )) { switch( $ajaxLib ) { - case 'mochikit': - $pLibPath = UTIL_PKG_PATH."javascript/MochiKit/"; - $pos = 100; - break; case 'jquerylocal': $pLibPath = UTIL_PKG_PATH."javascript/jquery/"; $pos = 100; @@ -1368,54 +1363,21 @@ class BitThemes extends BitSingleton { $bootstrapSrc = CONFIG_PKG_PATH.'themes/bootstrap/js/bootstrap'.$jqueryMin.'.js'; switch( $ajaxLib ) { case 'jquery': - $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; $jqueryVersion = $gBitSystem->getConfig( 'jquery_version', '3.5.1' ); - $jqueryUiVersion = $gBitSystem->getConfig( 'jquery_ui_version', '1.12.1' ); - $jqueryTheme = $gBitSystem->getConfig( 'jquery_theme', 'smoothness' ); $jquerySrc = '//ajax.googleapis.com/ajax/libs/jquery/'.$jqueryVersion.'/jquery'.$jqueryMin.'.js'; - $jqueryUiSrc = '//ajax.googleapis.com/ajax/libs/jqueryui/'.$jqueryUiVersion.'/jquery-ui'.$jqueryMin.'.js'; $this->mRawFiles['js'][] = $jquerySrc; - $this->mRawFiles['js'][] = $jqueryUiSrc; - $this->mRawFiles['css'][] = '//ajax.googleapis.com/ajax/libs/jqueryui/'.$jqueryUiVersion.'/themes/'.$jqueryTheme.'/jquery-ui.min.css'; // bootstrap needs to load after jquery if( file_exists( $bootstrapSrc ) ) { $this->mRawFiles['js'][] = $bootstrapSrc; } - $gBitSmarty->assign( 'jquerySrc', $jquerySrc ); break; case 'jquerylocal': $joined = false; $this->loadJavascript( THEMES_PKG_PATH.'js/jquery-3.7.1.js', false, $pos++, $joined ); -// $this->loadJavascript( THEMES_PKG_PATH.'js/jquery-ui-14.1.js', false, $pos++, $joined ); -// $this->loadJavascript( THEMES_PKG_PATH.'js/jquery-migrate-3.5.2.js', false, $pos++, $joined ); $this->loadJavascript( THEMES_PKG_PATH.'js/bootstrap.js', false, $pos++, $joined ); $this->loadJavascript( THEMES_PKG_PATH.'js/bootstrap-cookie-consent.js', false, $pos++, $joined ); $this->loadCss( THEMES_PKG_PATH.'css/colourstrap-full.css', false, $pos++, $joined ); -// $this->loadCss( THEMES_PKG_PATH.'js/jquery-ui'.$jqueryMin.'.css', false, $pos++, $joined ); - break; - case 'jqueryold': - $joined = false; - $this->loadJavascript( THEMES_PKG_PATH.'js/jquery'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( THEMES_PKG_PATH.'js/jquery-ui-1.10.3.custom'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'bootstrap/js/bootstrap'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'bootstrap/js/moment'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'bootstrap/datetimepicker/js/bootstrap-datetimepicker'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'bootstrap/signature-pad/assets/numeric-1.2.6.min.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'bootstrap/signature-pad/assets/bezier.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'bootstrap/signature-pad/jquery.signaturepad'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'formvalidation/dist/js/formValidation'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadJavascript( EXTERNAL_LIBS_PATH.'formvalidation/dist/js/framework/bootstrap'.$jqueryMin.'.js', false, $pos++, $joined ); - $this->loadCss( EXTERNAL_LIBS_PATH.'bootstrap/colourstrap/colourstrap.css', false, $pos++, $joined ); - $this->loadCss( EXTERNAL_LIBS_PATH.'bootstrap/colourstrap/colourstrap-icons.css', false, $pos++, $joined ); - $this->loadCss( EXTERNAL_LIBS_PATH.'bootstrap/datetimepicker/css/bootstrap-datetimepicker'.$jqueryMin.'.css', false, $pos++, $joined ); - $this->loadCSs( EXTERNAL_LIBS_PATH.'bootstrap/signature-pad/assets/jquery.signaturepad.css', false, $pos++, $joined ); - $this->loadCss( EXTERNAL_LIBS_PATH.'formvalidation/dist/css/formValidation'.$jqueryMin.'.css', false, $pos++, $joined ); - break; - case 'mochikit': - $this->loadJavascript( $pLibPath.'Base.js', false, $pos++ ); - $this->loadJavascript( $pLibPath.'Async.js', false, $pos++ ); - $this->loadJavascript( UTIL_PKG_PATH.'javascript//MochiKitBitAjax.js', false, $pos++, $joined ); break; case 'yui': $this->loadJavascript( $pLibPath.'yuiloader-dom-event/yuiloader-dom-event.js', false, $pos++ ); @@ -1767,20 +1729,6 @@ class BitThemes extends BitSingleton { } } - // remove conflicting files - if( !empty( $pType ) && !empty( $this->mAuxFiles[$pType] )) { - if( $pType = 'js' ) { - // prototype is loaded for a reason. we'll remove mochikit - if( $this->isAjaxLoaded( 'prototype' ) && $this->isAjaxLoaded( 'mochikit' )) { - foreach( $this->mAuxFiles[$pType] as $key => $js ) { - if( strstr( $js, 'Mochi' )) { - unset( $this->mAuxFiles[$pType][$key] ); - } - } - } - } - } - // convert full file path to URL in mRawFiles hash if( !empty( $this->mRawFiles[$pType] )) { foreach( $this->mRawFiles[$pType] as $pos => $file ) { diff --git a/js/fancyzoom/js-global/FancyZoom.js b/js/fancyzoom/js-global/FancyZoom.js index 19fcae8..93446de 100755 --- a/js/fancyzoom/js-global/FancyZoom.js +++ b/js/fancyzoom/js-global/FancyZoom.js @@ -35,10 +35,6 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// {{{ BITMOD -// Modifications to make it work with bitweaver: -// rename setOpacity to _setOpacity to avoid conflicts with mochikit. -// }}} BITMOD var includeCaption = true; // Turn on the "caption" feature, and write out the caption HTML diff --git a/smartyplugins/function.textarea.php b/smartyplugins/function.textarea.php index 388bab6..8253abc 100755 --- a/smartyplugins/function.textarea.php +++ b/smartyplugins/function.textarea.php @@ -81,11 +81,6 @@ function smarty_function_textarea( $pParams, &$pSmartyTemplate ) { break; } } - // We control hieght here when bnspell is on so as to be able to not - // lose the rest of the style on the textarea. - if ($gBitSystem->isPackageActive('bnspell')) { - $style .= (empty($style) ? '' : ';').'height:'.$pParams['rows'].'em;'; - } $gBitSmarty->assign('textarea_attributes', $attributes); if (!empty($style)) { -- cgit v1.3