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
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)) {
@ -887,7 +887,7 @@ class gallery extends common {
mkdir (self::DATADIRECTORY . $this->getUrl(0), 0755, true);
}
$this->setData(['module', $this->getUrl(0), 'config', [
'showUniqueGallery' => $this->getinput('galleryOptionShowUniqueGallery', helper::FILTER_BOOLEAN)
'showUniqueGallery' => $this->getinput('galleriesOptionShowUniqueGallery', helper::FILTER_BOOLEAN)
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -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: ""
});

View File

@ -1,14 +1,14 @@
<?php echo template::formOpen('galleryOptionForm'); ?>
<?php echo template::formOpen('galleriesOptionForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('galleryOptionBack', [
<?php echo template::button('galleriesOptionBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('galleryOptionSubmit'); ?>
<?php echo template::submit('galleriesOptionSubmit'); ?>
</div>
</div>
<div class="row">
@ -17,7 +17,7 @@
<h4>Galerie unique</h4>
<div class="row">
<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
? $this->getData(['module', $this->getUrl(0), 'theme', 'showUniqueGallery'])
: false,