source: branches/version-2_12-dev/data/class/pages/error/LC_Page_Error.php @ 22567

Revision 22567, 7.5 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 //-*- coding: utf-8 -*-
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/LC_Page_Ex.php';
26
27/**
28 * エラー表示のページクラス
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id:LC_Page_Error.php 15532 2007-08-31 14:39:46Z nanasess $
33 */
34class LC_Page_Error extends LC_Page_Ex
35{
36
37    // {{{ properties
38
39    /** エラー種別 */
40    var $type;
41
42    /** SC_SiteSession インスタンス */
43    var $objSiteSess;
44
45    /** TOPへ戻るフラグ */
46    var $return_top = false;
47
48    /** エラーメッセージ */
49    var $err_msg = '';
50
51    /** モバイルサイトの場合 true */
52    var $is_mobile = false;
53
54    // }}}
55    // {{{ functions
56
57    /**
58     * Page を初期化する.
59     *
60     * DBエラー発生時, エラーページを表示しようした際の DB 接続を防ぐため,
61     * ここでは, parent::init() を行わない.
62     * @return void
63     */
64    function init()
65    {
66        $this->tpl_mainpage = 'error.tpl';
67        $this->tpl_title = 'エラー';
68        // ディスプレイクラス生成
69        $this->objDisplay = new SC_Display_Ex();
70
71        // transformでフックしているばあいに, 再度エラーが発生するため, コールバックを無効化.
72        $objHelperPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
73        $objHelperPlugin->arrRegistedPluginActions = array();
74
75        // キャッシュから店舗情報取得(DBへの接続は行わない)
76        $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisDataCache(false);
77    }
78
79    /**
80     * Page のプロセス.
81     *
82     * @return void
83     */
84    function process()
85    {
86        parent::process();
87        $this->action();
88        $this->sendResponse();
89    }
90
91    /**
92     * Page のプロセス。
93     *
94     * @return void
95     */
96    function action()
97    {
98
99        switch ($this->type) {
100            case PRODUCT_NOT_FOUND:
101                $this->tpl_error='ご指定のページはございません。';
102                SC_Response_Ex::sendHttpStatus(404);
103                break;
104            case PAGE_ERROR:
105                $this->tpl_error='不正なページ移動です。';
106                break;
107            case CART_EMPTY:
108                $this->tpl_error='カートに商品ががありません。';
109                break;
110            case CART_ADD_ERROR:
111                $this->tpl_error='購入処理中は、カートに商品を追加することはできません。';
112                break;
113            case CANCEL_PURCHASE:
114                $this->tpl_error='この手続きは無効となりました。以下の要因が考えられます。<br />・セッション情報の有効期限が切れてる場合<br />・購入手続き中に新しい購入手続きを実行した場合<br />・すでに購入手続きを完了している場合';
115                break;
116            case CATEGORY_NOT_FOUND:
117                $this->tpl_error='ご指定のカテゴリは存在しません。';
118                SC_Response_Ex::sendHttpStatus(404);
119                break;
120            case SITE_LOGIN_ERROR:
121                $this->tpl_error='メールアドレスもしくはパスワードが正しくありません。';
122                break;
123            case TEMP_LOGIN_ERROR:
124                $this->tpl_error='メールアドレスもしくはパスワードが正しくありません。<br />本登録がお済みでない場合は、仮登録メールに記載されている<br />URLより本登録を行ってください。';
125                break;
126            case CUSTOMER_ERROR:
127                $this->tpl_error='不正なアクセスです。';
128                break;
129            case SOLD_OUT:
130                $this->tpl_error='申し訳ございませんが、ご購入の直前で売り切れた商品があります。この手続きは無効となりました。';
131                break;
132            case CART_NOT_FOUND:
133                $this->tpl_error='申し訳ございませんが、カート内の商品情報の取得に失敗しました。この手続きは無効となりました。';
134                break;
135            case LACK_POINT:
136                $this->tpl_error='申し訳ございませんが、ポイントが不足しております。この手続きは無効となりました。';
137                break;
138            case FAVORITE_ERROR:
139                $this->tpl_error='既にお気に入りに追加されている商品です。';
140                break;
141            case EXTRACT_ERROR:
142                $this->tpl_error="ファイルの解凍に失敗しました。\n指定のディレクトリに書き込み権限が与えられていない可能性があります。";
143                break;
144            case FTP_DOWNLOAD_ERROR:
145                $this->tpl_error='ファイルのFTPダウンロードに失敗しました。';
146                break;
147            case FTP_LOGIN_ERROR:
148                $this->tpl_error='FTPログインに失敗しました。';
149                break;
150            case FTP_CONNECT_ERROR:
151                $this->tpl_error='FTPログインに失敗しました。';
152                break;
153            case CREATE_DB_ERROR:
154                $this->tpl_error="DBの作成に失敗しました。\n指定のユーザーには、DB作成の権限が与えられていない可能性があります。";
155                break;
156            case DB_IMPORT_ERROR:
157                $this->tpl_error="データベース構造のインポートに失敗しました。\nsqlファイルが壊れている可能性があります。";
158                break;
159            case FILE_NOT_FOUND:
160                $this->tpl_error='指定のパスに、設定ファイルが存在しません。';
161                break;
162            case WRITE_FILE_ERROR:
163                $this->tpl_error="設定ファイルに書き込めません。\n設定ファイルに書き込み権限を与えてください。";
164                break;
165            case DOWNFILE_NOT_FOUND:
166                $this->tpl_error='ダウンロードファイルが存在しません。<br />申し訳ございませんが、店舗までお問合わせ下さい。';
167                break;
168            case FREE_ERROR_MSG:
169                $this->tpl_error=$this->err_msg;
170                break;
171            default:
172                $this->tpl_error='エラーが発生しました。';
173                break;
174        }
175
176    }
177
178    /**
179     * デストラクタ.
180     *
181     * @return void
182     */
183    function destroy()
184    {
185        parent::destroy();
186    }
187
188    /**
189     * エラーページではトランザクショントークンの自動検証は行わない
190     */
191    function doValidToken()
192    {
193        // queit.
194    }
195}
Note: See TracBrowser for help on using the repository browser.