Skip to content

Commit

Permalink
[+] Paramétrage de l'utilisation (oui/non) de la version de jquery in…
Browse files Browse the repository at this point in the history
…tégrée au plugin

[+] Ajout des balises alt pour les images
BUG Mauvais appel de jquery (contribution Jerry Wham)
  • Loading branch information
Stephane committed Oct 4, 2013
1 parent d6020c6 commit b3c5106
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 26 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Version 1.2 (04/10/2013) ##
[+] Paramétrage de l'utilisation (oui/non) de la version de jquery intégrée au plugin
[+] Ajout des balises alt pour les images
BUG Mauvais appel de jquery (contribution Jerry Wham)

## Version 1.1.2 (25/06/2013) ##
[+] Test et chargement de jQuery si nécessaire
[+] Chargement des librairies javascript en fin de page plutot que dans la partie <head> du site
Expand Down
5 changes: 4 additions & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
plxToken::validateFormToken($_POST);

if(!empty($_POST)) {
$plxPlugin->setParam('jquery', $_POST['jquery'], 'numeric');
$plxPlugin->setParam('width', $_POST['width'], 'numeric');
$plxPlugin->setParam('height', $_POST['height'], 'numeric');
$plxPlugin->setParam('spw', $_POST['spw'], 'numeric');
Expand All @@ -22,6 +23,7 @@
exit;
}
$parms = array();
$parms['jquery'] = $plxPlugin->getParam('jquery')!='' ? $plxPlugin->getParam('jquery') : true;
$parms['width'] = $plxPlugin->getParam('width')!='' ? $plxPlugin->getParam('width') : '500';
$parms['height'] = $plxPlugin->getParam('height')!='' ? $plxPlugin->getParam('height') : '300';
$parms['spw'] = $plxPlugin->getParam('spw')!='' ? $plxPlugin->getParam('spw') : '7';
Expand All @@ -34,13 +36,14 @@
$parms['navigation'] = $plxPlugin->getParam('navigation')!='' ? $plxPlugin->getParam('navigation') : true;
$parms['links'] = $plxPlugin->getParam('links')!='' ? $plxPlugin->getParam('links') : false;
$parms['hoverPause'] = $plxPlugin->getParam('hoverPause')!='' ? $plxPlugin->getParam('hoverPause') : true;

?>

<h2><?php echo $plxPlugin->getInfo('title') ?></h2>

<form action="parametres_plugin.php?p=plxMyCoinSlider" method="post" id="form_plxMyCoinSlider">
<fieldset>
<p class="field"><label for="id_jquery"><?php $plxPlugin->lang('L_JQUERY') ?></label></p>
<?php plxUtils::printSelect('jquery',array('1'=>$plxPlugin->getLang('L_YES'),'0'=>$plxPlugin->getLang('L_NO')),$parms['jquery']) ?>
<p class="field"><label for="id_width"><?php $plxPlugin->lang('L_WIDTH') ?></label></p>
<?php plxUtils::printInput('width',$parms['width'],'text','4-4') ?>
<p class="field"><label for="id_height"><?php $plxPlugin->lang('L_HEIGHT') ?></label></p>
Expand Down
4 changes: 2 additions & 2 deletions infos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<document>
<title><![CDATA[MyCoinSlider]]></title>
<author><![CDATA[Stephane F.]]></author>
<version>1.1.2</version>
<date>25/06/2013</date>
<version>1.2</version>
<date>04/10/2013</date>
<site>http://pluxopolis.net</site>
<description><![CDATA[Image slider with unique effects]]></description>
<requirements></requirements>
Expand Down
4 changes: 2 additions & 2 deletions lang/en-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
- ajouter les lignes suivantes à l'endroit où vous souhaitez afficher le diaporama

<div style="color:#000;padding:0 10px 15px 10px;border:1px solid #dedede">
<?php
<?php
echo plxUtils::strCheck('
<?php
global $plxShow;
eval($plxShow->callHook("MyCoinSlider"));
eval($plxShow->callHook("MyCoinSlider"));
?>
');
?>
Expand Down
2 changes: 1 addition & 1 deletion lang/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'L_DELETE' => 'Remove from slideshow',

# config.php

'L_JQUERY' => 'Load jQuery library?',
'L_DATAPATH' => 'Images data path folder',
'L_ALIGNMENT' => 'Slideshow alignment',
'L_MARGINS' => 'Margins (ex:10px 10px 10px 10px)',
Expand Down
4 changes: 2 additions & 2 deletions lang/fr-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
- ajouter les lignes suivantes à l'endroit où vous souhaitez afficher le diaporama

<div style="color:#000;padding:0 10px 15px 10px;border:1px solid #dedede">
<?php
<?php
echo plxUtils::strCheck('
<?php
global $plxShow;
eval($plxShow->callHook("MyCoinSlider"));
eval($plxShow->callHook("MyCoinSlider"));
?>
');
?>
Expand Down
1 change: 1 addition & 0 deletions lang/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'L_DELETE' => 'Supprimer du diaporama',

# config.php
'L_JQUERY' => 'Utiliser la librairie jQuery du plugin ?',
'L_WIDTH' => 'Largeur du diaporama',
'L_HEIGHT' => 'Hauteur du diaporama',
'L_SPW' => 'Nombre de carrés par largeur (ex:7)',
Expand Down
Empty file.
Binary file not shown.
Binary file not shown.
39 changes: 21 additions & 18 deletions plxMyCoinSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class plxMyCoinSlider extends plxPlugin {

public function __construct($default_lang) {

# appel du constructeur de la classe plxPlugin (obligatoire)
parent::__construct($default_lang);
# appel du constructeur de la classe plxPlugin (obligatoire)
parent::__construct($default_lang);

# droits pour accèder à la page config.php et admin.php du plugin
$this->setConfigProfil(PROFIL_ADMIN);
Expand All @@ -25,14 +25,14 @@ public function __construct($default_lang) {
$this->coinslider = new coinslider();
$this->coinslider->getSlides();

# déclaration des hooks
# déclaration des hooks
if($this->coinslider->aSlides) {
$this->addHook('ThemeEndHead', 'ThemeEndHead');
$this->addHook('ThemeEndBody', 'ThemeEndBody');
$this->addHook('MyCoinSlider', 'MyCoinSlider');
}

}
}

public function AdminMediasTop() {

Expand Down Expand Up @@ -60,25 +60,23 @@ public function MyCoinSlider() {
foreach($this->coinslider->aSlides as $slide) {
if($slide['active']) {
$onclick = $slide['onclick']!='' ? $slide['onclick'] : $slide['url'];
echo '<a href="'.plxUtils::strCheck($onclick).'"><img src="'.plxUtils::strCheck($slide['url']).'" title="'.plxUtils::strCheck($slide['title']).'" /><span>'.strip_tags($slide['description'], '<strong><b><em><br>')."</span></a>\n";
echo '<a href="'.plxUtils::strCheck($onclick).'"><img alt="" src="'.plxUtils::strCheck($slide['url']).'" title="'.plxUtils::strCheck($slide['title']).'" /><span>'.strip_tags($slide['description'], '<strong><b><em><br>')."</span></a>\n";
}
}
echo "</div>\n";
}
}

public function ThemeEndHead() {
echo "\t".'<link rel="stylesheet" type="text/css" href="'.PLX_PLUGINS.'plxMyCoinSlider/coin-slider/coin-slider-styles.css" media="screen" />'."\n";
echo "\t".'
<style type="text/css">
.coin-slider { width: '.$this->getParam('width').'px !important }
</style>
';
echo '<link rel="stylesheet" type="text/css" href="'.PLX_PLUGINS.'plxMyCoinSlider/coin-slider/coin-slider-styles.css" media="screen" />';
echo '
<style type="text/css">
.coin-slider { width: '.$this->getParam('width').'px !important }
</style>'."\n";
}

public function ThemeEndBody() {

echo "\t".'<script type="text/javascript" src="'.PLX_PLUGINS.'plxMyCoinSlider/coin-slider/coin-slider.min.js"></script>'."\n";
$keys = array('width','height','spw','sph','delay','sDelay','opacity','titleSpeed','effect','navigation','links','hoverPause');
$parms = $this->getParams();
$array= array();
Expand All @@ -93,18 +91,23 @@ public function ThemeEndBody() {
}
}
$string = $array ? implode(',',$array) : '';
?>

if($this->getParam('jquery')) {
echo "\n".'
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script type="text\/javascript" src="<?php echo PLX_PLUGINS ?>plxMyCoinSlider\/coin-slider\/jquery.min.js"><\/script>');
if (typeof jQuery == "undefined") {
document.write(\'<script type="text\/javascript" src="'.PLX_PLUGINS.'plxMyCoinSlider\/coin-slider\/jquery.min.js"><\/script>\');
}
</script>';
}
echo '
<script type="text/javascript" src="'.PLX_PLUGINS.'plxMyCoinSlider/coin-slider/coin-slider.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider({<?php echo $string ?>});
$("#coin-slider").coinslider({'.$string.'});
});
</script>

<?php
';
}
}
?>

0 comments on commit b3c5106

Please sign in to comment.