source: branches/feature-module-update/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php @ 16839

Revision 16839, 1.8 KB checked in by adachi, 15 years ago (diff)

認証処理修正

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php
Line 
1<?php
2require_once DATA_PATH . 'module/Services/Json.php';
3/**
4 * Enter description here...
5 *
6 */
7class LC_Upgrade_Helper_Json extends Services_JSON {
8    /** */
9    var $arrData = array(
10        'status'  => null,
11        'errcode' => null,
12        'msg'     => null,
13        'data'    => array()
14    );
15
16    /**
17     * Enter description here...
18     *
19     * @return SC_Upgrade_Helper_Json
20     */
21    function LC_Upgrade_Helper_Json() {
22        parent::Services_JSON();
23    }
24
25    /**
26     * Enter description here...
27     *
28     */
29    function isError() {
30        return $this->isSuccess() ? false : true;
31    }
32
33    function isSuccess() {
34        if ($this->arrData['status'] === OSTORE_STATUS_SUCCESS) {
35            return true;
36        }
37        return false;
38    }
39
40    /**
41     * Enter description here...
42     *
43     * @param unknown_type $errCode
44     * @param unknown_type $errMessage
45     */
46    function setError($errCode) {
47        $masterData = new SC_DB_MasterData();
48        $arrOStoreErrMsg = $masterData->getMasterData("mtb_ownersstore_err");
49
50        $this->arrData['status']  = OSTORE_STATUS_ERROR;
51        $this->arrData['errcode'] = $errCode;
52        $this->arrData['msg']  = isset($arrOStoreErrMsg[$errCode])
53            ? $arrOStoreErrMsg[$errCode]
54            : $arrOStoreErrMsg[OSTORE_E_UNKNOWN];
55    }
56
57    /**
58     * Enter description here...
59     *
60     * @param mixed $data
61     */
62    function setSuccess($data = array(), $msg = '') {
63        $this->arrData['status'] = OSTORE_STATUS_SUCCESS;
64        $this->arrData['data']   = $data;
65        $this->arrData['msg']    = $msg;
66    }
67
68    /**
69     * Enter description here...
70     *
71     */
72    function display() {
73        header("Content-Type: text/javascript; charset=UTF-8");
74        echo $this->encode($this->arrData);
75    }
76}
Note: See TracBrowser for help on using the repository browser.