[*] 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user