Slider 6.4
This commit is contained in:
parent
3884573de9
commit
97a782eb4d
@ -1,3 +1,7 @@
|
||||
# Version 6.4
|
||||
- Corrige plussieurs bugs dans les fonctions de tri
|
||||
# Version 6.3
|
||||
- Corrige un tri non fonctionnel.
|
||||
# Version 6.2
|
||||
- Applique les profils
|
||||
# Version 6.1
|
||||
|
@ -27,7 +27,7 @@ class slider extends common
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
const VERSION = '6.2';
|
||||
const VERSION = '6.4';
|
||||
const REALNAME = 'Carrousel';
|
||||
const DELETE = true;
|
||||
const UPDATE = '0.0';
|
||||
@ -237,12 +237,12 @@ class slider extends common
|
||||
}
|
||||
}
|
||||
// Tri des images pour affichage de la liste dans la page d'édition
|
||||
switch ($this->getData(['module', $this->getUrl(0), 'theme', 'tri'])) {
|
||||
switch ($this->getData(['module', $this->getUrl(0), 'theme', 'sort'])) {
|
||||
case 'dsc':
|
||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
case 'asc':
|
||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
case 'rand':
|
||||
case 'none':
|
||||
@ -385,16 +385,31 @@ class slider extends common
|
||||
}
|
||||
|
||||
// Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas
|
||||
switch ($this->getData(['module', $galleryId, 'config', 'tri'])) {
|
||||
case 'SORT_DSC':
|
||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
switch ($this->getData(['module', $galleryId, 'theme', 'sort'])) {
|
||||
case 'desc':
|
||||
uksort(self::$pictures, function ($a, $b) {
|
||||
return strcmp(basename($a), basename($b));
|
||||
});
|
||||
break;
|
||||
case 'SORT_ASC':
|
||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
case 'asc':
|
||||
uksort(self::$pictures, function ($a, $b) {
|
||||
return strcmp(basename($b), basename($a));
|
||||
});
|
||||
break;
|
||||
case 'RAND':
|
||||
case 'rand':
|
||||
// Récupérer les clés du tableau
|
||||
$keys = array_keys(self::$pictures);
|
||||
// Mélanger les clés
|
||||
shuffle($keys);
|
||||
// Créer un nouveau tableau avec les clés mélangées
|
||||
$shuffledPictures = [];
|
||||
foreach ($keys as $key) {
|
||||
$shuffledPictures[$key] = self::$pictures[$key];
|
||||
}
|
||||
// Mettre à jour le tableau initial avec le nouveau tableau mélangé
|
||||
self::$pictures = $shuffledPictures;
|
||||
break;
|
||||
case 'NONE':
|
||||
case 'none':
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -445,7 +460,7 @@ class slider extends common
|
||||
'speed' => 1000,
|
||||
'timeout' => 3000,
|
||||
'namespace' => 'centered-btns',
|
||||
'tri' => 'RAND',
|
||||
'sort' => 'RAND',
|
||||
],
|
||||
'directory' => null,
|
||||
'legends' => [],
|
||||
|
Loading…
Reference in New Issue
Block a user