Ignore:
Timestamp:
2011/04/20 16:13:08 (13 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_11-dev:20869
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/Smarty/templates/admin/system/plugin.tpl 18949@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2FSmarty%2Ftemplates%2Fadmin%2Fsystem%2Fplugin.tpl
data/class/helper/SC_Helper_Plugin.php 18913@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2Fclass%2Fhelper%2FSC_Helper_Plugin.php
data/class/pages/admin/LC_Page_Admin.php 15280@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2FLC_Page_Admin.php
data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php 18933@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2Fclass%2Fpages%2Fadmin%2Fsystem%2FLC_Page_Admin_System_Plugin.php
html/install/sql/create_table_mysql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_mysql.sql
html/install/sql/create_table_pgsql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_pgsql.sql
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110420071305-b734t36r0p852crv
bzr:revno:
3581
bzr:revprop:branch-nick:
branches/version-2_11-dev
bzr:root:
branches/version-2_11-dev
bzr:text-revisions:

data/Smarty/templates/admin/system/plugin.tpl ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
data/class/helper/SC_Helper_Plugin.php ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
data/class/pages/admin/LC_Page_Admin.php ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
html/install/sql/create_table_mysql.sql ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
html/install/sql/create_table_pgsql.sql ohkouchi@loop-az.jp-20110420071045-smb0kz6k8uhe0i8f
bzr:timestamp:
2011-04-20 16:13:05.654000044 +0900
bzr:user-agent:
bzr2.2.1+bzr-svn1.0.4
svn:original-date:
2011-04-20T07:13:05.654000Z
Message:

#494 (プラグイン機能)

  • プラグインの存在チェック, デバックログ出力を追加
  • プラグインのロード順位を指定できるよう修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/helper/SC_Helper_Plugin.php

    r20764 r20870  
    4040        $table = "dtb_plugin"; 
    4141        $where = "enable = 1 AND del_flg = 0"; 
     42        // XXX 2.11.0 互換のため 
     43        $arrCols = $objQuery->listTableFields($table); 
     44        if (in_array('rank', $arrCols)) { 
     45            $objQuery->setOrder('rank'); 
     46        } 
    4247        $arrRet = $objQuery->select($col, $table, $where); 
    4348        $class_name = get_class($lcpage); 
    4449 
    45         // 実行されたぺーじ 
    4650        // 現在のページで使用するプラグインが存在するかどうかを検証する 
    4751        foreach ($arrRet as $plugins){ 
    4852            // プラグインを稼働させるクラス名のリストを取得する 
    4953            // プラグインのディレクトリ内の設定ファイルを参照する 
    50             $plugin_name = $plugins['name']; 
     54            $plugin_name = $plugins['plugin_name']; 
    5155            $plugin_class_name = $plugins['class_name']; 
    52             require_once DATA_REALDIR."plugin/{$plugin_name}/{$plugin_class_name}.php"; 
     56            $plugin_path = DATA_REALDIR . "plugin/{$plugin_name}/{$plugin_class_name}.php"; 
    5357 
    54             $code_str = "\$is_enable = {$plugin_class_name}::isEnable(\$class_name);"; 
    55             eval($code_str); 
    56             if ($is_enable) { 
    57                 $arrPluginList[] = $plugin_class_name; 
     58            if (file_exists($plugin_path)) { 
     59                require_once $plugin_path; 
     60                if (class_exists($class_name)) { 
     61                    $code_str = "\$is_enable = {$plugin_class_name}::isEnable(\$class_name);"; 
     62                    eval($code_str); 
     63                    if ($is_enable) { 
     64                        $arrPluginList[] = $plugin_class_name; 
     65                        GC_Utils_Ex::gfDebugLog($class_name . ' で、プラグイン ' . $plugin_name . ' をロードしました'); 
     66                    } else { 
     67                        GC_Utils_Ex::gfDebugLog($class_name . ' で、プラグイン ' . $plugin_name . ' は無効になっています'); 
     68                    } 
     69                } else { 
     70                    GC_Utils_Ex::gfDebugLog('プラグイン ' . $plugin_name . ' の ' . $class_name . ' が見つかりませんでした'); 
     71                } 
     72            } else { 
     73                GC_Utils_Ex::gfDebugLog('プラグイン ' . $plugin_name . " が読み込めませんでした。\n" 
     74                                        . 'Failed opening required ' . $plugin_path); 
    5875            } 
    5976        } 
     
    96113        $table = 'dtb_plugin'; 
    97114        $where = 'enable = 1 AND del_flg = 0'; 
     115        // XXX 2.11.0 互換のため 
     116        $arrCols = $objQuery->listTableFields($table); 
     117        if (in_array('rank', $arrCols)) { 
     118            $objQuery->setOrder('rank DESC'); 
     119        } 
    98120        $arrRet = $objQuery->select($col,$table,$where); 
    99121        return $arrRet; 
     
    108130        $table = 'dtb_plugin'; 
    109131        $where = 'del_flg = 0'; 
     132        // XXX 2.11.0 互換のため 
     133        $arrCols = $objQuery->listTableFields($table); 
     134        if (in_array('rank', $arrCols)) { 
     135            $objQuery->setOrder('rank DESC'); 
     136        } 
    110137        $arrRet = $objQuery->select($col,$table,$where); 
    111138        return $arrRet; 
Note: See TracChangeset for help on using the changeset viewer.