From 737ba0736d31b7752db07f3488c70ed4c0a44b0c Mon Sep 17 00:00:00 2001 From: rGaillard Date: Fri, 28 Oct 2011 12:58:13 +0000 Subject: [PATCH] // Change display_header and display_footer behavior on BackOffice --- classes/AdminController.php | 6 ++---- classes/Controller.php | 14 +++++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/classes/AdminController.php b/classes/AdminController.php index f0caaf258..640f13744 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -816,7 +816,7 @@ class AdminControllerCore extends Controller $this->context->smarty->assign('display_header', $this->display_header); $this->context->smarty->assign('display_footer', $this->display_footer); $this->context->smarty->assign('meta_title', $this->meta_title); - + // Template override $tpl = $this->tpl_folder.'content.tpl'; $tpl_action = $this->tpl_folder.$this->display.'.tpl'; @@ -832,7 +832,6 @@ class AdminControllerCore extends Controller $page = $this->context->smarty->fetch($tpl); else $page = $this->context->smarty->fetch($this->template); - if ($this->content_only) echo $page; else @@ -1070,12 +1069,11 @@ class AdminControllerCore extends Controller return; $this->content .= $this->initForm(); } - else if ($this->display != 'view') + elseif ($this->display != 'view' && !$this->ajax) { $this->content .= $this->initList(); $this->content .= $this->initOptions(); } - $this->context->smarty->assign(array( 'table' => $this->table, 'current' => self::$currentIndex, diff --git a/classes/Controller.php b/classes/Controller.php index e6081558a..37dd75865 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -122,10 +122,18 @@ abstract class ControllerCore { $this->init(); - if ($this->checkAccess()) + // postProcess handles ajaxProcess + $this->postProcess(); + + if ($this->display_header || (isset($this->className) && $this->className)) { - if ($this->ajax && method_exists($this, 'ajaxPreprocess')) - $this->ajaxPreProcess(); + $this->setMedia(); + $this->initHeader(); + } + + $this->initContent(); + if ($this->display_footer || (isset($this->className) && $this->className)) + $this->initFooter(); // postProcess handles ajaxProcess $this->postProcess();