From 4f5f8a7102a7415edb466b3b8f17defd211d3078 Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Tue, 20 Dec 2011 17:17:57 +0000 Subject: [PATCH] // retrocompatibility fix : displayHeader and displayFooter --- classes/FrontController.php | 47 ++++++++++++++++++++++++++++++++++++- footer.php | 5 ++-- header.php | 5 ++-- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/classes/FrontController.php b/classes/FrontController.php index f4a8590d3..c86c9f5fc 100755 --- a/classes/FrontController.php +++ b/classes/FrontController.php @@ -386,6 +386,52 @@ class FrontControllerCore extends Controller )); } + /** + * @deprecated + */ + public function displayHeader($display = true) + { + // This method will be removed in 1.6 + Tools::displayAsDeprecated(); + $this->initHeader(); + $hook_header = Hook::exec('displayHeader'); + if ((Configuration::get('PS_CSS_THEME_CACHE') OR Configuration::get('PS_JS_THEME_CACHE')) AND is_writable(_PS_THEME_DIR_.'cache')) + { + // CSS compressor management + if (Configuration::get('PS_CSS_THEME_CACHE')) + $this->css_files = Media::cccCSS($this->css_files); + //JS compressor management + if (Configuration::get('PS_JS_THEME_CACHE')) + $this->js_files = Media::cccJs($this->js_files); + } + + $this->context->smarty->assign('css_files', $this->css_files); + $this->context->smarty->assign('js_files', array_unique($this->js_files)); + + $this->context->smarty->assign(array( + 'HOOK_HEADER' => $hook_header, + 'HOOK_TOP' => Hook::exec('displayTop'), + )); + + $this->display_header = $display; + $this->context->smarty->display(_PS_THEME_DIR_.'header.tpl'); + + } + + /** + * @deprecated + */ + public function displayFooter($display = true) + { + // This method will be removed in 1.6 + Tools::displayAsDeprecated(); + $this->context->smarty->assign(array( + 'HOOK_RIGHT_COLUMN' => Hook::exec('displayRightColumn', array('cart' => $this->context->cart)), + 'HOOK_FOOTER' => Hook::exec('footer'), + )); + $this->context->smarty->display(_PS_THEME_DIR_.'footer.tpl'); + } + public function initCursedPage() { return $this->displayMaintenancePage(); @@ -609,7 +655,6 @@ class FrontControllerCore extends Controller 'HOOK_FOOTER' => Hook::exec('footer'), )); - } public function getLiveEditFooter(){ diff --git a/footer.php b/footer.php index 78264e2ba..45cde2fc7 100644 --- a/footer.php +++ b/footer.php @@ -32,6 +32,5 @@ else $controller = new FrontController(); $controller->init(); } - -$controller->initFooter(); -Context::getContext()->smarty->display(_PS_THEME_DIR_.'footer.tpl'); \ No newline at end of file +Tools::displayFileAsDeprecated(); +$controller->displayFooter(); diff --git a/header.php b/header.php index 07a8c07b9..764989336 100644 --- a/header.php +++ b/header.php @@ -32,6 +32,5 @@ else $controller = new FrontController(); $controller->init(); } - -$controller->initHeader(); -Context::getContext()->smarty->display(_PS_THEME_DIR_.'header.tpl'); \ No newline at end of file +Tools::displayFileAsDeprecated(); +$controller->displayHeader();