*/ class HTMLDisplayHandler { /** * jQuery versions */ public const JQUERY_V2 = '2.2.4'; public const JQUERY_V2_MIGRATE = '1.4.1'; public const JQUERY_V3 = '3.6.3'; public const JQUERY_V3_MIGRATE = '3.4.0'; /** * Default viewport setting */ public const DEFAULT_VIEWPORT = 'width=device-width, initial-scale=1.0, user-scalable=yes'; /** * Reserved scripts */ public static $reservedCSS = '@\bcommon/css/(?:xe|rhymix|mobile)\.(?:min\.)?(?:s?css|less)$@'; public static $reservedJS = '@\bcommon/js/(?:jquery(?:-[123][0-9.x-]+)?|xe?|common|js_app|xml_handler|xml_js_filter)\.(?:min\.)?js$@'; /** * List of scripts to block loading */ public static $blockedScripts = array( '@(?:^|/)j[Qq]uery(?:-[0-9]+(?:\.[0-9x]+)*|-latest)?(?:\.min)?\.js$@', ); /** * Replacement table for XE compatibility */ public static $replacements = array( '@\bcommon/xeicon/@' => 'common/css/xeicon/', '@\beditor/skins/xpresseditor/js/xe_textarea\.(?:min\.)?js@' => 'editor/skins/ckeditor/js/xe_textarea.js', '@/lang$@' => '/lang/lang.xml', ); /** * Image type information for SEO */ protected $_image_type = 'none'; /** * Produce HTML compliant content given a module object.\n * @param ModuleObject $oModule the module object * @return string compiled template string */ function toDoc(&$oModule) { $oTemplate = TemplateHandler::getInstance(); // SECISSUE https://github.com/xpressengine/xe-core/issues/1583 $oSecurity = new Security(); $oSecurity->encodeHTML('is_keyword', 'search_keyword', 'search_target', 'order_target', 'order_type'); $template_path = $oModule->getTemplatePath(); if(!is_dir($template_path)) { if($oModule->module_info->module == $oModule->module) { $skin = $oModule->origin_module_info->skin; } else { $skin = $oModule->module_config->skin; } if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) { if($skin && is_string($skin)) { $theme_skin = explode('|@|', $skin); $template_path = $oModule->getTemplatePath(); if(count($theme_skin) == 2) { $theme_path = sprintf('./themes/%s', $theme_skin[0]); // FIXME $theme_path $theme_path $theme_path ?? if(substr($theme_path, 0, strlen($theme_path)) != $theme_path) { $template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); } } } else { $template_path = $oModule->getTemplatePath(); } } else { $template_path = $oModule->getTemplatePath(); } } $tpl_file = $oModule->getTemplateFile(); $output = $oTemplate->compile($template_path, $tpl_file); // add .x div for adminitration pages if(Context::getResponseMethod() == 'HTML') { $x_exclude_actions = array( 'dispPageAdminContentModify' => true, 'dispPageAdminMobileContentModify' => true, 'dispPageAdminMobileContent' => true, ); $current_act = Context::get('act') ?? ''; if(Context::get('module') != 'admin' && strpos($current_act, 'Admin') !== false && !isset($x_exclude_actions[$current_act])) { $output = '