2.14 Option d'ouverture automatique des images

This commit is contained in:
Fred Tempez 2020-04-16 22:34:59 +02:00
parent 349e859c08
commit 48d3edac4f
3 changed files with 32 additions and 6 deletions

View File

@ -8,6 +8,8 @@
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.com/
*/
@ -47,7 +49,7 @@ class gallery extends common {
public static $thumbs = [];
const GALLERY_VERSION = '2.13';
const GALLERY_VERSION = '2.14';
/**
@ -64,9 +66,12 @@ class gallery extends common {
'directory' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','directory']),
'homePicture' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','homePicture']),
'sort' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','sort']),
'position' => $i
'position' => $i,
'fullScreen' => $this->getData(['module',$this->getUrl(0),$data[$i],'config','fullScreen'])
],
'legend' => $this->getData(['module',$this->getUrl(0),$data[$i],'legend'])
'legend' => $this->getData(['module',$this->getUrl(0),$data[$i],'legend']),
'position' => $this->getData(['module',$this->getUrl(0),$data[$i],'position'])
]]);
}
}
@ -143,7 +148,8 @@ class gallery extends common {
'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true),
'homePicture' => $homePicture,
'sort' => self::SORT_ASC,
'position' => count($this->getData(['module',$this->getUrl(0)])) + 1
'position' => count($this->getData(['module',$this->getUrl(0)])) + 1,
'fullScreen' => false
],
'legend' => [],
'position' => []
@ -279,7 +285,9 @@ class gallery extends common {
'homePicture' => $homePicture,
// pas de positions, on active le tri alpha
'sort' => (empty($picturesPosition) && $this->getInput('galleryEditSort') === self::SORT_HAND) ? self::SORT_ASC : $this->getInput('galleryEditSort'),
'position' => $this->getData(['module', $this->getUrl(0), $galleryId,'config','position']) === '' ? count($this->getData(['module',$this->getUrl(0)]))-1 : $this->getData(['module', $this->getUrl(0), $galleryId,'config','position'])
'position' => $this->getData(['module', $this->getUrl(0), $galleryId,'config','position']) === '' ? count($this->getData(['module',$this->getUrl(0)]))-1 : $this->getData(['module', $this->getUrl(0), $galleryId,'config','position']),
'fullScreen' => $this->getInput('galleryEditFullscreen', helper::FILTER_BOOLEAN)
],
'legend' => $legends,
'position' => $picturesPosition

View File

@ -39,7 +39,14 @@
'label' => 'Tri des images',
'help' => 'Les tris alphabétiques conviennent également aux images numérotées.<br>Cliquez sur \'Enregistrer\' pour valider le tri.'
]); ?>
</div>
</div>
<div clas="row">
<div class="col12">
<?php echo template::checkbox('galleryEditFullscreen', true, 'Mode plein écran automatique' , [
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'fullScreen']),
'help' => 'A l\'ouverture de la galerie, la première image est affichée en plein écran.'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">

View File

@ -6,6 +6,8 @@
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.com/
*/
@ -20,3 +22,12 @@ var b = new SimpleLightbox('.galleryGalleryPicture', {
captionsData: "caption",
closeText: "&times;"
});
$( document ).ready(function() {
// Démarre en mode plein écran
var fullscreen = <?php echo json_encode($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'config', 'fullScreen'])); ?>;
console.log(fullscreen);
if ( fullscreen === true) {
$('a.galleryGalleryPicture:first')[0].click();
}
});