[*] FO : Move header modules to new hook, last part 2/2
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block stores module -->
|
||||
<div id="banner_block_top">
|
||||
<div class="banner-top">
|
||||
@@ -37,4 +36,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block stores module -->
|
||||
<!-- /Block stores module -->
|
||||
@@ -33,9 +33,9 @@ class Blockcontact extends Module
|
||||
{
|
||||
$this->name = 'blockcontact';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.0';
|
||||
$this->version = '1.1';
|
||||
|
||||
$this->bootstrap = true;
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Contact Block');
|
||||
@@ -47,7 +47,7 @@ class Blockcontact extends Module
|
||||
return parent::install()
|
||||
&& Configuration::updateValue('blockcontact_telnumber', '')
|
||||
&& Configuration::updateValue('blockcontact_email', '')
|
||||
&& $this->registerHook('displayRightColumn')
|
||||
&& $this->registerHook('displayNav')
|
||||
&& $this->registerHook('displayHeader');
|
||||
}
|
||||
|
||||
@@ -74,12 +74,12 @@ class Blockcontact extends Module
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function hookDisplayHeader()
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockcontact.css', 'all');
|
||||
}
|
||||
|
||||
public function hookDisplayRightColumn()
|
||||
public function hookDisplayRightColumn($params)
|
||||
{
|
||||
global $smarty;
|
||||
if (!$this->isCached('blockcontact.tpl', $this->getCacheId()))
|
||||
@@ -90,9 +90,15 @@ class Blockcontact extends Module
|
||||
return $this->display(__FILE__, 'blockcontact.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookDisplayLeftColumn()
|
||||
public function hookDisplayLeftColumn($params)
|
||||
{
|
||||
return $this->hookDisplayRightColumn();
|
||||
return $this->hookDisplayRightColumn($params);
|
||||
}
|
||||
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
|
||||
return $this->hookDisplayRightColumn($params);
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>blockcontact</name>
|
||||
<displayName><![CDATA[Contact Block]]></displayName>
|
||||
<version><![CDATA[1.0]]></version>
|
||||
<version><![CDATA[1.1]]></version>
|
||||
<description><![CDATA[Allows you to add additional information about your store's customer service.]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_1($object)
|
||||
{
|
||||
return ($object->unregisterHook('displayRightColumn') && $object->registerHook('displayNav'));
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class BlockCurrencies extends Module
|
||||
{
|
||||
$this->name = 'blockcurrencies';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = 0.1;
|
||||
$this->version = 0.2;
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
@@ -45,7 +45,7 @@ class BlockCurrencies extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() && $this->registerHook('top') && $this->registerHook('header');
|
||||
return parent::install() && $this->registerHook('displayNav') && $this->registerHook('displayHeader');
|
||||
}
|
||||
|
||||
private function _prepareHook($params)
|
||||
@@ -67,13 +67,18 @@ class BlockCurrencies extends Module
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookTop($params)
|
||||
public function hookDisplayTop($params)
|
||||
{
|
||||
if ($this->_prepareHook($params))
|
||||
return $this->display(__FILE__, 'blockcurrencies.tpl');
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
return $this->hookDisplayTop($params);
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcurrencies</name>
|
||||
<displayName><![CDATA[Currency block]]></displayName>
|
||||
<version><![CDATA[0.1]]></version>
|
||||
<description><![CDATA[Adds a block allowing customers to choose their preferred shopping currency.]]></description>
|
||||
<displayName><![CDATA[Bloc devises]]></displayName>
|
||||
<version><![CDATA[0.2]]></version>
|
||||
<description><![CDATA[Ajoute un bloc permettant au client de choisir sa devise]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_0_2($object)
|
||||
{
|
||||
return ($object->unregisterHook('top') && $object->registerHook('displayNav'));
|
||||
}
|
||||
@@ -33,19 +33,19 @@ class BlockLanguages extends Module
|
||||
{
|
||||
$this->name = 'blocklanguages';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = 1.1;
|
||||
$this->version = 1.2;
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Language block');
|
||||
$this->description = $this->l('Adds a block allowing customers to select a website language. ');
|
||||
$this->description = $this->l('Adds a block allowing customers to select a website language.');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() && $this->registerHook('top') && $this->registerHook('header'));
|
||||
return (parent::install() && $this->registerHook('displayNav') && $this->registerHook('displayHeader'));
|
||||
}
|
||||
|
||||
private function _prepareHook($params)
|
||||
@@ -94,14 +94,20 @@ class BlockLanguages extends Module
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookTop($params)
|
||||
public function hookDisplayTop($params)
|
||||
{
|
||||
if (!$this->_prepareHook($params))
|
||||
return;
|
||||
return $this->display(__FILE__, 'blocklanguages.tpl');
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
|
||||
return $this->hookDisplayTop($params);
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'blocklanguages.css', 'all');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>blocklanguages</name>
|
||||
<displayName><![CDATA[Language block]]></displayName>
|
||||
<version><![CDATA[1.1]]></version>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<description><![CDATA[Adds a block allowing customers to select a website language. ]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_2($object)
|
||||
{
|
||||
return ($object->unregisterHook('top') && $object->registerHook('displayNav'));
|
||||
}
|
||||
Reference in New Issue
Block a user