listTableFields($table); if (in_array('rank', $arrCols)) { $objQuery->setOrder('rank'); } $arrRet = $objQuery->select($col, $table, $where); $class_name = get_class($lcpage); // 現在のページで使用するプラグインが存在するかどうかを検証する foreach ($arrRet as $plugins){ // プラグインを稼働させるクラス名のリストを取得する // プラグインのディレクトリ内の設定ファイルを参照する $plugin_name = $plugins['plugin_name']; $plugin_class_name = $plugins['class_name']; $plugin_path = DATA_REALDIR . "plugin/{$plugin_name}/{$plugin_class_name}.php"; if (file_exists($plugin_path)) { require_once $plugin_path; if (class_exists($class_name)) { $code_str = "\$is_enable = {$plugin_class_name}::isEnable(\$class_name);"; eval($code_str); if ($is_enable) { $arrPluginList[] = $plugin_class_name; GC_Utils_Ex::gfDebugLog($class_name . ' で、プラグイン ' . $plugin_name . ' をロードしました'); } else { GC_Utils_Ex::gfDebugLog($class_name . ' で、プラグイン ' . $plugin_name . ' は無効になっています'); } } else { GC_Utils_Ex::gfDebugLog('プラグイン ' . $plugin_name . ' の ' . $class_name . ' が見つかりませんでした'); } } else { GC_Utils_Ex::gfDebugLog('プラグイン ' . $plugin_name . " が読み込めませんでした。\n" . 'Failed opening required ' . $plugin_path); } } return $arrPluginList; } function preProcess(&$lcpage){ //プラグインの名前を判別してページ内で有効なプラグインがあれば実行する $arrPluginList = SC_Helper_Plugin_Ex::load($lcpage); if(count($arrPluginList) > 0){ foreach ($arrPluginList as $key => $value){ $instance = new $value; $instance->preProcess($lcpage); } } return $lcpage; } /* 読み込んだプラグインの実行用メソッド * */ function process(&$lcpage){ //プラグインの名前を判別してページ内で有効なプラグインがあれば実行する $arrPluginList = SC_Helper_Plugin_Ex::load($lcpage); if(count($arrPluginList) > 0){ foreach ($arrPluginList as $key => $value){ $instance = new $value; $instance->process($lcpage); } } return $lcpage; } /** * 稼働中のプラグインを取得する。 */ function getEnablePlugin(){ $objQuery = new SC_Query_Ex(); $col = '*'; $table = 'dtb_plugin'; $where = 'enable = 1 AND del_flg = 0'; // XXX 2.11.0 互換のため $arrCols = $objQuery->listTableFields($table); if (in_array('rank', $arrCols)) { $objQuery->setOrder('rank DESC'); } $arrRet = $objQuery->select($col,$table,$where); return $arrRet; } /** * インストールされているプラグインを取得する。 */ function getAllPlugin(){ $objQuery = new SC_Query_Ex(); $col = '*'; $table = 'dtb_plugin'; $where = 'del_flg = 0'; // XXX 2.11.0 互換のため $arrCols = $objQuery->listTableFields($table); if (in_array('rank', $arrCols)) { $objQuery->setOrder('rank DESC'); } $arrRet = $objQuery->select($col,$table,$where); return $arrRet; } function getFilesystemPlugins(){ $plugin_dir = DATA_REALDIR."/plugin/"; if($dh = opendir($plugin_dir)){ while(($file = readdir($dh) !== false)){ if(is_dir($plugin_dir."/".$file)){ } } } } }