[9.2.22] Optimisation + choix tri pdt création galerie
This commit is contained in:
parent
9cfa9a4e3a
commit
26827bc531
@ -22,7 +22,7 @@ class gallery extends common {
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
public static $order = [
|
||||
public static $sort = [
|
||||
'asc' => 'Tri alphabétique naturel',
|
||||
'dsc' => 'Tri alphabétique naturel inverse',
|
||||
'none' => 'Aucun tri',
|
||||
@ -58,10 +58,10 @@ class gallery extends common {
|
||||
$gallery['config']['directory'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . ' (dossier introuvable)</span>';
|
||||
}
|
||||
// Met en forme le tableau
|
||||
self::$galleries[] = [
|
||||
self::$galleries[] = [
|
||||
$gallery['config']['name'],
|
||||
$gallery['config']['directory'],
|
||||
template::button('galleryConfigEdit' . $galleryId, [
|
||||
template::button('galleryConfigEdit' . $galleryId , [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $galleryId . '/' . $_SESSION['csrf'],
|
||||
'value' => template::ico('pencil')
|
||||
]),
|
||||
@ -79,7 +79,8 @@ class gallery extends common {
|
||||
$this->setData(['module', $this->getUrl(0), $galleryId, [
|
||||
'config' => [
|
||||
'name' => $this->getInput('galleryConfigName'),
|
||||
'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true)
|
||||
'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true),
|
||||
'sort' => $this->getInput('galleryConfigSort')
|
||||
],
|
||||
'legend' => []
|
||||
]]);
|
||||
@ -188,7 +189,7 @@ class gallery extends common {
|
||||
'name' => $this->getInput('galleryEditName', helper::FILTER_STRING_SHORT, true),
|
||||
'directory' => $this->getInput('galleryEditDirectory', helper::FILTER_STRING_SHORT, true),
|
||||
'homePicture' => $homePictures[$file],
|
||||
'order' => $this->getInput('galleryEditOrder')
|
||||
'sort' => $this->getInput('galleryEditSort')
|
||||
],
|
||||
'legend' => $legends
|
||||
]]);
|
||||
@ -219,7 +220,7 @@ class gallery extends common {
|
||||
}
|
||||
}
|
||||
// Tri des images par ordre alphabétique
|
||||
switch ($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'order'])) {
|
||||
switch ($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'sort'])) {
|
||||
case 'none':
|
||||
break;
|
||||
case 'dsc':
|
||||
@ -264,7 +265,7 @@ class gallery extends common {
|
||||
}
|
||||
}
|
||||
// Tri des images par ordre alphabétique
|
||||
switch ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'config', 'order'])) {
|
||||
switch ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'config', 'sort'])) {
|
||||
case 'none':
|
||||
break;
|
||||
case 'dsc':
|
||||
|
@ -35,11 +35,19 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('galleryConfigSort', $module::$sort, [
|
||||
'label' => 'Tri des images',
|
||||
'help' => 'Les images sont triées par nom de fichier grâce à la méthode naturelle qui donne de meilleurs résultats lorsque les images sont numérotées.'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($module::$galleries): ?>
|
||||
<?php echo template::table([4, 6, 1, 1], $module::$galleries, ['Nom', 'Dossier cible', '', '']); ?>
|
||||
<?php echo template::table([4, 6, 1, 1], $module::$galleries, ['Nom', 'Dossier cible', '', '']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucune galerie.'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -36,8 +36,8 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('galleryEditOrder', $module::$order, [
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'order']),
|
||||
<?php echo template::select('galleryEditSort', $module::$sort, [
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'sort']),
|
||||
'label' => 'Tri des images',
|
||||
'help' => 'Les images sont triées par nom de fichier grâce à la méthode naturelle qui donne de meilleurs résultats lorsque les images sont numérotées.'
|
||||
]); ?>
|
||||
|
Loading…
Reference in New Issue
Block a user