From b505d785caedae668cbda2ed189be19940c58b2b Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 12 Aug 2013 12:51:21 +0200 Subject: [PATCH] remove context from the request --- core/lib/Thelia/Core/Context.php | 10 ++++++++++ core/lib/Thelia/Core/HttpFoundation/Request.php | 13 ------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/core/lib/Thelia/Core/Context.php b/core/lib/Thelia/Core/Context.php index aceb000a9..4d8e39bca 100644 --- a/core/lib/Thelia/Core/Context.php +++ b/core/lib/Thelia/Core/Context.php @@ -28,4 +28,14 @@ class Context { const CONTEXT_FRONT_OFFICE = 'front'; const CONTEXT_BACK_OFFICE = 'admin'; + + protected $defineContext = array( + self::CONTEXT_BACK_OFFICE, + self::CONTEXT_FRONT_OFFICE + ); + + public function isValidContext($context) + { + return in_array($context, $this->defineContext); + } } \ No newline at end of file diff --git a/core/lib/Thelia/Core/HttpFoundation/Request.php b/core/lib/Thelia/Core/HttpFoundation/Request.php index 8c17d99f9..7621fa65d 100755 --- a/core/lib/Thelia/Core/HttpFoundation/Request.php +++ b/core/lib/Thelia/Core/HttpFoundation/Request.php @@ -28,8 +28,6 @@ use Thelia\Core\Context; class Request extends BaseRequest { - protected $context = Context::CONTEXT_FRONT_OFFICE; - public function getProductId() { return $this->get("product_id"); @@ -50,15 +48,4 @@ class Request extends BaseRequest } return $uri . $additionalQs; } - - public function setContext($context) - { - $this->context = $context; - } - - public function getContext() - { - return $this->context; - } - } \ No newline at end of file