[Svn-src-all:2772] [version-2_12-dev 21671] #1692 プラグイン設定を呼び出す処理をモジュールと同様の処理に変更

h_yoshimoto admin @ mail.ec-cube.net
2012年 3月 23日 (金) 16:24:30 JST


Subversion committed to /home/svn/open 21671
http://svn.ec-cube.net/open_trac/changeset/21671
┌────────────────────────────┐
│更新者 :  h_yoshimoto                                  │
│更新日時:  2012-03-23 16:24:29 +0900 (金, 23  3月 2012)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#1692 プラグイン設定を呼び出す処理をモジュールと同様の処理に変更

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_12-dev/data/Smarty/templates/admin/system/plugin.tpl
A   branches/version-2_12-dev/html/admin/load_plugin_config.php

変更: branches/version-2_12-dev/data/Smarty/templates/admin/system/plugin.tpl
===================================================================
--- branches/version-2_12-dev/data/Smarty/templates/admin/system/plugin.tpl	2012-03-23 04:53:57 UTC (rev 21670)
+++ branches/version-2_12-dev/data/Smarty/templates/admin/system/plugin.tpl	2012-03-23 07:24:29 UTC (rev 21671)
@@ -186,7 +186,7 @@
                             <span class="attention"><!--{$arrErr[$plugin.plugin_code]}--></span>
                             <!-- 設定 -->
                                 <!--{if $plugin.config_flg == true && $plugin.status != $smarty.const.PLUGIN_STATUS_UPLOADED}-->
-                                    <a href="?" onclick="win03('<!--{$smarty.const.ROOT_URLPATH}-->plugin/<!--{$plugin.plugin_code}-->/config.php','plugin_setting','620','760'); return false;">プラグイン設定</a>&nbsp;|&nbsp;
+                                    <a href="?" onclick="win02('../load_plugin_config.php?plugin_id=<!--{$plugin.plugin_id}-->', 'load', 615, 400);return false;">プラグイン設定</a>&nbsp;|&nbsp;
                                 <!--{else}-->
                                     <span>プラグイン設定&nbsp;|&nbsp;</span>
                                 <!--{/if}-->

コピーによる追加: branches/version-2_12-dev/html/admin/load_plugin_config.php (コピー元: リビジョン 21668, branches/version-2_12-dev/html/admin/load_module_config.php)
===================================================================
--- branches/version-2_12-dev/html/admin/load_plugin_config.php	                        (rev 0)
+++ branches/version-2_12-dev/html/admin/load_plugin_config.php	2012-03-23 07:24:29 UTC (rev 21671)
@@ -0,0 +1,57 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+/**
+ * プラグイン設定をロードする。
+ * GETのクエリにplugin_idを渡す。
+ *
+ * 管理画面から呼び出すことを想定しているので、
+ * 認証は外さないこと
+ */
+
+require_once 'require.php';
+
+// 認証可否の判定
+SC_Utils::sfIsSuccess(new SC_Session());
+
+$plugin_id = isset($_GET['plugin_id']) ? $_GET['plugin_id'] : null;
+
+if (!empty($plugin_id) && is_numeric($plugin_id)) {
+
+    GC_Utils::gfPrintLog('loading plugin ====> plugin_id = ' . $plugin_id);
+    $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(false);
+    $plugin = $objPlugin->getPluginByPluginId($plugin_id);
+    
+    if (isset($plugin['plugin_code'])) {
+        $config_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . '/config.php';
+        
+        if (file_exists($config_path)) {
+            require_once $config_path;
+            exit;
+        } else {
+            die("プラグインの取得に失敗しました: $config_path");
+        }
+    } else {
+        die("プラグインが存在しません: plugin_id => $plugin_id");
+    }
+}




Svn-src-all メーリングリストの案内