XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 20, 2009, 12:46:12 PM (15 years ago)
Author:
toemon
Message:

ブロックのバージョン管理実装 Fixes #246

File:
1 edited

Legend:

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

    r394 r448  
    137137        } 
    138138         
    139         function get_block_file_path($mydirname,$file_name) 
    140         { 
    141                 global $xoops_config; 
    142                 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
    143                 $select_theme = get_xpress_theme_name($mydirname); 
    144                 $block_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/' . $file_name; 
    145  
    146                 if (!file_exists($block_file)) 
    147                         $block_file =  $xoops_config->xoops_root_path . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/' . $file_name; 
    148                 return $block_file; 
    149         } 
    150139         
    151140    function xpress_block_cache_found($mydirname,$block_name) 
     
    184173                if (strstr($call_url,$this_url)){                        
    185174                        $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 
    186                         require_once $block_theme_file; 
     175                        require_once $block_theme_file['file_path']; 
    187176                        $block = $call_theme_function_name($options);           //The block name and the called function name should be assumed to be the same name.  
     177                        if (!empty($block_theme_file['error'])) 
     178                                $block['err_message'] = $block_theme_file['error']; 
    188179                } else { 
    189180                        if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){ 
     
    227218 
    228219                        $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 
    229                         require_once $block_theme_file; 
     220                        require_once $block_theme_file['file_path']; 
    230221                        $render = $call_theme_function_name($options);          //The block name and the called function name should be assumed to be the same name.                     
    231222                        $render_array['block'] = $render; 
    232223                        $render_array['block']['options'] = $block->options; 
     224                        if (!empty($block_theme_file['error'])) 
     225                                $render_array['block']['err_message'] = $block_theme_file['error']; 
    233226                        if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){        
    234227                                $render_serialize = xpress_XML_serialize($render_array); 
     
    295288                } 
    296289        } 
    297  
     290         
    298291}        
    299292?> 
Note: See TracChangeset for help on using the changeset viewer.