diff --git a/public_html/siteconfig.php.dist b/public_html/siteconfig.php.dist index 501f4757a..9fa2e4a14 100644 --- a/public_html/siteconfig.php.dist +++ b/public_html/siteconfig.php.dist @@ -76,7 +76,7 @@ $_CONF['site_enabled'] = true; // $_CONF['developer_mode_log']['search'] = true; // Search class // $_CONF['developer_mode_log']['security'] = true; // lib-security.php // $_CONF['developer_mode_log']['session'] = true; // lib-session.php - // $_CONF['developer_mode_log']['template'] = true; // Template class + // $_CONF['developer_mode_log']['template'] = true; // Template class - Note: class also has a debug public variable that echos debug info on page. Must be set manually. See class for more details. // $_CONF['developer_mode_log']['topic'] = true; // lib-topic.php // $_CONF['developer_mode_log']['user'] = true; // lib-user.php diff --git a/system/classes/Resource.php b/system/classes/Resource.php index bb2e3df4e..c1e8613fe 100644 --- a/system/classes/Resource.php +++ b/system/classes/Resource.php @@ -255,9 +255,7 @@ class Resource */ public function __construct(array $config) { - if (isset($config['developer_mode'], $config['developer_mode_log']['resource']) && - $config['developer_mode'] && - $config['developer_mode_log']['resource']) { + if (COM_isEnableDeveloperModeLog('resource')) { $this->setDebug(true); } @@ -381,7 +379,7 @@ private function checkCssAttributes(array $attributes) public function setJavaScriptLibrary($name, $isFooter = true) { global $LANG_DIRECTION; - + // Sometimes it matters the order the libraries are submitted by Geeklog // Example jquery-ui-timepicker-addon must be before jquery-ui-timepicker-addon-i18n // Since the sort happens later and libraries which have the same priority may get shuffled within the priority @@ -457,7 +455,7 @@ public function setJavaScriptLibrary($name, $isFooter = true) 'file' => $this->libraryLocations[$name], 'priority' => $library_priority, ]; - + $library_priority = $library_priority + 1; // In case of a UIkit component, add a suitable CSS file @@ -519,9 +517,9 @@ public function setJavaScriptFile($name, $file, $isFooter = true, $priority = 10 if ($this->isHeaderSet && !$isFooter) { return false; } - + $position = $isFooter ? 'footer' : 'header'; - + if ($this->isExternal($file) && array_search($file, array_column($this->externalJsFiles[$position], 'file')) == 0) { $this->externalJsFiles[$position][] = [ 'file' => $file, @@ -860,7 +858,7 @@ private function makeFileServerTag(array $files, $isCss = true) $excludedFiles = ''; // ******************************* - // Exclude files for advanced editor + // Exclude files for advanced editor // Since they wouldn't work in displaced locations (ie in the new resource file and location) // Also include them after the resource file @@ -922,8 +920,8 @@ private function makeFileServerTag(array $files, $isCss = true) $retval .= sprintf(self::JS_TAG_TEMPLATE, $this->config['site_url'] . $file['file']) . PHP_EOL; } } - - // Add excluded files at the end + + // Add excluded files at the end $retval .= $excludedFiles; return $retval; @@ -1019,7 +1017,7 @@ private function makeTagsForSystemLibraries($isFooter = true) // UIkit if ((!$isFooter && ($this->UIkitPosition === 'header')) || - ($isFooter && ($this->UIkitPosition === 'footer'))) { + ($isFooter && ($this->UIkitPosition === 'footer'))) { if ($this->config['cdn_hosted']) { $retval .= sprintf( self::JS_TAG_TEMPLATE, @@ -1037,7 +1035,7 @@ private function makeTagsForSystemLibraries($isFooter = true) // UIkit3 if ((!$isFooter && ($this->UIkit3Position === 'header')) || - ($isFooter && ($this->UIkit3Position === 'footer'))) { + ($isFooter && ($this->UIkit3Position === 'footer'))) { if ($this->config['cdn_hosted']) { $retval .= sprintf( self::JS_TAG_TEMPLATE, diff --git a/system/classes/search.class.php b/system/classes/search.class.php index 7d0cc6b43..f6153b658 100644 --- a/system/classes/search.class.php +++ b/system/classes/search.class.php @@ -125,9 +125,7 @@ public function __construct(array $config) { global $_CONF, $_TABLES; - if (isset($config['developer_mode'], $config['developer_mode_log']['search']) && - $config['developer_mode'] && - $config['developer_mode_log']['search']) { + if (COM_isEnableDeveloperModeLog('search')) { $this->setDebug(true); } diff --git a/system/classes/template.class.php b/system/classes/template.class.php index de452570d..fc02adb73 100644 --- a/system/classes/template.class.php +++ b/system/classes/template.class.php @@ -877,6 +877,7 @@ public function subst($varName) // Lets try to error gracefully if we need too when evaluating PHP // Cannot use COM_handleEval as that is an outside function as the code we need to evaluate contains references to the template class ($this->...) + // This code gets executed when the template class function set_view is uses (like in the staticpages plugin when a page is used as a template) $errorMessage = ''; $templateCode = '?>' . $templateCode . ' isset($_CONF['developer_mode_log']['session']) && $_CONF['developer_mode_log']['session'], + 'debug' => COM_isEnableDeveloperModeLog('session'), 'logger' => 'COM_errorLog', 'cookie_disabled' => false, 'cookie_lifetime' => $_CONF['session_cookie_timeout'],