From d8cbb2bafca7708bbc430aa09c1a3d978e5ef212 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Wed, 10 Aug 2011 13:11:56 +0000 Subject: [PATCH] // changes to header and footer --- classes/FrontController.php | 7 +------ footer.php | 7 ++++++- header.php | 6 +++++- modules/favoriteproducts/favoriteproducts-account.php | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/classes/FrontController.php b/classes/FrontController.php index 15cdd4f2e..fcb06aadb 100755 --- a/classes/FrontController.php +++ b/classes/FrontController.php @@ -505,10 +505,8 @@ class FrontControllerCore $this->init(); // if this function is called from a module, do a fast init else if (!$this->context) - { $this->context = Context::getContext(); - $this->setMedia(); - } + // P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies) header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); @@ -551,10 +549,7 @@ class FrontControllerCore $this->init(); // if this function is called from a module, do a fast init else if (!$this->context) - { $this->context = Context::getContext(); - $this->setMedia(); - } $this->context->smarty->assign(array( 'HOOK_RIGHT_COLUMN' => Module::hookExec('rightColumn', array('cart' => $this->context->cart)), diff --git a/footer.php b/footer.php index 144e132f7..1de6f6c64 100644 --- a/footer.php +++ b/footer.php @@ -24,5 +24,10 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -$controller = new FrontController(); + +if (isset(Context::getContext()->controller)) + $controller = Context::getContext()->controller; +else + $controller = new FrontController(); + $controller->displayFooter(); diff --git a/header.php b/header.php index cdca642c1..160e00204 100644 --- a/header.php +++ b/header.php @@ -25,6 +25,10 @@ * International Registered Trademark & Property of PrestaShop SA */ -$controller = new FrontController(); +if (isset(Context::getContext()->controller)) + $controller = Context::getContext()->controller; +else + $controller = new FrontController(); + $controller->displayHeader(); diff --git a/modules/favoriteproducts/favoriteproducts-account.php b/modules/favoriteproducts/favoriteproducts-account.php index e6a32e5ff..297d13a76 100644 --- a/modules/favoriteproducts/favoriteproducts-account.php +++ b/modules/favoriteproducts/favoriteproducts-account.php @@ -38,9 +38,9 @@ if (!Context::getContext()->cookie->isLogged()) include(dirname(__FILE__).'/../../header.php'); -if ((int)Context::getContext()->cookie->id_customer) +if ((int)Context::getContext()->customer->id) { - $smarty->assign('favoriteProducts', FavoriteProduct::getFavoriteProducts((int)Context::getContext()->cookie->id_customer, (int)Context::getContext()->cookie->id_lang)); + $smarty->assign('favoriteProducts', FavoriteProduct::getFavoriteProducts((int)Context::getContext()->customer->id, (int)Context::getContext()->language->id)); echo Module::display(dirname(__FILE__).'/favoriteproducts.php', 'favoriteproducts-account.tpl'); }