Changeset 848
- Timestamp:
- Nov 18, 2013, 9:29:23 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/include/xpress_render.php
r839 r848 1 1 <?php 2 2 3 //< style >< script >< link > tag is pulled out from the header of html contents. 3 //< style >< script >< link > tag is pulled out from the header of html contents. 4 4 function get_mod_header($contents) 5 5 { 6 6 global $xpress_config; 7 7 8 8 $pattern = "<body[^>]*?>(.*)<\/body>"; 9 9 $body_cut = preg_replace("/".$pattern."/s" , '' , $contents); … … 36 36 $head_str = meta_name_cut('generator',$head_str); 37 37 38 $head_str = preg_replace("/^(\s)*(\r|\n|\r\n)/m", "", $head_str); 38 $head_str = preg_replace("/^(\s)*(\r|\n|\r\n)/m", "", $head_str); 39 39 $pattern = "^"; 40 40 $head_str = preg_replace("/".$pattern."/m" , "\t" , $head_str); … … 71 71 } 72 72 73 // get sidebar rendaring 73 // get sidebar rendaring 74 74 function get_sidebar_rander($name = null) 75 75 { … … 93 93 } 94 94 95 // < body > tag is pulled out from the header of html contents. 95 // < body > tag is pulled out from the header of html contents. 96 96 function get_body($contents) 97 97 { … … 103 103 $body = $body_matches[1]; 104 104 } 105 105 106 106 if ($xpess_config->is_theme_sidebar_disp){ 107 107 $xpress_class = 'xpress-body'; … … 109 109 $xpress_class = 'xpress-body onecolumn'; 110 110 } 111 111 112 112 $pattern = '<body\s*([^>]*)>'; 113 113 $body_class = 'class="' . $xpress_class . '"'; … … 115 115 $body_tag_option = $body_matches[1]; 116 116 117 $pattern = 'class\s*=\s*[\'|"]([^\'|^"]*)[\'|"]'; 117 $pattern = 'class\s*=\s*[\'|"]([^\'|^"]*)[\'|"]'; 118 118 if(preg_match("/".$pattern."/", $body_tag_option, $class_matches)){ 119 119 $class_value = $class_matches[1]; … … 142 142 $preload_make_module_header = ''; 143 143 } 144 144 145 145 if (! empty($preload_make_module_header)){ 146 146 $preload_make_module_header = '<!-- preload added module header --> … … 148 148 '; 149 149 } 150 150 151 151 $wp_module_header = '<!-- wordpress added module header --> 152 152 ' . get_mod_header($contents) . ' … … 193 193 $xoTheme->addMeta('meta', $meta_key, $meta_word); 194 194 } 195 $xoopsTpl->assign('xoops_meta_'. $meta_key, $meta_word); 196 } 195 $xoopsTpl->assign('xoops_meta_'. $meta_key, $meta_word); 196 } 197 197 } 198 198 function xpress_get_xoops_meta($meta_key){ 199 199 global $xoopsTpl,$xoTheme; //for XOOPS 200 200 201 201 if (defined('LEGACY_MODULE_VERSION') && version_compare(LEGACY_MODULE_VERSION, '2.2', '>=')) { 202 202 // For XCL 2.2 … … 213 213 return $ret; 214 214 } 215 215 216 216 217 217 //rendering for the module header and the body … … 219 219 global $xoops_config; 220 220 global $xoopsUser , $xoopsTpl,$xpress_config , $xoopsModule , $xoopsLogger, $xoopsConfig ; //for XOOPS 221 221 222 222 //disable cache 223 223 $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; … … 228 228 xpress_remake_global_for_permlink(); 229 229 $mydirname = basename(dirname(dirname(__FILE__))); 230 if (defined('LEGACY_BASE_VERSION') && version_compare(LEGACY_BASE_VERSION, '2.2.1.1', '>=')) { 231 $module_handler =& xoops_gethandler('module'); 232 $thisModule =& $module_handler->getByDirname($mydirname); 233 $thisModule->modinfo = null; 234 } 230 235 include $xoops_config->xoops_root_path ."/header.php"; 231 236 $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs); … … 233 238 $page_title = $GLOBALS["xoopsModule"]->getVar("name"). ' »'. get_xpress_title($contents); 234 239 $xoopsTpl->assign('xoops_pagetitle', $page_title); 235 240 236 241 $xoops_keywords = xpress_get_xoops_meta('keywords'); 237 242 238 243 $wp_keyword = get_xpress_meta_name('keywords',$contents); 239 244 switch ($xpress_config->meta_keyword_type){ … … 253 258 } 254 259 xpress_meta_assign('keywords', $keywords); 255 } 260 } 256 261 break; 257 262 default : … … 277 282 } 278 283 xpress_meta_assign('description', $description); 279 } 284 } 280 285 break; 281 286 default : … … 305 310 $xpress_data['now_user_level'] = xpress_now_user_level('echo=0'); 306 311 307 //If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed. 312 //If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed. 308 313 if (is_object($xoopsModule) && $xoopsModule->getVar('hasnotification') == 1 && is_object($xoopsUser)) { 309 314 require_once $xoops_config->xoops_root_path . '/include/notification_select.php'; 310 315 } 311 316 312 317 $xoopsTpl->assign('xpress', $xpress_data); 313 318 $templates_file = 'db:'.$mydirname. '_index.html';
Note: See TracChangeset
for help on using the changeset viewer.