Gallery bouton back paramètrable

display none dans gallery à voir  et jquery option à faire
This commit is contained in:
Fred Tempez 2022-03-31 20:07:52 +02:00
parent 8fdf1367e2
commit c775bcd998
6 changed files with 83 additions and 18 deletions

View File

@ -147,6 +147,18 @@ class gallery extends common {
'1px 1px 50px' => 'Très importante'
];
public static $galleryOptionBackPosition = [
'displayNone' => 'Masqué',
'top' => 'Au-dessus',
'bottom' => 'En dessous',
];
public static $galleryOptionBackAlign = [
'left' => 'A gauche',
'center' => 'Au centre',
'right' => 'A droite',
];
/**
* Mise à jour du module
* Appelée par les fonctions index et config
@ -681,8 +693,9 @@ class gallery extends common {
// 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)) {
self::$config['backPosition'] = $this->getData(['module', $this->getUrl(0), 'config','backPosition']) ;
self::$config['backAlign'] = 'textAlign' . ucfirst($this->getData(['module', $this->getUrl(0), 'config','backAlign'])) ;
if(is_dir($directory) ) {
$iterator = new DirectoryIterator($directory);
foreach($iterator as $fileInfos) {
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
@ -892,7 +905,9 @@ 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('galleryOptionShowUniqueGallery', helper::FILTER_BOOLEAN),
'backPosition' => $this->getinput('galleryOptionBackPosition', null),
'backAlign' => $this->getinput('galleryOptionBackAlign', null)
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -0,0 +1,21 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @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-2022, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
div #topBackPosition .bottom {
display: none;
}
div #bottomBackPosition .top {
display: none;
}

View File

@ -1,3 +1,12 @@
<div id="topBackPosition" class="row <?php echo $module::$config['backPosition'] . ' ' . $module::$config['backAlign'];?>">
<div class="col1">
<?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0),
'value' => template::ico('left')
]); ?>
</div>
</div>
<div id="pictureContainer" class="row galleryRow <?php echo ($module::$config['fullScreen']);?> ">
<?php foreach($module::$pictures as $picture => $legend): ?>
<div class="colPicture">
@ -15,14 +24,11 @@
</div>
<?php endforeach; ?>
</div>
<?php if ( $module::$config['mono'] !== true): ?>
<div class="row">
<div class="col2">
<div id="bottomBackPosition" class="row <?php echo $module::$config['backPosition'] . ' ' . $module::$config['backAlign'];?>">
<div class="col1">
<?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0),
'ico' => 'left',
'value' => ''
'value' => template::ico('left')
]); ?>
</div>
</div>
<?php endif; ?>

View File

@ -1,31 +1,54 @@
<?php echo template::formOpen('galleryOptionForm'); ?>
<div class="row">
<div class="col2">
<div class="col1">
<?php echo template::button('galleryOptionBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
'value' => template::ico('left')
]); ?>
</div>
<div class="col2 offset8">
<div class="col2 offset9">
<?php echo template::submit('galleryOptionSubmit'); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Galerie unique</h4>
<h4>Options</h4>
<div class="row">
<div class="col12 verticalAlignBottom">
<div class="col12">
<?php echo template::checkbox('galleryOptionShowUniqueGallery', 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'])
? $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery'])
: false,
'disabled' => count($this->getData(['module', $this->getUrl(0), 'content'])) > 1,
'help' => 'Cette option est active lorsque le module ne contient qu\'une seule galerie, elle permet d\'éviter la page listant toutes les galeries et affiche directement la galerie'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::select('galleryOptionBackPosition', $module::$galleryOptionBackPosition, [
'label' => 'Position du bouton de retour à l\'index des galeries',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true
? 'none'
: $this->getData(['module', $this->getUrl(0), 'config','backPosition']),
'disabled' => count($this->getData(['module', $this->getUrl(0), 'content'])) === 1
? $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery'])
: false,
]); ?>
</div>
<div class="col6">
<?php echo template::select('galleryOptionBackAlign', $module::$galleryOptionBackAlign, [
'label' => 'Alignement du bouton de retour',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true
? 'none'
: $this->getData(['module', $this->getUrl(0), 'config','backAlign']),
'disabled' => count($this->getData(['module', $this->getUrl(0), 'content'])) === 1
? $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery'])
: false,
]); ?>
</div>
</div>
</div>
</div>
</div>