source: branches/version-2_12-dev/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Log.php @ 22567

Revision 22567, 3.7 KB checked in by shutta, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
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$
33 */
34class LC_Page_Admin_OwnersStore_Log 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
49        $this->tpl_mainpage = 'ownersstore/log.tpl';
50        $this->tpl_mainno   = 'ownersstore';
51        $this->tpl_subno    = 'log';
52        $this->tpl_maintitle = 'オーナーズストア';
53        $this->tpl_subtitle = 'ログ管理';
54    }
55
56    /**
57     * Page のプロセス.
58     *
59     * @return void
60     */
61    function process()
62    {
63        $this->action();
64        $this->sendResponse();
65    }
66
67    /**
68     * Page のアクション.
69     *
70     * @return void
71     */
72    function action()
73    {
74        switch ($this->getMode()) {
75            case 'detail':
76                $objForm = $this->initParam();
77                if ($objForm->checkError()) {
78                    SC_Utils_Ex::sfDispError('');
79                }
80                $this->arrLogDetail = $this->getLogDetail($objForm->getValue('log_id'));
81                if (count($this->arrLogDetail) == 0) {
82                    SC_Utils_Ex::sfDispError('');
83                }
84                $this->tpl_mainpage = 'ownersstore/log_detail.tpl';
85                break;
86            default:
87                break;
88        }
89        $this->arrInstallLogs = $this->getLogs();
90    }
91
92    /**
93     * デストラクタ.
94     *
95     * @return void
96     */
97    function destroy()
98    {
99        parent::destroy();
100    }
101
102    function getLogs()
103    {
104        $sql =<<<END
105SELECT
106    *
107FROM
108    dtb_module_update_logs JOIN (
109    SELECT
110        module_id,
111        module_name
112    FROM
113        dtb_module
114    ) AS modules ON dtb_module_update_logs.module_id = modules.module_id
115ORDER BY update_date DESC
116END;
117        $objQuery =& SC_Query_Ex::getSingletonInstance();
118        $arrRet = $objQuery->getAll($sql);
119        return isset($arrRet) ? $arrRet : array();
120    }
121
122    function initParam()
123    {
124        $objForm = new SC_FormParam_Ex();
125        $objForm->addParam('log_id', 'log_id', INT_LEN, '', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
126        $objForm->setParam($_GET);
127        return $objForm;
128    }
129
130    function getLogDetail($log_id)
131    {
132            $sql =<<<END
133SELECT
134    *
135FROM
136    dtb_module_update_logs JOIN (
137    SELECT
138        module_id,
139        module_name
140    FROM
141        dtb_module
142    ) AS modules ON dtb_module_update_logs.module_id = modules.module_id
143WHERE
144    log_id = ?
145END;
146        $objQuery =& SC_Query_Ex::getSingletonInstance();
147        $arrRet = $objQuery->getAll($sql, array($log_id));
148        return isset($arrRet[0]) ? $arrRet[0] : array();
149    }
150}
Note: See TracBrowser for help on using the repository browser.