diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 338bfdb2..f54ffa38 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -357,7 +357,7 @@ class gallery extends common { } // Met en forme le tableau self::$galleries[] = [ - template::ico('sort'), + $gallery['config']['position'] + 1, $gallery['config']['name'], $gallery['config']['directory'], template::button('galleryConfigEdit' . $galleryId , [ @@ -584,7 +584,7 @@ class gallery extends common { ], 'legend' => $legends, - 'positions' => empty($oldPositions) ? $this->getdata(['module', $this->getUrl(0), 'content', $galleryId, 'positions']) : $oldPositions + 'positions' => empty($oldPositions) ? $this->getData(['module', $this->getUrl(0), 'content', $galleryId, 'positions']) : $oldPositions ]]); } // Valeurs en sortie @@ -598,7 +598,6 @@ class gallery extends common { $directory = $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'directory']); if(is_dir($directory)) { $iterator = new DirectoryIterator($directory); - foreach($iterator as $fileInfos) { if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { // Créer la miniature RFM si manquante @@ -608,7 +607,7 @@ class gallery extends common { 122); } self::$pictures[str_replace('.','',$fileInfos->getFilename())] = [ - template::ico('sort'), + $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'positions', str_replace('.','',$fileInfos->getFilename())]) + 1, $fileInfos->getFilename(), template::checkbox( 'homePicture[' . $fileInfos->getFilename() . ']', true, '', [ 'checked' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2),'config', 'homePicture']) === $fileInfos->getFilename() ? true : false, @@ -625,7 +624,7 @@ class gallery extends common { // Tri des images switch ($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort'])) { case self::SORT_HAND: - $positions = $this->getdata(['module',$this->getUrl(0), $this->getUrl(2),'positions']); + $positions = $this->getData(['module',$this->getUrl(0),'content', $this->getUrl(2),'positions']); if ($positions) { foreach ($positions as $key => $value) { if (array_key_exists($key,self::$pictures)) { diff --git a/module/gallery/view/config/config.js.php b/module/gallery/view/config/config.js.php index 95509907..31db6636 100644 --- a/module/gallery/view/config/config.js.php +++ b/module/gallery/view/config/config.js.php @@ -21,12 +21,8 @@ $( document ).ready(function() { $("#galleryTable").tableDnD({ onDrop: function(table, row) { $("#galleryConfigFilterResponse").val($.tableDnD.serialize()); - }, - onDragStop : function(table, row) { - // Affiche le bouton de tri après un déplacement - //$(":input[type='submit']").prop('disabled', false); - // Sauvegarde le tri sortGalleries(); + location.reload(); }, // Supprime le tiret des séparateurs serializeRegexp: "" diff --git a/module/gallery/view/config/config.php b/module/gallery/view/config/config.php index d80038c3..2d1a0a38 100644 --- a/module/gallery/view/config/config.php +++ b/module/gallery/view/config/config.php @@ -30,7 +30,7 @@
- 'galleryTable'],$module::$galleriesId); ?> + 'galleryTable'],$module::$galleriesId); ?> diff --git a/module/gallery/view/edit/edit.js.php b/module/gallery/view/edit/edit.js.php index b1de55bb..9b0eadb3 100644 --- a/module/gallery/view/edit/edit.js.php +++ b/module/gallery/view/edit/edit.js.php @@ -65,11 +65,7 @@ $( document ).ready(function() { $("#galleryTable").tableDnD({ onDrop: function(table, row) { $("#galleryEditFormResponse").val($.tableDnD.serialize()); - }, - onDragStop : function(table, row) { - // Sauvegarde le tri sortPictures(); - $("#galleryEditFormResponse").val(""); }, serializeRegexp: "" }); diff --git a/module/gallery/view/edit/edit.php b/module/gallery/view/edit/edit.php index 79cabdaa..117630b2 100644 --- a/module/gallery/view/edit/edit.php +++ b/module/gallery/view/edit/edit.php @@ -63,7 +63,7 @@
- 'galleryTable'], $module::$picturesId ); ?> + 'galleryTable'], $module::$picturesId ); ?> $this->getUrl(2)]); ?> diff --git a/module/gallery/view/option/option.php b/module/gallery/view/option/option.php index 50a647ea..8e0d45ca 100644 --- a/module/gallery/view/option/option.php +++ b/module/gallery/view/option/option.php @@ -1,13 +1,13 @@ - +
-
- + helper::baseUrl() . $this->getUrl(0) . '/config', 'value' => template::ico('left') ]); ?>
-
- +
+
@@ -16,7 +16,7 @@

Options

- count($this->getData(['module', $this->getUrl(0), 'content'])) === 1 ? $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) : false,