Bug position images tri manuel

This commit is contained in:
fredtempez 2022-04-01 14:14:36 +02:00
parent 0ec7a8dc4e
commit 03796c6bd1
3 changed files with 6 additions and 10 deletions

View File

@ -610,7 +610,7 @@ class gallery extends common {
// Tri des images // Tri des images
switch ($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort'])) { switch ($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort'])) {
case self::SORT_HAND: 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) { if ($positions) {
foreach ($positions as $key => $value) { foreach ($positions as $key => $value) {
if (array_key_exists($key,self::$pictures)) { if (array_key_exists($key,self::$pictures)) {
@ -887,7 +887,7 @@ class gallery extends common {
mkdir (self::DATADIRECTORY . $this->getUrl(0), 0755, true); mkdir (self::DATADIRECTORY . $this->getUrl(0), 0755, true);
} }
$this->setData(['module', $this->getUrl(0), 'config', [ $this->setData(['module', $this->getUrl(0), 'config', [
'showUniqueGallery' => $this->getinput('galleryOptionShowUniqueGallery', helper::FILTER_BOOLEAN) 'showUniqueGallery' => $this->getinput('galleriesOptionShowUniqueGallery', helper::FILTER_BOOLEAN)
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -65,11 +65,7 @@ $( document ).ready(function() {
$("#galleryTable").tableDnD({ $("#galleryTable").tableDnD({
onDrop: function(table, row) { onDrop: function(table, row) {
$("#galleryEditFormResponse").val($.tableDnD.serialize()); $("#galleryEditFormResponse").val($.tableDnD.serialize());
},
onDragStop : function(table, row) {
// Sauvegarde le tri
sortPictures(); sortPictures();
$("#galleryEditFormResponse").val("");
}, },
serializeRegexp: "" serializeRegexp: ""
}); });

View File

@ -1,14 +1,14 @@
<?php echo template::formOpen('galleryOptionForm'); ?> <?php echo template::formOpen('galleriesOptionForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('galleryOptionBack', [ <?php echo template::button('galleriesOptionBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'ico' => 'left',
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo template::submit('galleryOptionSubmit'); ?> <?php echo template::submit('galleriesOptionSubmit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -17,7 +17,7 @@
<h4>Galerie unique</h4> <h4>Galerie unique</h4>
<div class="row"> <div class="row">
<div class="col12 verticalAlignBottom"> <div class="col12 verticalAlignBottom">
<?php echo template::checkbox('galleryOptionShowUniqueGallery', true, 'Masquer l\'index des galeries lorsque le module ne contient qu\'une galerie' , [ <?php echo template::checkbox('galleriesOptionShowUniqueGallery', true, 'Masquer l\'index des galeries lorsque le module ne contient qu\'une galerie' , [
'checked' => count($this->getData(['module', $this->getUrl(0), 'content'])) === 1 'checked' => count($this->getData(['module', $this->getUrl(0), 'content'])) === 1
? $this->getData(['module', $this->getUrl(0), 'theme', 'showUniqueGallery']) ? $this->getData(['module', $this->getUrl(0), 'theme', 'showUniqueGallery'])
: false, : false,