From 2b2e42e90191319916c0894d2378967f9ca71c7a Mon Sep 17 00:00:00 2001 From: Dimitrios Karvounaris Date: Fri, 6 Feb 2015 21:55:50 +0100 Subject: [PATCH 1/4] [-] Did not add CSS files to output, when hooked in hook "displayNav" instead "displayTop". --- blocktopmenu.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/blocktopmenu.php b/blocktopmenu.php index aff0de3..ae7986c 100644 --- a/blocktopmenu.php +++ b/blocktopmenu.php @@ -66,6 +66,7 @@ class Blocktopmenu extends Module public function install($delete_params = true) { if (!parent::install() || + !$this->registerHook('header') || !$this->registerHook('displayTop') || !$this->registerHook('actionObjectCategoryUpdateAfter') || !$this->registerHook('actionObjectCategoryDeleteAfter') || @@ -712,6 +713,15 @@ class Blocktopmenu extends Module return parent::getCacheId().'|'.$page_name.($page_name != 'index' ? '|'.(int)Tools::getValue('id_'.$page_name) : ''); } + public function hookHeader() + { + $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); + $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); + $this->context->controller->addJS($this->_path.'js/blocktopmenu.js'); + $this->context->controller->addCSS($this->_path.'css/blocktopmenu.css'); + $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); + } + public function hookDisplayTop($param) { $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); @@ -729,12 +739,6 @@ class Blocktopmenu extends Module $this->smarty->assign('this_path', $this->_path); } - $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); - $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); - $this->context->controller->addJS($this->_path.'js/blocktopmenu.js'); - $this->context->controller->addCSS($this->_path.'css/blocktopmenu.css'); - $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); - $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId()); return $html; } From d66ce82bda63de88aa20c7dc6170caf1b6726d94 Mon Sep 17 00:00:00 2001 From: Dimitrios Karvounaris Date: Sun, 15 Mar 2015 15:23:15 +0100 Subject: [PATCH 2/4] Upgrade file for 2.1.1 --- upgrade/install | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 upgrade/install diff --git a/upgrade/install b/upgrade/install new file mode 100644 index 0000000..4cc8462 --- /dev/null +++ b/upgrade/install @@ -0,0 +1,32 @@ + +* @copyright 2007-2014 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_2_1_1($object) +{ + return ($object->registerHook('header')); +} From b5141212b4acbca6746198d31a19a2d3227117c3 Mon Sep 17 00:00:00 2001 From: Dimitrios Karvounaris Date: Sun, 15 Mar 2015 15:23:25 +0100 Subject: [PATCH 3/4] Delete install --- upgrade/install | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 upgrade/install diff --git a/upgrade/install b/upgrade/install deleted file mode 100644 index 4cc8462..0000000 --- a/upgrade/install +++ /dev/null @@ -1,32 +0,0 @@ - -* @copyright 2007-2014 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ -if (!defined('_PS_VERSION_')) - exit; - -function upgrade_module_2_1_1($object) -{ - return ($object->registerHook('header')); -} From 663c05f1e1fde9559f6aa608eab136eaded113f7 Mon Sep 17 00:00:00 2001 From: Dimitrios Karvounaris Date: Sun, 15 Mar 2015 15:23:45 +0100 Subject: [PATCH 4/4] Upgrade file for 2.1.1 --- upgrade/install-2.1.1.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 upgrade/install-2.1.1.php diff --git a/upgrade/install-2.1.1.php b/upgrade/install-2.1.1.php new file mode 100644 index 0000000..4cc8462 --- /dev/null +++ b/upgrade/install-2.1.1.php @@ -0,0 +1,32 @@ + +* @copyright 2007-2014 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_2_1_1($object) +{ + return ($object->registerHook('header')); +}