XPressME Integration Kit

Trac

Changeset 848


Ignore:
Timestamp:
Nov 18, 2013, 9:29:23 AM (10 years ago)
Author:
toemon
Message:

XCL 2.2.1 メインメニューブロックにおいて、サブメニューが表示されない問題修正 fixed #426
thx nao-pon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/include/xpress_render.php

    r839 r848  
    11<?php 
    22 
    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. 
    44function get_mod_header($contents) 
    55{ 
    66        global $xpress_config; 
    7          
     7 
    88        $pattern = "<body[^>]*?>(.*)<\/body>"; 
    99        $body_cut = preg_replace("/".$pattern."/s" , '' , $contents); 
     
    3636        $head_str = meta_name_cut('generator',$head_str); 
    3737 
    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); 
    3939        $pattern = "^"; 
    4040        $head_str = preg_replace("/".$pattern."/m" , "\t" , $head_str); 
     
    7171} 
    7272 
    73 // get sidebar rendaring  
     73// get sidebar rendaring 
    7474function get_sidebar_rander($name = null) 
    7575{ 
     
    9393} 
    9494 
    95 // < body > tag is pulled out from the header of html contents.  
     95// < body > tag is pulled out from the header of html contents. 
    9696function get_body($contents) 
    9797{ 
     
    103103                $body = $body_matches[1]; 
    104104        } 
    105          
     105 
    106106        if ($xpess_config->is_theme_sidebar_disp){ 
    107107                $xpress_class = 'xpress-body'; 
     
    109109                $xpress_class = 'xpress-body onecolumn'; 
    110110        } 
    111          
     111 
    112112        $pattern = '<body\s*([^>]*)>'; 
    113113        $body_class = 'class="' . $xpress_class . '"'; 
     
    115115                $body_tag_option = $body_matches[1]; 
    116116 
    117                 $pattern = 'class\s*=\s*[\'|"]([^\'|^"]*)[\'|"]';                
     117                $pattern = 'class\s*=\s*[\'|"]([^\'|^"]*)[\'|"]'; 
    118118                if(preg_match("/".$pattern."/",  $body_tag_option, $class_matches)){ 
    119119                        $class_value = $class_matches[1]; 
     
    142142                $preload_make_module_header = ''; 
    143143        } 
    144          
     144 
    145145        if (! empty($preload_make_module_header)){ 
    146146        $preload_make_module_header = '<!-- preload added module header --> 
     
    148148'; 
    149149        } 
    150          
     150 
    151151        $wp_module_header = '<!-- wordpress  added module header --> 
    152152' . get_mod_header($contents) . ' 
     
    193193                $xoTheme->addMeta('meta', $meta_key, $meta_word); 
    194194                } 
    195                 $xoopsTpl->assign('xoops_meta_'.  $meta_key, $meta_word);                                
    196         }        
     195                $xoopsTpl->assign('xoops_meta_'.  $meta_key, $meta_word); 
     196        } 
    197197} 
    198198function xpress_get_xoops_meta($meta_key){ 
    199199        global $xoopsTpl,$xoTheme; //for XOOPS 
    200          
     200 
    201201        if (defined('LEGACY_MODULE_VERSION') && version_compare(LEGACY_MODULE_VERSION, '2.2', '>=')) { 
    202202                // For XCL 2.2 
     
    213213        return $ret; 
    214214} 
    215          
     215 
    216216 
    217217//rendering for the module header and the body 
     
    219219        global $xoops_config; 
    220220        global $xoopsUser , $xoopsTpl,$xpress_config , $xoopsModule , $xoopsLogger, $xoopsConfig ; //for XOOPS 
    221          
     221 
    222222        //disable cache 
    223223        $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; 
     
    228228        xpress_remake_global_for_permlink(); 
    229229        $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        } 
    230235        include $xoops_config->xoops_root_path ."/header.php"; 
    231236        $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs); 
     
    233238        $page_title = $GLOBALS["xoopsModule"]->getVar("name"). ' &raquo;'. get_xpress_title($contents); 
    234239        $xoopsTpl->assign('xoops_pagetitle', $page_title); 
    235          
     240 
    236241        $xoops_keywords =  xpress_get_xoops_meta('keywords'); 
    237          
     242 
    238243        $wp_keyword = get_xpress_meta_name('keywords',$contents); 
    239244        switch ($xpress_config->meta_keyword_type){ 
     
    253258                                } 
    254259                                xpress_meta_assign('keywords', $keywords); 
    255                         }  
     260                        } 
    256261                        break; 
    257262                default : 
     
    277282                                } 
    278283                                xpress_meta_assign('description', $description); 
    279                         }  
     284                        } 
    280285                        break; 
    281286                default : 
     
    305310        $xpress_data['now_user_level'] = xpress_now_user_level('echo=0'); 
    306311 
    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. 
    308313        if (is_object($xoopsModule) && $xoopsModule->getVar('hasnotification') == 1 && is_object($xoopsUser)) { 
    309314                require_once $xoops_config->xoops_root_path . '/include/notification_select.php'; 
    310315        } 
    311          
     316 
    312317        $xoopsTpl->assign('xpress', $xpress_data); 
    313318        $templates_file = 'db:'.$mydirname. '_index.html'; 
Note: See TracChangeset for help on using the changeset viewer.