From a296e0192c398294d36ce26f75bdf5a55e7fc292 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Fri, 28 Oct 2011 13:06:44 +0000 Subject: [PATCH] // revert AdminController git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9712 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Controller.php | 56 ++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/classes/Controller.php b/classes/Controller.php index 37dd75865..95545ed1c 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -122,42 +122,44 @@ abstract class ControllerCore { $this->init(); - // postProcess handles ajaxProcess - $this->postProcess(); - - if ($this->display_header || (isset($this->className) && $this->className)) + if ($this->checkAccess()) { - $this->setMedia(); - $this->initHeader(); - } - - $this->initContent(); - if ($this->display_footer || (isset($this->className) && $this->className)) - $this->initFooter(); - - // postProcess handles ajaxProcess + // postProcess handles ajaxProcess $this->postProcess(); - - if ($this->display_header) + + if ($this->display_header || (isset($this->className) && $this->className)) { $this->setMedia(); $this->initHeader(); } - + $this->initContent(); - if ($this->display_footer) + if ($this->display_footer || (isset($this->className) && $this->className)) $this->initFooter(); + + // postProcess handles ajaxProcess + $this->postProcess(); + + if ($this->display_header) + { + $this->setMedia(); + $this->initHeader(); + } + + $this->initContent(); + if ($this->display_footer) + $this->initFooter(); - // default behavior for ajax process is to use $_POST[action] or $_GET[action] - // then using displayAjax[action] - if ($this->ajax) - { - $action = Tools::getValue('action'); - if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action))) - $this->{'displayAjax'.$action}(); - elseif (method_exists($this, 'displayAjax')) - $this->displayAjax(); - } + // default behavior for ajax process is to use $_POST[action] or $_GET[action] + // then using displayAjax[action] + if ($this->ajax) + { + $action = Tools::getValue('action'); + if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action))) + $this->{'displayAjax'.$action}(); + elseif (method_exists($this, 'displayAjax')) + $this->displayAjax(); + } } else $this->initCursedPage();