diff --git a/modules/homeslider/homemobileslider.tpl b/modules/homeslider/homemobileslider.tpl new file mode 100644 index 000000000..cc9f946a1 --- /dev/null +++ b/modules/homeslider/homemobileslider.tpl @@ -0,0 +1,44 @@ +{* +* 2007-2012 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 +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 13573 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +{if isset($homeslider)} + +{/if} +{if isset($homeslider_slides)} +
+ {foreach from=$homeslider_slides item=slide} + {if $slide.active} + {$slide.legend} + {/if} + {/foreach} +
+{/if} + diff --git a/modules/homeslider/homeslider.php b/modules/homeslider/homeslider.php index b3d120ef3..5c16ca39c 100644 --- a/modules/homeslider/homeslider.php +++ b/modules/homeslider/homeslider.php @@ -610,7 +610,7 @@ class HomeSlider extends Module $this->_html .= $this->displayConfirmation($this->l('Slide added')); } - public function hookHome() + private function _prepareHook() { $slider = array( 'width' => Configuration::get('HOMESLIDER_WIDTH'), @@ -621,11 +621,17 @@ class HomeSlider extends Module $slides = $this->getSlides(true); if (!$slides) - return; + return false; $this->smarty->assign('homeslider_slides', $slides); $this->smarty->assign('homeslider', $slider); + return true; + } + public function hookHome() + { + if(!$this->_prepareHook()) + return; return $this->display(__FILE__, 'homeslider.tpl'); } @@ -639,6 +645,13 @@ class HomeSlider extends Module $this->context->controller->addJS($this->_path.'js/homeslider.js'); } + public function hookDisplayMobileIndex() + { + if(!$this->_prepareHook()) + return; + return $this->display(__FILE__, 'homemobileslider.tpl'); + } + public function headerHTML() { if (Tools::getValue('controller') != 'AdminModules' && Tools::getValue('configure') != $this->name)