source: branches/version-2_13-dev/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_PluginHookPointList.php @ 22991

Revision 22991, 4.1 KB checked in by adachi, 8 years ago (diff)

#2179 #2179 booleanをsmallintへ変更

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 = array();
55        $this->arrUse[1] = 'ON';
56        $this->arrUse[0] = 'OFF';
57    }
58
59    /**
60     * Page のプロセス.
61     *
62     * @return void
63     */
64    function process()
65    {
66        $this->action();
67        $this->sendResponse();
68    }
69
70    /**
71     * Page のアクション.
72     *
73     * @return void
74     */
75    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                }
94                break;
95            default:
96                break;
97        }
98        // DBからプラグイン情報を取得
99        $arrRet = SC_Plugin_Util_Ex::getPluginHookPointList();
100        // 競合チェック
101        $this->arrConflict = SC_Plugin_Util_Ex::checkConflictPlugin();
102        $arrHookPoint = array();
103        foreach ($arrRet AS $key => $val) {
104            $arrHookPoint[$val['hook_point']][$val['plugin_id']] = $val;
105        }
106        $this->arrHookPoint = $arrHookPoint;
107    }
108
109    /**
110     * デストラクタ.
111     *
112     * @return void
113     */
114    function destroy()
115    {
116        parent::destroy();
117    }
118
119    /**
120     * パラメーター初期化.
121     *
122     * @param SC_FormParam_Ex $objFormParam
123     * @param string $mode モード
124     * @return void
125     */
126    function initParam(&$objFormParam)
127    {
128        $objFormParam->addParam('モード', 'mode', STEXT_LEN, '', array('MAX_LENGTH_CHECK'));
129        $objFormParam->addParam('ON/OFFフラグ', 'plugin_hookpoint_use', INT_LEN, '', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
130        $objFormParam->addParam('プラグインフックポイントID', 'plugin_hookpoint_id', INT_LEN, '', array('NUM_CHECK', 'EXIST_CHECK', 'MAX_LENGTH_CHECK'));
131    }
132
133}
Note: See TracBrowser for help on using the repository browser.