[*] MO : updated module homeslider for mobile theme

This commit is contained in:
mBertholino
2012-02-28 09:11:27 +00:00
parent 398140cf17
commit 3ac2f335bf
2 changed files with 59 additions and 2 deletions
+44
View File
@@ -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 <contact@prestashop.com>
* @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
*}
<!-- Module HomeSlider -->
{if isset($homeslider)}
<script type="text/javascript">
var homeslider_loop = true;
var homeslider_speed = {$homeslider.speed};
var homeslider_pause = {$homeslider.pause};
</script>
{/if}
{if isset($homeslider_slides)}
<div id="slider">
{foreach from=$homeslider_slides item=slide}
{if $slide.active}
<img src="{$smarty.const._MODULE_DIR_}/homeslider/images/{$slide.image}" alt="{$slide.legend}" title="{$slide.description}" height="{$homeslider.height}" width="100%">
{/if}
{/foreach}
</div>
{/if}
<!-- /Module HomeSlider -->
+15 -2
View File
@@ -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)