From c775bcd99827af9bdc7e4b24f0d98108994e675d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Thu, 31 Mar 2022 20:07:52 +0200 Subject: [PATCH] =?UTF-8?q?Gallery=20bouton=20back=20param=C3=A8trable=20d?= =?UTF-8?q?isplay=20none=20dans=20gallery=20=C3=A0=20voir=20=20et=20jquery?= =?UTF-8?q?=20option=20=C3=A0=20faire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/blog/view/index/index.php | 2 +- module/gallery/gallery.php | 21 +++++++++-- module/gallery/view/gallery/gallery.css | 21 +++++++++++ module/gallery/view/gallery/gallery.php | 20 ++++++---- .../view/option/{options.css => option.css} | 0 module/gallery/view/option/option.php | 37 +++++++++++++++---- 6 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 module/gallery/view/gallery/gallery.css rename module/gallery/view/option/{options.css => option.css} (100%) diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index a35258e7..28c92dc7 100644 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -72,7 +72,7 @@ getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])): ?>

Cet article ne reçoit pas de commentaire.

-

+

0) { diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 35690059..338bfdb2 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -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([ diff --git a/module/gallery/view/gallery/gallery.css b/module/gallery/view/gallery/gallery.css new file mode 100644 index 00000000..80f5e43d --- /dev/null +++ b/module/gallery/view/gallery/gallery.css @@ -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 + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @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; + } diff --git a/module/gallery/view/gallery/gallery.php b/module/gallery/view/gallery/gallery.php index fda256ae..1b56c5b7 100644 --- a/module/gallery/view/gallery/gallery.php +++ b/module/gallery/view/gallery/gallery.php @@ -1,3 +1,12 @@ + +

+
+ helper::baseUrl() . $this->getUrl(0), + 'value' => template::ico('left') + ]); ?> +
+
$legend): ?>
@@ -15,14 +24,11 @@
- -
-
+
+
helper::baseUrl() . $this->getUrl(0), - 'ico' => 'left', - 'value' => '' + 'value' => template::ico('left') ]); ?>
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/module/gallery/view/option/options.css b/module/gallery/view/option/option.css similarity index 100% rename from module/gallery/view/option/options.css rename to module/gallery/view/option/option.css diff --git a/module/gallery/view/option/option.php b/module/gallery/view/option/option.php index 7b8a9579..8817b906 100644 --- a/module/gallery/view/option/option.php +++ b/module/gallery/view/option/option.php @@ -1,31 +1,54 @@
-
+
helper::baseUrl() . $this->getUrl(0) . '/config', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
-

Galerie unique

+

Options

-
+
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' ]); ?>
+
+
+ '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, + ]); ?> +
+
+ '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, + ]); ?> +
+