// Updated homeslider module : added loop configuration
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
* @version 1.1 (2011-11-23)
|
||||
* @version 1.2 (2012-03-14)
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
@@ -43,7 +43,7 @@ class HomeSlider extends Module
|
||||
{
|
||||
$this->name = 'homeslider';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1';
|
||||
$this->version = '1.2';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
$this->secure_key = Tools::encrypt($this->name);
|
||||
@@ -67,6 +67,7 @@ class HomeSlider extends Module
|
||||
$res &= Configuration::updateValue('HOMESLIDER_HEIGHT', '300');
|
||||
$res &= Configuration::updateValue('HOMESLIDER_SPEED', '1300');
|
||||
$res &= Configuration::updateValue('HOMESLIDER_PAUSE', '7700');
|
||||
$res &= Configuration::updateValue('HOMESLIDER_LOOP', '1');
|
||||
/* Creates tables */
|
||||
$res &= $this->createTables();
|
||||
|
||||
@@ -117,6 +118,7 @@ class HomeSlider extends Module
|
||||
$res &= Configuration::deleteByName('HOMESLIDER_HEIGHT');
|
||||
$res &= Configuration::deleteByName('HOMESLIDER_SPEED');
|
||||
$res &= Configuration::deleteByName('HOMESLIDER_PAUSE');
|
||||
$res &= Configuration::deleteByName('HOMESLIDER_LOOP');
|
||||
return $res;
|
||||
}
|
||||
return false;
|
||||
@@ -236,6 +238,17 @@ class HomeSlider extends Module
|
||||
<div class="margin-form">
|
||||
<input type="text" name="HOMESLIDER_PAUSE" id="pause" size="3" value="'.Configuration::get('HOMESLIDER_PAUSE').'" /> ms
|
||||
</div>';
|
||||
/* Loop field */
|
||||
$this->_html .= '
|
||||
<label for="loop_on">'.$this->l('Loop:').'</label>
|
||||
<div class="margin-form">
|
||||
<img src="../img/admin/enabled.gif" alt="Yes" title="Yes" />
|
||||
<input type="radio" name="HOMESLIDER_LOOP" id="loop_on" '.(Configuration::get('HOMESLIDER_LOOP') == 1 ? 'checked="checked"' : '').' value="1" />
|
||||
<label class="t" for="loop_on">'.$this->l('Yes').'</label>
|
||||
<img src="../img/admin/disabled.gif" alt="No" title="No" style="margin-left: 10px;" />
|
||||
<input type="radio" name="HOMESLIDER_LOOP" id="loop_off" '.(Configuration::get('HOMESLIDER_LOOP') == 0 ? 'checked="checked" ' : '').' value="0" />
|
||||
<label class="t" for="loop_off">'.$this->l('No').'</label>
|
||||
</div>';
|
||||
/* Save */
|
||||
$this->_html .= '
|
||||
<div class="margin-form">
|
||||
@@ -505,6 +518,7 @@ class HomeSlider extends Module
|
||||
$res &= Configuration::updateValue('HOMESLIDER_HEIGHT', (int)Tools::getValue('HOMESLIDER_HEIGHT'));
|
||||
$res &= Configuration::updateValue('HOMESLIDER_SPEED', (int)Tools::getValue('HOMESLIDER_SPEED'));
|
||||
$res &= Configuration::updateValue('HOMESLIDER_PAUSE', (int)Tools::getValue('HOMESLIDER_PAUSE'));
|
||||
$res &= Configuration::updateValue('HOMESLIDER_LOOP', (int)Tools::getValue('HOMESLIDER_LOOP'));
|
||||
if (!$res)
|
||||
$errors .= $this->displayError($this->l('Configuration could not be updated'));
|
||||
$this->_html .= $this->displayConfirmation($this->l('Configuration updated'));
|
||||
@@ -616,7 +630,8 @@ class HomeSlider extends Module
|
||||
'width' => Configuration::get('HOMESLIDER_WIDTH'),
|
||||
'height' => Configuration::get('HOMESLIDER_HEIGHT'),
|
||||
'speed' => Configuration::get('HOMESLIDER_SPEED'),
|
||||
'pause' => Configuration::get('HOMESLIDER_PAUSE')
|
||||
'pause' => Configuration::get('HOMESLIDER_PAUSE'),
|
||||
'loop' => Configuration::get('HOMESLIDER_LOOP'),
|
||||
);
|
||||
|
||||
$slides = $this->getSlides(true);
|
||||
|
||||
@@ -27,7 +27,15 @@
|
||||
<!-- Module HomeSlider -->
|
||||
{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}
|
||||
{else}
|
||||
var homeslider_loop = false;
|
||||
{/if}
|
||||
var homeslider_speed = {$homeslider.speed};
|
||||
var homeslider_pause = {$homeslider.pause};
|
||||
</script>
|
||||
|
||||
@@ -32,11 +32,11 @@ $(function(){
|
||||
var homeslider_pause = 6000;
|
||||
|
||||
$('#homeslider').bxSlider({
|
||||
infiniteLoop: true,
|
||||
infiniteLoop: homeslider_loop,
|
||||
hideControlOnEnd: true,
|
||||
pager: true,
|
||||
autoHover: true,
|
||||
auto: true,
|
||||
auto: homeslider_loop,
|
||||
speed: homeslider_speed,
|
||||
pause: homeslider_pause
|
||||
});
|
||||
|
||||
@@ -9,6 +9,9 @@ $_MODULE['<{homeslider}prestashop>homeslider_e933dc24fb245d863a43b4fefe9b45f5']
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_48ccf48dcf2218a413ce473262f21a0c'] = 'Largeur :';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_2c526c645bca9542ba1598835d46b753'] = 'Vitesse :';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_154e6bcf4e3b49a424323cb9021ef851'] = 'Pause :';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_9ce04a5715756f9c0fece348db9b7da1'] = 'Boucle : ';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_571988492824e57070d78e6c86333f20'] = 'Configuration d\'une diapositive';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_02023fc24279454047fd419ecd1db9af'] = 'Ajouter une diapositive';
|
||||
@@ -25,8 +28,6 @@ $_MODULE['<{homeslider}prestashop>homeslider_3b3d06023f6353f8fd05f859b298573e']
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_8046c95f98fc714db47978092bb24264'] = 'Légende :';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_d0042a700e9bdf79689d63ee6846dc0e'] = 'Description :';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3d091e856cb7615d1ccb96bc759b5a92'] = 'Active :';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_70397c4b252a5168c5ec003931cea215'] = 'Champs requis';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3f80dc2cdd06939d4f5514362067cd86'] = 'Valeur non valables';
|
||||
|
||||
Reference in New Issue
Block a user