Changeset 19183


Ignore:
Timestamp:
2010/11/06 23:48:43 (12 years ago)
Author:
shutta
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_5-E/data/class/helper/SC_Helper_Plugin.php

    r19155 r19183  
    1919        // 実行されたぺーじ 
    2020        // 現在のページで使用するプラグインが存在するかどうかを検証する 
    21         foreach ($arrRet as $key => $value){ 
     21        foreach ($arrRet as $plugins){ 
    2222            // プラグインを稼働させるクラス名のリストを取得する 
    2323            // プラグインのディレクトリ内の設定ファイルを参照する 
    24             require_once DATA_PATH.'plugin/'.$value['class_name'].'/config.php'; 
    25             if( in_array($class_name,$arrPluginPageList) == true ){ 
    26                 require_once DATA_PATH.'plugin/'.$value['class_name'].'/'.$value['class_name'].'.php'; 
    27                 $arrPluginList[] = $value['class_name']; 
     24            $plugin_name = $plugins['class_name']; 
     25            require_once DATA_PATH."plugin/{$plugin_name}/{$plugin_name}.php"; 
     26 
     27            $code_str = "\$is_enable = {$plugin_name}::is_enable(\$class_name);"; 
     28            eval($code_str); 
     29            if ($is_enable) { 
     30                $arrPluginList[] = $plugin_name; 
    2831            } 
    2932        } 
    3033        return $arrPluginList; 
     34    } 
     35 
     36    public static function preProcess(LC_Page $lcpage){ 
     37        //プラグインの名前を判別してページ内で有効なプラグインがあれば実行する 
     38        $arrPluginList = SC_Helper_Plugin::load($lcpage); 
     39       if(count($arrPluginList) > 0){ 
     40            foreach ($arrPluginList as $key => $value){ 
     41                $instance = new $value; 
     42                $instance->preProcess($lcpage); 
     43            } 
     44        } 
     45        return $lcpage; 
    3146    } 
    3247 
Note: See TracChangeset for help on using the changeset viewer.