| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * This file is part of EC-CUBE |
|---|
| 4 | * |
|---|
| 5 | * Copyright(c) 2000-2010 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 | /* キャンペーン管理クラス |
|---|
| 25 | * |
|---|
| 26 | * @deprecated キャンペーン機能は廃止のため使用しない. |
|---|
| 27 | * このクラスに依存している実装を改修後, このクラスを削除する. |
|---|
| 28 | */ |
|---|
| 29 | class SC_CampaignSession { |
|---|
| 30 | var $key; |
|---|
| 31 | var $campaign_id = 'campaign_id'; |
|---|
| 32 | var $is_campaign = 'is_campaign'; |
|---|
| 33 | var $campaign_dir = 'campaign_dir'; |
|---|
| 34 | |
|---|
| 35 | /* コンストラクタ */ |
|---|
| 36 | function SC_CampaignSession($key = "campaign") { |
|---|
| 37 | SC_Utils_Ex::sfDomainSessionStart(); |
|---|
| 38 | $this->key = $key; |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | /* キャンペーンIDをセット */ |
|---|
| 42 | function setCampaignId($campaign_id) { |
|---|
| 43 | $_SESSION[$this->key][$this->campaign_id] = $campaign_id; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | /* キャンペーンIDを取得 */ |
|---|
| 47 | function getCampaignId() { |
|---|
| 48 | return $_SESSION[$this->key][$this->campaign_id]; |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | /* キャンペーンページからの遷移情報を保持 */ |
|---|
| 52 | function setIsCampaign() { |
|---|
| 53 | $_SESSION[$this->key][$this->is_campaign] = true; |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | /* キャンペーンページからの遷移情報を取得 */ |
|---|
| 57 | function getIsCampaign() { |
|---|
| 58 | return isset($_SESSION[$this->key][$this->is_campaign]) ? $_SESSION[$this->key][$this->is_campaign] : false; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | /* キャンペーン情報を削除 */ |
|---|
| 62 | function delCampaign() { |
|---|
| 63 | unset($_SESSION[$this->key]); |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | /* キャンペーンディレクトリ名をセット */ |
|---|
| 67 | function setCampaignDir($campaign_dir) { |
|---|
| 68 | $_SESSION[$this->key][$this->campaign_dir] = $campaign_dir; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | /* キャンペーンディレクトリ名を取得 */ |
|---|
| 72 | function getCampaignDir() { |
|---|
| 73 | return isset($_SESSION[$this->key][$this->campaign_dir]) |
|---|
| 74 | ? $_SESSION[$this->key][$this->campaign_dir] : ""; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | /* キャンペーンページならフレームを変更 */ |
|---|
| 78 | function pageView($objView, $site_frame = SITE_FRAME) { |
|---|
| 79 | // XXX キャンペーン削除で不具合があったので、応急処置をしています。(テスト不十分) |
|---|
| 80 | if ($this->getIsCampaign()) { |
|---|
| 81 | $site_frame_campaign = CAMPAIGN_TEMPLATE_PATH . $this->getCampaignDir() . "/active/site_frame.tpl"; |
|---|
| 82 | if (file_exists($site_frame_campaign)) { |
|---|
| 83 | $site_frame = $site_frame_campaign; |
|---|
| 84 | } |
|---|
| 85 | } |
|---|
| 86 | $objView->display($site_frame); |
|---|
| 87 | } |
|---|
| 88 | } |
|---|
| 89 | ?> |
|---|