diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index fa0c8c39..c14cf493 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -42,6 +42,8 @@ class gallery extends common { public static $thumbs = []; + public static $config = []; + public static $actions = [ 'config' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR, @@ -602,7 +604,6 @@ class gallery extends common { // Mise à jour des données de module $this->update(); - // Une seule galerie, bifurquer sur celle-ci $gallery = count($this->getData(['module', $this->getUrl(0), 'content'])) === 1 ? array_key_first($this->getData(['module', $this->getUrl(0), 'content'])) @@ -621,6 +622,10 @@ class gallery extends common { else { // Images de la galerie $directory = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'directory']); + // Définir les options + self::$config['homePicture'] = $this->getData(['module',$this->getUrl(0),'content', $gallery,'config','homePicture']); + self::$config['fullScreen'] = $this->getData(['module',$this->getUrl(0),'content', $gallery,'config','fullScreen']) === true ? 'fullScreen' : ''; + self::$config['mono'] = count($this->getData(['module', $this->getUrl(0), 'content'])) === 1; if(is_dir($directory)) { $iterator = new DirectoryIterator($directory); foreach($iterator as $fileInfos) { @@ -637,6 +642,7 @@ class gallery extends common { self::$thumbs[$directory . '/' . $fileInfos->getFilename()] = file_exists( str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename())) ? str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()) : str_replace('source','thumb',$directory) . '/' . strtolower($fileInfos->getFilename()); + } } // Tri des images par ordre alphabétique diff --git a/module/gallery/view/gallery/gallery.js.php b/module/gallery/view/gallery/gallery.js.php index 17bf31bc..41ffccb0 100644 --- a/module/gallery/view/gallery/gallery.js.php +++ b/module/gallery/view/gallery/gallery.js.php @@ -24,9 +24,8 @@ var b = new SimpleLightbox('.galleryGalleryPicture', { }); $( document ).ready(function() { - // Démarre en mode plein écran - var fullscreen = getData(['module', $this->getUrl(0), $this->getUrl(1), 'config', 'fullScreen'])); ?>; - if ( fullscreen === true) { + // Démarre en mode plein écran + if ( $("#pictureContainer").hasClass("fullScreen") ) { $('a#homePicture')[0].click(); } }); diff --git a/module/gallery/view/gallery/gallery.php b/module/gallery/view/gallery/gallery.php index 99ee3de8..a2a99c26 100644 --- a/module/gallery/view/gallery/gallery.php +++ b/module/gallery/view/gallery/gallery.php @@ -1,4 +1,5 @@ -getData(['module', $this->getUrl(0), 'content'])) !== 1): ?> + +
-
+