source: branches/camp/camp-2_13-plugin/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_PluginHookPointList.php @ 22664

Revision 22664, 4.0 KB checked in by Yammy, 11 years ago (diff)

プラグインフックポイントの競合チェクを追加

refs #2179

RevLine 
[22629]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
25require_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 */
34class 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    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 = 'プラグインフックポイント管理';
[22641]53
54        $this->arrUse[t] = 'ON';
55        $this->arrUse[f] = 'OFF';
[22629]56    }
57
58    /**
59     * Page のプロセス.
60     *
61     * @return void
62     */
63    function process()
64    {
65        $this->action();
66        $this->sendResponse();
67    }
68
69    /**
70     * Page のアクション.
71     *
72     * @return void
73     */
74    function action()
75    {
76        // パラメーター管理クラス
77        $objFormParam = new SC_FormParam_Ex();
78        $this->initParam($objFormParam, $mode);
79        $objFormParam->setParam($_POST);
80
81        $mode = $this->getMode();
82        switch ($mode) {
[22641]83            // ON/OFF
84            case 'update_use':
[22629]85                // エラーチェック
86                $this->arrErr = $objFormParam->checkError();
[22641]87                if (!(count($this->arrErr) > 0)) {
88                    $arrPluginHookpointUse = $objFormParam->getValue('plugin_hookpoint_use');
89                    $plugin_hookpoint_id = $objFormParam->getValue('plugin_hookpoint_id');
90                $use_flg = ($arrPluginHookpointUse[$plugin_hookpoint_id] == 't') ? true :false;
91                SC_Plugin_Util_Ex::setPluginHookPointChangeUse($plugin_hookpoint_id, $use_flg);
[22629]92                }
93                break;
94            default:
95                break;
96        }
97        // DBからプラグイン情報を取得
[22664]98        $arrRet = SC_Plugin_Util_Ex::getPluginHookPointList();
99        // 競合チェック
100        $this->arrConflict = SC_Plugin_Util_Ex::checkConflictPlugin();
101        foreach ($arrRet AS $key=>$val) {
102            $arrHookPoint[$val['hook_point']][$val['plugin_id']] = $val;
103        }
[22629]104        $this->arrHookPoint = $arrHookPoint;
105    }
106
107    /**
108     * デストラクタ.
109     *
110     * @return void
111     */
112    function destroy()
113    {
114        parent::destroy();
115    }
116
117    /**
118     * パラメーター初期化.
119     *
120     * @param SC_FormParam_Ex $objFormParam
121     * @param string $mode モード
122     * @return void
123     */
[22641]124    function initParam(&$objFormParam)
[22629]125    {
[22641]126        $objFormParam->addParam('モード', 'mode', STEXT_LEN, '', array('MAX_LENGTH_CHECK'));
127        $objFormParam->addParam('ON/OFFフラグ', 'plugin_hookpoint_use', INT_LEN, '', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
128        $objFormParam->addParam('プラグインフックポイントID', 'plugin_hookpoint_id', INT_LEN, '', array('NUM_CHECK', 'EXIST_CHECK', 'MAX_LENGTH_CHECK'));
[22629]129    }
130
131}
Note: See TracBrowser for help on using the repository browser.