From 02c7319035600157f74ce3a2d53c577360d09fa5 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 24 Mar 2022 10:09:41 +0100 Subject: [PATCH] bugs divers --- module/gallery/gallery.php | 26 ++++++++++++++------------ module/gallery/view/edit/edit.js.php | 5 +++-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 3377c90a..5f10ca43 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -263,7 +263,7 @@ class gallery extends common { * */ public function sortGalleries() { - if($_POST['response']) { + if( isset($_POST['response']) ){ $data = explode('&',$_POST['response']); $data = str_replace('galleryTable%5B%5D=','',$data); for($i=0;$i $this->getData(['module',$this->getUrl(0), 'content', $data[$i],'config','homePicture']), 'sort' => $this->getData(['module',$this->getUrl(0), 'content', $data[$i],'config','sort']), 'position'=> $i, - 'fullScreen' => $this->getData(['module',$this->getUrl(0), 'content',$data[$i],'config','fullScreen']) + 'fullScreen' => $this->getData(['module',$this->getUrl(0), 'content',$data[$i],'config','fullScreen']), + 'showPageContent' => $this->getData(['module',$this->getUrl(0), 'content',$data[$i],'config','showPageContent']) ], 'legend' => $this->getData(['module',$this->getUrl(0), 'content', $data[$i],'legend']), @@ -289,22 +290,22 @@ class gallery extends common { * */ public function sortPictures() { - if($_POST['response']) { + if( isset($_POST['response']) ) { $galleryName = $_POST['gallery']; $data = explode('&',$_POST['response']); $data = str_replace('galleryTable%5B%5D=','',$data); // Sauvegarder $this->setData(['module', $this->getUrl(0), 'content', $galleryName, [ 'config' => [ - 'name' => $this->getData(['module',$this->getUrl(0),$galleryName,'config','name']), - 'directory' => $this->getData(['module',$this->getUrl(0),$galleryName,'config','directory']), - 'homePicture' => $this->getData(['module',$this->getUrl(0),$galleryName,'config','homePicture']), - 'sort' => $this->getData(['module',$this->getUrl(0),$galleryName,'config','sort']), - 'position' => $this->getData(['module',$this->getUrl(0),$galleryName,'config','position']), - 'fullScreen' => $this->getData(['module',$this->getUrl(0),$galleryName,'config','fullScreen']) + 'name' => $this->getData(['module',$this->getUrl(0), 'content', $galleryName,'config','name']), + 'directory' => $this->getData(['module',$this->getUrl(0),'content',$galleryName,'config','directory']), + 'homePicture' => $this->getData(['module',$this->getUrl(0),'content',$galleryName,'config','homePicture']), + 'sort' => $this->getData(['module',$this->getUrl(0),'content',$galleryName,'config','sort']), + 'position' => $this->getData(['module',$this->getUrl(0),'content',$galleryName,'config','position']), + 'fullScreen' => $this->getData(['module',$this->getUrl(0),'content',$galleryName,'config','fullScreen']) ], - 'legend' => $this->getData(['module',$this->getUrl(0),$galleryName,'legend']), + 'legend' => $this->getData(['module',$this->getUrl(0), 'content', $galleryName,'legend']), 'positions' => array_flip($data) ]]); } @@ -385,8 +386,9 @@ class gallery extends common { 'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true), 'homePicture' => $homePicture, 'sort' => self::SORT_ASC, - 'position' => $this->getData(['module', $this->getUrl(0), 'content', $galleryId,'config','position']), - 'fullScreen' => false + 'position' => count($this->getData(['module', $this->getUrl(0), 'content'])) + 1, + 'fullScreen' => false, + 'showPageContent' => false ], 'legend' => [], 'positions' => [] diff --git a/module/gallery/view/edit/edit.js.php b/module/gallery/view/edit/edit.js.php index 57505950..b1de55bb 100644 --- a/module/gallery/view/edit/edit.js.php +++ b/module/gallery/view/edit/edit.js.php @@ -103,7 +103,7 @@ $("#galleryEditSort").change(function() { */ function sortPictures() { - var url = "getUrl(0); ?>/sortPictures"; + var url = "getUrl(0); ?>/sortPictures"; var d1 = $("#galleryEditFormResponse").val(); var d2 = $("#galleryEditFormGalleryName").val(); $.ajax({ @@ -112,10 +112,11 @@ function sortPictures() { data: { response : d1, gallery: d2 - }, + },/* error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } + */ }); }