[*] All : new method Controller::redirect and property $controller->redirect_after

// and added postprocess return value

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10182 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2011-11-16 16:25:00 +00:00
parent 5fe5558dbe
commit 4e159bf6b6
3 changed files with 57 additions and 23 deletions
+10
View File
@@ -70,6 +70,7 @@ abstract class ControllerCore
*/
protected $ajax = false;
protected $redirect_after = null;
/**
* check that the controller is available for the current user/visitor
*/
@@ -90,6 +91,11 @@ abstract class ControllerCore
*/
abstract public function display();
/**
* Redirect after process if no error
*/
abstract protected function redirect();
/**
* Set default media list for controller
*/
@@ -131,6 +137,10 @@ abstract class ControllerCore
{
// postProcess handles ajaxProcess
$this->postProcess();
if (!empty($this->redirect_after))
$this->redirect();
if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
{
$this->setMedia();