Index: /branches/version-2_12-dev/html/install/sql/insert_data.sql
===================================================================
--- /branches/version-2_12-dev/html/install/sql/insert_data.sql	(revision 21393)
+++ /branches/version-2_12-dev/html/install/sql/insert_data.sql	(revision 21416)
@@ -1305,4 +1305,9 @@
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_REALDIR', 'USER_REALDIR . PLUGIN_DIR', 601, 'プラグイン保存先');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_URL', 'USER_URL . PLUGIN_DIR', 602, 'プラグイン URL');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENGINE_REALDIR', 'DATA_REALDIR . "class/plugin/"', 603, 'プラグインエンジン');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_UPLOAD_REALDIR', 'DATA_REALDIR . "downloads/plugin/"', 604, 'プラグイン保存先');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_HTML_REALDIR', 'HTML_REALDIR . "plugin/"', 605, 'プラグイン外部ファイル保存先');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_TMPL_CACHE_REALDIR', 'PLUGIN_UPLOAD_REALDIR . "templates_cache/"', 606, 'プラグイン・テンプレートキャッシュ保存先');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_DIR_PERMISSION', '0777', 607, 'プラグイン・ディレクトリパーミッション');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('DOWNLOAD_DAYS_LEN', '3', 700, '日数桁数');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('DOWNLOAD_EXTENSION', '"zip,lzh,jpg,jpeg,gif,png,mp3,pdf,csv"', 701, 'ダウンロードファイル登録可能拡張子(カンマ区切り)"');
@@ -1356,4 +1361,9 @@
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_FALSE', '"2"', 1223, 'プラグイン有効/無効：無効');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('ZIP_DOWNLOAD_URL', '"http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip"', 1224, '郵便番号CSVのZIPアーカイブファイルの取得元');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_TRUE', '"1"', 1222, 'プラグイン有効/無効：有効');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_FALSE', '"2"', 1223, 'プラグイン有効/無効：無効');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_TRUE', '"1"', 1222, 'プラグイン有効/無効：有効');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_FALSE', '"2"', 1223, 'プラグイン有効/無効：無効');
+
 
 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_customer', 'email_mobile', 0, '会員数増加時のログイン処理速度を向上させたいときに試してみてください');
Index: /branches/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php
===================================================================
--- /branches/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php	(revision 21395)
+++ /branches/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php	(revision 21416)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
@@ -56,5 +56,5 @@
             if (array_search($arrPluginData['class_name'], $arrPluginDirectory) !== false ) {
                 // プラグイン本体ファイルをrequire.
-                require_once(DOWNLOADS_PLUGIN_REALDIR . $arrPluginData['plugin_setting_path']);
+                require_once(PLUGIN_UPLOAD_REALDIR . $arrPluginData['class_name'] . '/' . $arrPluginData['class_name'] . '.php');
                 // プラグインのインスタンス生成.
                 $objPlugin = new $arrPluginData['class_name']($arrPluginData);
@@ -148,10 +148,10 @@
      * プラグインディレクトリの取得
      *
-     * @return array $arrEccPluginDirectory
+     * @return array $arrPluginDirectory
      */
     function getPluginDirectory() {
         $arrPluginDirectory = array();
-        if (is_dir(DOWNLOADS_PLUGIN_REALDIR)) {
-            if ($dh = opendir(DOWNLOADS_PLUGIN_REALDIR)) {
+        if (is_dir(PLUGIN_UPLOAD_REALDIR)) {
+            if ($dh = opendir(PLUGIN_UPLOAD_REALDIR)) {
                 while (($pluginDirectory = readdir($dh)) !== false) {
                     $arrPluginDirectory[] = $pluginDirectory;
@@ -265,5 +265,5 @@
         }
         // キャッシュテンプレートを削除
-        if ($test_mode === true) {
+        if ($test_mode === false) {
             $this->unlinkRecurse(PLUGIN_TMPL_CACHE_REALDIR, false);
         }
@@ -302,5 +302,5 @@
             }
             closedir($handle);
-
+            
             // ディレクトリを削除
             if ($del_myself) @rmdir($path);
Index: /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Transform_List.php
===================================================================
--- /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Transform_List.php	(revision 21395)
+++ /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Transform_List.php	(revision 21416)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
Index: /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Selector.php
===================================================================
--- /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Selector.php	(revision 21395)
+++ /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Selector.php	(revision 21416)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
Index: /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Transformer.php
===================================================================
--- /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Transformer.php	(revision 21395)
+++ /branches/version-2_12-dev/data/class/plugin/SC_Plugin_Template_Transformer.php	(revision 21416)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
Index: /branches/version-2_12-dev/data/require_plugin.php
===================================================================
--- /branches/version-2_12-dev/data/require_plugin.php	(revision 21395)
+++ /branches/version-2_12-dev/data/require_plugin.php	(revision 21416)
@@ -22,8 +22,8 @@
  */
 
-    require_once (PLUGIN_REALDIR . 'SC_Plugin_Template_Transform_List.php');
-    require_once (PLUGIN_REALDIR . 'SC_Plugin_Template_Transformer.php');
-    require_once (PLUGIN_REALDIR . 'SC_Plugin_Template_Selector.php');
-    require_once (DOWNLOADS_PLUGIN_REALDIR . 'SC_Plugin_Base.php');
+    require_once (PLUGIN_ENGINE_REALDIR . 'SC_Plugin_Template_Transform_List.php');
+    require_once (PLUGIN_ENGINE_REALDIR . 'SC_Plugin_Template_Transformer.php');
+    require_once (PLUGIN_ENGINE_REALDIR . 'SC_Plugin_Template_Selector.php');
+    require_once (PLUGIN_UPLOAD_REALDIR . 'SC_Plugin_Base.php');
 //}
 ?>
Index: /branches/version-2_12-dev/data/mtb_constants_init.php
===================================================================
--- /branches/version-2_12-dev/data/mtb_constants_init.php	(revision 21395)
+++ /branches/version-2_12-dev/data/mtb_constants_init.php	(revision 21416)
@@ -489,14 +489,16 @@
 /** プラグインディレクトリ */
 define('PLUGIN_DIR', "plugins/");
+/** プラグイン保存先 (deprecated：PLUGIN_UPLOAD_REALDIRを使用して下さい) */
+define('PLUGIN_REALDIR', USER_REALDIR . PLUGIN_DIR);
 /** プラグインエンジン */
-define('PLUGIN_REALDIR', DATA_REALDIR . "class/plugin/");
+define('PLUGIN_ENGINE_REALDIR', DATA_REALDIR . "class/plugin/");
 /** プラグイン保存先. */
-define('DOWNLOADS_PLUGIN_REALDIR', DATA_REALDIR . "downloads/plugin/");
-/** プラグイン・テンプレートキャッシュ. */
-define('PLUGIN_TMPL_CACHE_REALDIR', DOWNLOADS_PLUGIN_REALDIR . 'templates_cache/');
+define('PLUGIN_UPLOAD_REALDIR', DATA_REALDIR . "downloads/plugin/");
+/** プラグイン外部ファイル保存先. */
+define('PLUGIN_HTML_REALDIR', HTML_REALDIR . 'plugin/');
+/** プラグイン・テンプレートキャッシュ保存先. */
+define('PLUGIN_TMPL_CACHE_REALDIR', PLUGIN_UPLOAD_REALDIR . 'templates_cache/');
 /** プラグイン・ディレクトリパーミッション. */
 define('PLUGIN_DIR_PERMISSION', 0777);
-/** プラグイン URL. */
-define('PLUGIN_HTML_URLPATH', ROOT_URLPATH . 'plugin/');
 /** プラグイン URL */
 define('PLUGIN_URL', USER_URL . PLUGIN_DIR);
