1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | // {{{ requires |
---|
25 | require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php'; |
---|
26 | |
---|
27 | /** |
---|
28 | * オーナーズストア:プラグイン管理 のページクラス. |
---|
29 | * |
---|
30 | * @package Page |
---|
31 | * @author LOCKON CO.,LTD. |
---|
32 | * @version $Id: LC_Page_Admin_OwnersStore.php 22567 2013-02-18 10:09:54Z shutta $ |
---|
33 | */ |
---|
34 | class LC_Page_Admin_OwnersStore_PluginHookPointList extends LC_Page_Admin_Ex |
---|
35 | { |
---|
36 | |
---|
37 | // }}} |
---|
38 | // {{{ functions |
---|
39 | |
---|
40 | /** |
---|
41 | * Page を初期化する. |
---|
42 | * |
---|
43 | * @return void |
---|
44 | */ |
---|
45 | public function init() |
---|
46 | { |
---|
47 | parent::init(); |
---|
48 | $this->tpl_mainpage = 'ownersstore/plugin_hookpoint_list.tpl'; |
---|
49 | $this->tpl_subno = 'index'; |
---|
50 | $this->tpl_mainno = 'ownersstore'; |
---|
51 | $this->tpl_maintitle = 'オーナーズストア'; |
---|
52 | $this->tpl_subtitle = 'プラグインフックポイント管理'; |
---|
53 | |
---|
54 | $this->arrUse = array(); |
---|
55 | $this->arrUse[1] = 'ON'; |
---|
56 | $this->arrUse[0] = 'OFF'; |
---|
57 | } |
---|
58 | |
---|
59 | /** |
---|
60 | * Page のプロセス. |
---|
61 | * |
---|
62 | * @return void |
---|
63 | */ |
---|
64 | public function process() |
---|
65 | { |
---|
66 | $this->action(); |
---|
67 | $this->sendResponse(); |
---|
68 | } |
---|
69 | |
---|
70 | /** |
---|
71 | * Page のアクション. |
---|
72 | * |
---|
73 | * @return void |
---|
74 | */ |
---|
75 | public function action() |
---|
76 | { |
---|
77 | // パラメーター管理クラス |
---|
78 | $objFormParam = new SC_FormParam_Ex(); |
---|
79 | $this->initParam($objFormParam); |
---|
80 | $objFormParam->setParam($_POST); |
---|
81 | |
---|
82 | $mode = $this->getMode(); |
---|
83 | switch ($mode) { |
---|
84 | // ON/OFF |
---|
85 | case 'update_use': |
---|
86 | // エラーチェック |
---|
87 | $this->arrErr = $objFormParam->checkError(); |
---|
88 | if (!(count($this->arrErr) > 0)) { |
---|
89 | $arrPluginHookpointUse = $objFormParam->getValue('plugin_hookpoint_use'); |
---|
90 | $plugin_hookpoint_id = $objFormParam->getValue('plugin_hookpoint_id'); |
---|
91 | $use_flg = ($arrPluginHookpointUse[$plugin_hookpoint_id] == 1) ? 1 : 0; |
---|
92 | SC_Plugin_Util_Ex::setPluginHookPointChangeUse($plugin_hookpoint_id, $use_flg); |
---|
93 | // Smartyコンパイルファイルをクリア |
---|
94 | SC_Utils_Ex::clearCompliedTemplate(); |
---|
95 | } |
---|
96 | break; |
---|
97 | default: |
---|
98 | break; |
---|
99 | } |
---|
100 | // DBからプラグイン情報を取得 |
---|
101 | $arrRet = SC_Plugin_Util_Ex::getPluginHookPointList(); |
---|
102 | // 競合チェック |
---|
103 | $this->arrConflict = SC_Plugin_Util_Ex::checkConflictPlugin(); |
---|
104 | $arrHookPoint = array(); |
---|
105 | foreach ($arrRet AS $key => $val) { |
---|
106 | $arrHookPoint[$val['hook_point']][$val['plugin_id']] = $val; |
---|
107 | } |
---|
108 | $this->arrHookPoint = $arrHookPoint; |
---|
109 | } |
---|
110 | |
---|
111 | /** |
---|
112 | * デストラクタ. |
---|
113 | * |
---|
114 | * @return void |
---|
115 | */ |
---|
116 | public function destroy() |
---|
117 | { |
---|
118 | parent::destroy(); |
---|
119 | } |
---|
120 | |
---|
121 | /** |
---|
122 | * パラメーター初期化. |
---|
123 | * |
---|
124 | * @param SC_FormParam_Ex $objFormParam |
---|
125 | * @param string $mode モード |
---|
126 | * @return void |
---|
127 | */ |
---|
128 | public function initParam(&$objFormParam) |
---|
129 | { |
---|
130 | $objFormParam->addParam('モード', 'mode', STEXT_LEN, '', array('MAX_LENGTH_CHECK')); |
---|
131 | $objFormParam->addParam('ON/OFFフラグ', 'plugin_hookpoint_use', INT_LEN, '', array('EXIST_CHECK', 'MAX_LENGTH_CHECK')); |
---|
132 | $objFormParam->addParam('プラグインフックポイントID', 'plugin_hookpoint_id', INT_LEN, '', array('NUM_CHECK', 'EXIST_CHECK', 'MAX_LENGTH_CHECK')); |
---|
133 | } |
---|
134 | |
---|
135 | } |
---|