[-] Did not add CSS files to output, when hooked in hook "displayNav" instead "displayTop".

This commit is contained in:
Dimitrios Karvounaris
2015-02-06 21:55:50 +01:00
parent f75aa982a4
commit 2b2e42e901
+10 -6
View File
@@ -66,6 +66,7 @@ class Blocktopmenu extends Module
public function install($delete_params = true) public function install($delete_params = true)
{ {
if (!parent::install() || if (!parent::install() ||
!$this->registerHook('header') ||
!$this->registerHook('displayTop') || !$this->registerHook('displayTop') ||
!$this->registerHook('actionObjectCategoryUpdateAfter') || !$this->registerHook('actionObjectCategoryUpdateAfter') ||
!$this->registerHook('actionObjectCategoryDeleteAfter') || !$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) : ''); 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) public function hookDisplayTop($param)
{ {
$this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); $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->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()); $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId());
return $html; return $html;
} }