XPressME Integration Kit

Trac

Changeset 541


Ignore:
Timestamp:
Mar 14, 2010, 1:45:25 AM (14 years ago)
Author:
toemon
Message:

拡張ブロックのコードが選択テーマに無い場合デフォルトテーマ内を探すように Fixes #305

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/enhanced_block_theme.php

    r448 r541  
    11<?php 
    2 // Block Version: 1.0 
     2// Block Version: 1.1 
    33function enhanced_block($options) 
    44{ 
     
    99        $include_path = dirname(__FILE__) . '/my_' . $include_file . '_block.php'; 
    1010 
     11        $file_found = true; 
    1112        if (empty($include_file)) { 
     13                $file_found = false; 
    1214                $output = __('The include file name to display it is not set.','xpress'); 
    13         } else if (! file_exists($include_path)) { 
    14                 $output = sprintf(__('File %s not exist.','xpress'),$include_path); 
    15         } else { 
     15        } 
     16        if (! file_exists($include_path)) { 
     17                $include_path_temp = $include_path; 
     18                $include_path = dirname(dirname(dirname(__FILE__))).'/xpress_default/blocks/my_' . $include_file . '_block.php'; 
     19                if (! file_exists($include_path)) { 
     20                        $file_found = false; 
     21                        $output = sprintf(__('File %s not exist.','xpress'),$include_path_temp); 
     22                } 
     23        } 
     24        if($file_found) { 
    1625                ob_start(); 
    1726                        require $include_path; 
Note: See TracChangeset for help on using the changeset viewer.