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

Revision 22641, 3.8 KB checked in by Yammy, 11 years ago (diff)

フックポイントのON/OFF機能実装

refs #2179

Line 
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 = 'プラグインフックポイント管理';
53
54        $this->arrUse[t] = 'ON';
55        $this->arrUse[f] = 'OFF';
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) {
83            // ON/OFF
84            case 'update_use':
85                // エラーチェック
86                $this->arrErr = $objFormParam->checkError();
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);
92                }
93                break;
94            default:
95                break;
96        }
97        // DBからプラグイン情報を取得
98        $arrHookPoint = SC_Plugin_Util_Ex::getPluginHookPointList();
99
100        $this->arrHookPoint = $arrHookPoint;
101    }
102
103    /**
104     * デストラクタ.
105     *
106     * @return void
107     */
108    function destroy()
109    {
110        parent::destroy();
111    }
112
113    /**
114     * パラメーター初期化.
115     *
116     * @param SC_FormParam_Ex $objFormParam
117     * @param string $mode モード
118     * @return void
119     */
120    function initParam(&$objFormParam)
121    {
122        $objFormParam->addParam('モード', 'mode', STEXT_LEN, '', array('MAX_LENGTH_CHECK'));
123        $objFormParam->addParam('ON/OFFフラグ', 'plugin_hookpoint_use', INT_LEN, '', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
124        $objFormParam->addParam('プラグインフックポイントID', 'plugin_hookpoint_id', INT_LEN, '', array('NUM_CHECK', 'EXIST_CHECK', 'MAX_LENGTH_CHECK'));
125    }
126
127}
Note: See TracBrowser for help on using the repository browser.