source: branches/feature-module-update/data/class/SC_CampaignSession.php @ 16741

Revision 16741, 2.7 KB checked in by adachi, 15 years ago (diff)

set eol-style:LF

  • 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-2007 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/* キャンペーン管理クラス */
25class SC_CampaignSession {
26    var $key;
27    var $campaign_id = 'campaign_id';
28    var $is_campaign = 'is_campaign';
29    var $campaign_dir = 'campaign_dir';
30
31    /* コンストラクタ */
32    function SC_CampaignSession($key = "campaign") {
33        SC_Utils_Ex::sfDomainSessionStart();
34        $this->key = $key;
35    }
36
37    /* キャンペーンIDをセット */
38    function setCampaignId($campaign_id) {
39        $_SESSION[$this->key][$this->campaign_id] = $campaign_id;
40    }
41
42    /* キャンペーンIDを取得 */
43    function getCampaignId() {
44        return $_SESSION[$this->key][$this->campaign_id];
45    }
46
47    /* キャンペーンページからの遷移情報を保持 */
48    function setIsCampaign() {
49        $_SESSION[$this->key][$this->is_campaign] = true;
50    }
51
52    /* キャンペーンページからの遷移情報を取得 */
53    function getIsCampaign() {
54        return isset($_SESSION[$this->key][$this->is_campaign]) ? $_SESSION[$this->key][$this->is_campaign] : false;
55    }
56
57    /* キャンペーン情報を削除 */
58    function delCampaign() {
59        unset($_SESSION[$this->key]);
60    }
61
62    /* キャンペーンディレクトリ名をセット */
63    function setCampaignDir($campaign_dir) {
64        $_SESSION[$this->key][$this->campaign_dir] = $campaign_dir;
65    }
66
67    /* キャンペーンディレクトリ名を取得 */
68    function getCampaignDir() {
69        return isset($_SESSION[$this->key][$this->campaign_dir])
70                ? $_SESSION[$this->key][$this->campaign_dir] : "";
71    }
72
73    /* キャンペーンページならフレームを変更 */
74    function pageView($objView, $site_frame = SITE_FRAME) {
75        if($this->getIsCampaign()) {
76            $objView->display(CAMPAIGN_TEMPLATE_PATH . $this->getCampaignDir()  . "/active/site_frame.tpl");
77        } else {
78            $objView->display($site_frame);
79        }
80    }
81}
82?>
Note: See TracBrowser for help on using the repository browser.