[*] FO : New hooks for home tabs

This commit is contained in:
gRoussac
2013-10-16 11:44:55 +02:00
parent 2e65214c39
commit 62aaf16d60
22 changed files with 156 additions and 229 deletions
+10 -3
View File
@@ -33,7 +33,7 @@ class BlockNewProducts extends Module
{
$this->name = 'blocknewproducts';
$this->tab = 'front_office_features';
$this->version = '1.4';
$this->version = '1.5';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -46,12 +46,13 @@ class BlockNewProducts extends Module
public function install()
{
if (!parent::install()
|| !$this->registerHook('rightColumn')
|| !$this->registerHook('header')
|| !$this->registerHook('addproduct')
|| !$this->registerHook('updateproduct')
|| !$this->registerHook('deleteproduct')
|| !Configuration::updateValue('NEW_PRODUCTS_NBR', 5)
|| !$this->registerHook('displayHomeTab')
|| !$this->registerHook('displayHomeTabContent')
)
return false;
$this->_clearCache('blocknewproducts.tpl');
@@ -61,6 +62,7 @@ class BlockNewProducts extends Module
public function uninstall()
{
$this->_clearCache('blocknewproducts.tpl');
$this->_clearCache('tab.tpl');
return parent::uninstall();
}
@@ -110,8 +112,13 @@ class BlockNewProducts extends Module
{
return $this->hookRightColumn($params);
}
public function hookdisplayHomeTab($params)
{
return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blocknewproducts-tab'));
}
public function hookHome($params)
public function hookdisplayHomeTabContent($params)
{
return $this->hookRightColumn($params);
}
+25
View File
@@ -0,0 +1,25 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<li class="active"><a class="blocknewproducts">{l s='New arrivals' mod='blocknewproducts'}</a></li>
@@ -0,0 +1,9 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_5($object)
{
return ($object->unregisterHook('rightColumn') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
}