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

@ -72,7 +72,7 @@
<?php if($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])): ?> <?php if($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])): ?>
<p>Cet article ne reçoit pas de commentaire.</p> <p>Cet article ne reçoit pas de commentaire.</p>
<?php else: ?> <?php else: ?>
<p> <p>
<?php echo template::ico('comment', 'right'); ?> <?php echo template::ico('comment', 'right'); ?>
<?php <?php
if ($module::$comments[$articleId] > 0) { if ($module::$comments[$articleId] > 0) {

View File

@ -147,6 +147,18 @@ class gallery extends common {
'1px 1px 50px' => 'Très importante' '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 * Mise à jour du module
* Appelée par les fonctions index et config * Appelée par les fonctions index et config
@ -681,8 +693,9 @@ class gallery extends common {
// Définir les options // Définir les options
self::$config['homePicture'] = $this->getData(['module',$this->getUrl(0),'content', $gallery,'config','homePicture']); 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['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; self::$config['backPosition'] = $this->getData(['module', $this->getUrl(0), 'config','backPosition']) ;
if(is_dir($directory)) { self::$config['backAlign'] = 'textAlign' . ucfirst($this->getData(['module', $this->getUrl(0), 'config','backAlign'])) ;
if(is_dir($directory) ) {
$iterator = new DirectoryIterator($directory); $iterator = new DirectoryIterator($directory);
foreach($iterator as $fileInfos) { foreach($iterator as $fileInfos) {
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { 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); mkdir (self::DATADIRECTORY . $this->getUrl(0), 0755, true);
} }
$this->setData(['module', $this->getUrl(0), 'config', [ $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 // Valeurs en sortie
$this->addOutput([ $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']);?> "> <div id="pictureContainer" class="row galleryRow <?php echo ($module::$config['fullScreen']);?> ">
<?php foreach($module::$pictures as $picture => $legend): ?> <?php foreach($module::$pictures as $picture => $legend): ?>
<div class="colPicture"> <div class="colPicture">
@ -15,14 +24,11 @@
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php if ( $module::$config['mono'] !== true): ?> <div id="bottomBackPosition" class="row <?php echo $module::$config['backPosition'] . ' ' . $module::$config['backAlign'];?>">
<div class="row"> <div class="col1">
<div class="col2">
<?php echo template::button('galleryGalleryBack', [ <?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0), 'href' => helper::baseUrl() . $this->getUrl(0),
'ico' => 'left', 'value' => template::ico('left')
'value' => ''
]); ?> ]); ?>
</div> </div>
</div> </div>
<?php endif; ?>

View File

@ -1,31 +1,54 @@
<?php echo template::formOpen('galleryOptionForm'); ?> <?php echo template::formOpen('galleryOptionForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col1">
<?php echo template::button('galleryOptionBack', [ <?php echo template::button('galleryOptionBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'value' => template::ico('left')
'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset8"> <div class="col2 offset9">
<?php echo template::submit('galleryOptionSubmit'); ?> <?php echo template::submit('galleryOptionSubmit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Galerie unique</h4> <h4>Options</h4>
<div class="row"> <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' , [ <?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 '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, : false,
'disabled' => count($this->getData(['module', $this->getUrl(0), 'content'])) > 1, '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' '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> </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> </div>
</div> </div>