From 193843ae1407d9cc4b100471e0574a45ed010005 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 8 Apr 2020 21:10:13 +0200 Subject: [PATCH] =?UTF-8?q?Cosm=C3=A9tique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/gallery/gallery.php | 51 +++++++++++------------- module/gallery/view/config/config.js.php | 2 +- module/gallery/view/config/config.php | 39 +++++++++--------- module/gallery/view/edit/edit.php | 6 +-- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index a2794f03..499ac383 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -44,31 +44,6 @@ class gallery extends common { const GALLERY_VERSION = '2.1'; - /** - * Tri des galeries - */ - private function sortGallery() { - // Traitement du tri - $data = explode('&',($this->getInput('galleryConfigFilterResponse'))); - $data = str_replace('galleryTable%5B%5D=','',$data); - for($i=0;$isetData(['module', $this->getUrl(0), $data[$i], [ - 'config' => [ - 'name' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','name']), - 'directory' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','directory']), - 'homePicture' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','homePicture']), - 'sort' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','sort']), - 'position' => $i - ], - 'legend' => $this->getData(['module',$this->getUrl(0),$data[$i],'legend']) - ]]); - } - $this->saveData(); - // Valeurs en sortie - // Recharge la page - header('Refresh: 0;url='. helper::baseUrl() . $this->getUrl() ); - } - /** * Configuration @@ -115,10 +90,32 @@ class gallery extends common { } } // Soumission du formulaire - if($this->isPost()) { + // Tri de la galerie if ($this->getInput('galleryConfigFilterResponse')) { - self::sortGallery(); + $data = explode('&',($this->getInput('galleryConfigFilterResponse'))); + $data = str_replace('galleryTable%5B%5D=','',$data); + for($i=0;$isetData(['module', $this->getUrl(0), $data[$i], [ + 'config' => [ + 'name' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','name']), + 'directory' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','directory']), + 'homePicture' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','homePicture']), + 'sort' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','sort']), + 'position' => $i + ], + 'legend' => $this->getData(['module',$this->getUrl(0),$data[$i],'legend']) + ]]); + } + $this->saveData(); + // Valeurs en sortie + $this->addOutput([ + 'title' => 'Configuration du module', + 'view' => 'config', + 'vendor' => [ + 'tablednd' + ] + ]); } else { $galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)])); // La première image est celle de la couverture de l'album diff --git a/module/gallery/view/config/config.js.php b/module/gallery/view/config/config.js.php index d40ad1ec..c79e46ce 100644 --- a/module/gallery/view/config/config.js.php +++ b/module/gallery/view/config/config.js.php @@ -26,7 +26,7 @@ $( document ).ready(function() { // Activer le bouton de tri uniquement après un tri $("#galleryTable").click(function() { - if ($("#galleryEditFilterResponse").val() != "") { + if ($("#galleryConfigFilterResponse").val() != "") { $(":input[type='submit']").prop('disabled', false); } }); diff --git a/module/gallery/view/config/config.php b/module/gallery/view/config/config.php index c83da42f..6e54e111 100644 --- a/module/gallery/view/config/config.php +++ b/module/gallery/view/config/config.php @@ -12,7 +12,7 @@
-

Nouvelle galerie

+

Ajouter une galerie

- - 'galleryTable'],$module::$galleriesId); ?> - - false - ]); ?> - - -
-
- 'Trier', - 'disabled' => true - ]); ?> +
+
+

Galeries installées

+
+ true + ]); ?> +
+ + 'galleryTable'],$module::$galleriesId); ?> + + false + ]); ?> + + + +
+
Version n° +
-
Version n° - -
\ No newline at end of file diff --git a/module/gallery/view/edit/edit.php b/module/gallery/view/edit/edit.php index af1c842e..19a2c156 100644 --- a/module/gallery/view/edit/edit.php +++ b/module/gallery/view/edit/edit.php @@ -54,8 +54,8 @@ +
Version n° + +
-
Version n° - -