Browse Source

Bug position images tri manuel

12_dev
fredtempez 3 months ago
parent
commit
03796c6bd1
  1. 4
      module/gallery/gallery.php
  2. 4
      module/gallery/view/edit/edit.js.php
  3. 8
      module/gallery/view/option/option.php

4
module/gallery/gallery.php

@ -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([

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

8
module/gallery/view/option/option.php

@ -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,

Loading…
Cancel
Save