[*] FO : Move header modules to new hook, first part 1/2

This commit is contained in:
gRoussac
2013-12-10 20:52:22 +01:00
parent 78df7f52f4
commit 1dcc5e288c
41 changed files with 306 additions and 311 deletions
+14 -5
View File
@@ -60,7 +60,7 @@ class HomeSlider extends Module
public function install()
{
/* Adds Module */
if (parent::install() && $this->registerHook('displayTopColumn') && $this->registerHook('actionShopDataDuplication'))
if (parent::install() && $this->registerHook('displayHeader') && $this->registerHook('displayTopColumn') && $this->registerHook('actionShopDataDuplication'))
{
/* Sets up configuration */
$res = Configuration::updateValue('HOMESLIDER_WIDTH', '779');
@@ -660,16 +660,25 @@ class HomeSlider extends Module
return true;
}
public function hookdisplayTopColumn()
public function hookdisplayHeader($params)
{
$this->context->controller->addJS($this->_path.'js/jquery.bxSlider.min.js');
$this->context->controller->addCSS($this->_path.'bx_styles.css');
$this->context->controller->addJS($this->_path.'js/homeslider.js');
}
public function hookdisplayTop($params)
{
return $this->hookdisplayTopColumn();
}
public function hookdisplayTopColumn($params)
{
if ($this->context->smarty->tpl_vars['page_name'] != 'index' || $this->context->getMobileDevice() != false)
return false;
if(!$this->_prepareHook())
return false;
$this->context->controller->addJS($this->_path.'js/jquery.bxSlider.min.js');
$this->context->controller->addCSS($this->_path.'bx_styles.css');
$this->context->controller->addJS($this->_path.'js/homeslider.js');
return $this->display(__FILE__, 'homeslider.tpl', $this->getCacheId());
}
+1 -1
View File
@@ -5,5 +5,5 @@ if (!defined('_PS_VERSION_'))
function upgrade_module_1_2_3($object)
{
return ($object->unregisterHook('displayHome') && $object->registerHook('displayTopColumn'));
return ($object->unregisterHook('displayHome') && $object->registerHook('displayHeader') && $object->registerHook('displayTopColumn'));
}