[*] FO : Move both sliders module on new hook
This commit is contained in:
1 parent
97937a8aa1
commit
99fe216413
15 files changed
+83
-87
No files matched your search
@@ -4,13 +4,11 @@
|
||||
* To change the color scheme of slider change each
|
||||
* background property for each of the five styles below
|
||||
*/
|
||||
|
||||
.bx-window {margin-bottom:20px;}
|
||||
.bx-wrapper {
|
||||
margin-bottom:20px;
|
||||
height:300px
|
||||
}
|
||||
|
||||
/*next button*/
|
||||
.bx-next {
|
||||
display:none;
|
||||
@@ -21,11 +19,9 @@
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-indent: -999999px;
|
||||
background: url(gray_next.png) no-repeat 0 -30px;
|
||||
background: url(../images/gray_next.png) no-repeat 0 -30px;
|
||||
}
|
||||
|
||||
/*previous button*/
|
||||
|
||||
.bx-prev {
|
||||
display:none;
|
||||
position:absolute;
|
||||
@@ -35,9 +31,8 @@
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-indent: -999999px;
|
||||
background: url(gray_prev.png) no-repeat 0 -30px;
|
||||
background: url(../images/gray_prev.png) no-repeat 0 -30px;
|
||||
}
|
||||
|
||||
/*pager links*/
|
||||
.bx-pager {
|
||||
position: absolute;
|
||||
@@ -60,20 +55,17 @@
|
||||
font-size: 11px;
|
||||
color:#000;
|
||||
text-decoration:none;
|
||||
background:url(gray_pager.png) no-repeat 0 -20px;
|
||||
background:url(../images/gray_pager.png) no-repeat 0 -20px;
|
||||
}
|
||||
|
||||
/*
|
||||
* End color scheme styles
|
||||
*/
|
||||
|
||||
|
||||
/*next/prev button hover state*/
|
||||
.bx-next:hover,
|
||||
.bx-prev:hover {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
/*pager links hover and active states*/
|
||||
.bx-pager .pager-active,
|
||||
.bx-pager a:hover {
|
||||
@@ -81,7 +73,6 @@
|
||||
text-decoration:none;
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
/*captions*/
|
||||
.bx-captions {
|
||||
text-align:center;
|
||||
@@ -89,14 +80,12 @@
|
||||
padding: 7px 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/*auto controls*/
|
||||
.bx-auto {
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.bx-auto a {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>homeslider</name>
|
||||
<displayName><![CDATA[Image slider for your homepage.]]></displayName>
|
||||
<version><![CDATA[1.2.2]]></version>
|
||||
<version><![CDATA[1.2.3]]></version>
|
||||
<description><![CDATA[Adds an image slider to your homepage.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
* @version 1.2 (2012-03-14)
|
||||
* @version 1.3 (2012-03-14)
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
@@ -42,7 +42,7 @@ class HomeSlider extends Module
|
||||
{
|
||||
$this->name = 'homeslider';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.2.2';
|
||||
$this->version = '1.2.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
$this->secure_key = Tools::encrypt($this->name);
|
||||
@@ -60,7 +60,7 @@ class HomeSlider extends Module
|
||||
public function install()
|
||||
{
|
||||
/* Adds Module */
|
||||
if (parent::install() && $this->registerHook('displayTop') && $this->registerHook('actionShopDataDuplication'))
|
||||
if (parent::install() && $this->registerHook('displayTopColumn') && $this->registerHook('actionShopDataDuplication'))
|
||||
{
|
||||
/* Sets up configuration */
|
||||
$res = Configuration::updateValue('HOMESLIDER_WIDTH', '779');
|
||||
@@ -660,18 +660,17 @@ class HomeSlider extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookDisplayTop()
|
||||
public function hookdisplayTopColumn()
|
||||
{
|
||||
if(!$this->_prepareHook())
|
||||
return;
|
||||
|
||||
// Check if not a mobile theme
|
||||
if ($this->context->getMobileDevice() != false)
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
@@ -23,34 +23,37 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if $page_name =='index'}
|
||||
<!-- Module HomeSlider -->
|
||||
{if isset($homeslider_slides)}
|
||||
<div id="homepage-slider">
|
||||
<ul id="homeslider">
|
||||
{foreach from=$homeslider_slides item=slide}
|
||||
{if $slide.active}
|
||||
<li>
|
||||
<a href="{$slide.url|escape:'html':'UTF-8'}" title="{$slide.description|escape:'html':'UTF-8'}">
|
||||
<img src="{$smarty.const._MODULE_DIR_}homeslider/images/{$slide.image|escape:'html':'UTF-8'}" alt="{$slide.legend|escape:'html':'UTF-8'}" />
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{if isset($homeslider)}
|
||||
<script type="text/javascript">
|
||||
{if isset($homeslider_slides) && $homeslider_slides|@count > 1}
|
||||
{if $homeslider.loop == 1}
|
||||
var homeslider_loop = true;
|
||||
{else}
|
||||
var homeslider_loop = false;
|
||||
{/if}
|
||||
{if $homeslider_slides|@count > 1}
|
||||
{if $homeslider.loop == 1}
|
||||
var homeslider_loop = true;
|
||||
{else}
|
||||
var homeslider_loop = false;
|
||||
{/if}
|
||||
var homeslider_speed = {$homeslider.speed};
|
||||
var homeslider_pause = {$homeslider.pause};
|
||||
{else}
|
||||
var homeslider_loop = false;
|
||||
{/if}
|
||||
var homeslider_speed = {$homeslider.speed};
|
||||
var homeslider_pause = {$homeslider.pause};
|
||||
</script>
|
||||
{/if}
|
||||
{if isset($homeslider_slides)}
|
||||
<ul id="homeslider">
|
||||
{foreach from=$homeslider_slides item=slide}
|
||||
{if $slide.active}
|
||||
<li>
|
||||
<a href="{$slide.url|escape:'html':'UTF-8'}" title="{$slide.description|escape:'html':'UTF-8'}">
|
||||
<img src="{$smarty.const._MODULE_DIR_}homeslider/images/{$slide.image|escape:'html':'UTF-8'}" alt="{$slide.legend|escape:'html':'UTF-8'}" height="{$homeslider.height|intval}" width="{$homeslider.width|intval}" />
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
<!-- /Module HomeSlider -->
|
||||
{/if}
|
||||
Executable → Regular
File renamed without changes.
Executable → Regular
File renamed without changes.
Executable → Regular
File renamed without changes.
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_2_3($object)
|
||||
{
|
||||
return ($object->unregisterHook('displayHome') && $object->registerHook('displayTopColumn'));
|
||||
}
|
||||
Reference in new issue
Block a user