XPressME Integration Kit

Trac


Ignore:
Timestamp:
Apr 13, 2010, 4:19:26 PM (14 years ago)
Author:
toemon
Message:

XOOPS smartyテンプレートタグ$xoops_block_headerに<script>を追加 Fixes #329

File:
1 edited

Legend:

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

    r506 r573  
    102102        } 
    103103 
    104         function get_block_stylesheet_url($mydirname) 
    105         { 
    106                 global $xoops_config; 
    107                 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
    108                 $select_theme = get_xpress_theme_name($mydirname); 
    109                 $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css'; 
    110                 if (file_exists($style_file)) 
    111                         return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css'; 
    112                 else     
    113                         return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/block_style.css'; 
    114         } 
    115          
    116         function get_stylesheet_url($mydirname) 
    117         { 
    118                 global $xoops_config; 
    119                 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
    120                 $select_theme = get_xpress_theme_name($mydirname); 
    121                 $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/style.css'; 
    122                 if (file_exists($style_file)) 
    123                         return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/style.css'; 
    124                 else     
    125                         return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/style.css'; 
    126         } 
    127          
    128         function xpress_get_plugin_css($mydirname = '') 
    129         { 
    130                 $this_url = '/modules/'. $mydirname; 
    131                 $call_url = $_SERVER['REQUEST_URI']; 
    132                 if (!strstr($call_url,$this_url)){                       
    133                         global $xoops_config; 
    134                          
    135                         // Module Main CSS 
    136                         $output = "\n".'<style type="text/css">@import url('.get_stylesheet_url($mydirname).');</style>'; 
    137                          
    138                         // hotDate 
    139                         $output .= "\n".'<style type="text/css">@import url('.$xoops_config->module_url.'/wp-content/plugins/hotDates/hotDates.css);</style>'; 
    140                         return $output;  
    141                 }  
    142                 return ''; 
    143         } 
    144  
    145         function xpress_block_css_set($mydirname = '') 
    146         { 
    147                 $style_url =  get_block_stylesheet_url($mydirname); 
    148                  
    149                 $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars(); 
    150                 $csslink = "\n".'<link rel="stylesheet" type="text/css" media="screen" href="'. $style_url .'" />'; 
    151                 // Module Main CSS Plugin Css 
    152                 $csslink .= xpress_get_plugin_css($mydirname); 
    153  
     104        function xpress_block_header_set($mydirname = '') 
     105        { 
     106                require_once( dirname( __FILE__ ).'/xpress_block_header.php' );  
     107                $xml = xpress_block_header_cache_read($mydirname); 
     108                $block_header = $xml['block_header']; 
     109                if (!empty($block_header)){ 
     110                        $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars(); 
    154111                        if(array_key_exists('xoops_block_header', $tplVars)) { 
    155                                 if (!strstr($tplVars['xoops_block_header'],$csslink)) { 
    156                                         $GLOBALS['xoopsTpl']->assign('xoops_block_header',$tplVars['xoops_block_header'].$csslink); 
     112                                if (!strstr($tplVars['xoops_block_header'],$block_header)) { 
     113                                        $GLOBALS['xoopsTpl']->assign('xoops_block_header',$tplVars['xoops_block_header'].$block_header); 
    157114                                } 
    158115                        } else { 
    159                                 $GLOBALS['xoopsTpl']->assign('xoops_block_header',$csslink); 
    160                         } 
     116                                $GLOBALS['xoopsTpl']->assign('xoops_block_header',$block_header); 
     117                        } 
     118                } 
    161119        } 
    162120         
     
    194152                $call_url = $_SERVER['REQUEST_URI']; 
    195153                 
    196                 xpress_block_css_set($mydirname); 
    197154                if (strstr($call_url , $this_block_url) !== false && strstr($call_url , $this_block_url . 'admin/') === false){ 
    198155                        $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 
     
    208165                                $block['err_message'] = sprintf(_MB_XP2_BLOCK_CACHE_ERR, '<a href="' . XOOPS_URL . '/modules/' . $mydirname . '">' . $mydirname .'</a>'); 
    209166                        } 
     167                        xpress_block_header_set($mydirname); 
    210168                } 
    211169                $temp_option = explode(':' , $options[1]); 
Note: See TracChangeset for help on using the changeset viewer.