diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php
index c49cbb10..89c06d29 100644
--- a/module/gallery/gallery.php
+++ b/module/gallery/gallery.php
@@ -26,6 +26,7 @@ class gallery extends common {
'dirs' => self::GROUP_MODERATOR,
'sort' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR,
+ 'theme' => self::GROUP_MODERATOR,
'index' => self::GROUP_VISITOR
];
@@ -35,6 +36,56 @@ class gallery extends common {
self::SORT_HAND => 'Manuel'
];
+ public static $galleryThemeAlign = [
+ 'left' => 'À gauche',
+ 'center' => 'Au centre',
+ 'right' => 'À droite'
+ ];
+
+ public static $galleryThemeSize = [
+ '8em' => 'Très petite (8em)',
+ '10em' => 'Petite (10em)',
+ '12em' => '(12em)',
+ '14em' => 'Moyenne (14em)',
+ '16em' => '(16em)',
+ '18em' => 'Grande (18em)',
+ '20em' => 'Très grande (20em)'
+ ];
+
+ public static $galleryThemeLegendHeight = [
+ '2em' => 'Très petite (2em)',
+ '4em' => 'Petite (4em)',
+ '6em' => 'Moyenne (6em)',
+ '8em' => 'Grande (8em)',
+ '10em' => 'Très grande (10em)'
+ ];
+
+ public static $galleryThemeBorder = [
+ '0em' => 'Aucune',
+ '1em' => 'Très petite (1em)',
+ '2em' => 'Petite (2em)',
+ '3em' => 'Moyenne (3em)',
+ '4em' => 'Grande (4em)',
+ '5em' => 'Très grande (5em)'
+ ];
+
+ public static $galleryThemeOpacity = [
+ '1' => 'Aucun ',
+ '.9' => 'Faible (.9)',
+ '.8' => 'Moyen (0.8)',
+ '.7' => 'Fort(0.7)',
+ '.6' => 'Très fort (0.6)'
+ ];
+
+ public static $galleryThemeMargin = [
+ '0em' => 'Aucune',
+ '.2em' => 'Très petite (.2em)',
+ '.4em' => 'Petite (.4em)',
+ '.6em' => 'Moyenne (.6em)',
+ '.8em' => 'Grande (.8em)',
+ '1em' => 'Très grande (1em)'
+ ];
+
public static $directories = [];
public static $firstPictures = [];
@@ -49,7 +100,7 @@ class gallery extends common {
public static $thumbs = [];
- const GALLERY_VERSION = '2.15';
+ const GALLERY_VERSION = '2.16';
/**
@@ -498,6 +549,47 @@ class gallery extends common {
}
}
+ /**
+ * Thème de la galerie
+ */
+ public function theme() {
+ // Jeton incorrect
+ if ($this->getUrl(2) !== $_SESSION['csrf']) {
+ // Valeurs en sortie
+ $this->addOutput([
+ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
+ 'notification' => 'Action non autorisée'
+ ]);
+ }
+ // Soumission du formulaire
+ if($this->isPost()) {
+ $this->setData(['module', $this->getUrl(0), $this->getUrl(1), [
+ 'config' => [
+ 'name' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'config','name']),
+ 'directory' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'config','directory']),
+ 'homePicture' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'config','homePicture']),
+ 'sort' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'config','sort']),
+ 'position' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'config','position']),
+ 'fullScreen' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'config','fullScreen'])
+
+ ],
+ 'legend' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'legend']),
+ 'position' => $this->getData(['module',$this->getUrl(0),$this->getUrl(1),'position']),
+ 'theme' => [
+
+ ]
+ ]]);
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'title' => "Thème du module",
+ 'view' => 'theme',
+ 'vendor' => [
+ 'tinycolorpicker'
+ ]
+ ]);
+ }
+
}
class galleriesHelper extends helper {
diff --git a/module/gallery/view/config/config.php b/module/gallery/view/config/config.php
index 3865564b..b59bc2f1 100644
--- a/module/gallery/view/config/config.php
+++ b/module/gallery/view/config/config.php
@@ -8,6 +8,12 @@
'value' => 'Retour'
]); ?>
+
+ helper::baseUrl() . $this->getUrl(0) . '/theme/' . $_SESSION['csrf'],
+ 'value' => 'Thème'
+ ]); ?>
+
diff --git a/module/gallery/view/index/index.css b/module/gallery/view/index/index.css
index f7137dba..debfa5bf 100644
--- a/module/gallery/view/index/index.css
+++ b/module/gallery/view/index/index.css
@@ -1,7 +1,7 @@
.galleryPicture {
display: block;
- border: 1px solid #DDD;
- height: 150px;
+ border: 1px solid #000;
+ height: 8em;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
@@ -17,7 +17,7 @@
left: 0;
right: 0;
bottom: 0;
- padding: 6px;
+ padding: 8px;
background: rgba(0, 0, 0, .6);
color: #FFF;
text-align: center;
@@ -29,9 +29,9 @@
}
.colPicture {
- width : 16em;
+ width : 8em;
max-width: 50%;
- margin: 0.5em;
+ margin: 1.1em;
}
@media (max-width: 432px) {
diff --git a/module/gallery/view/theme/theme.css b/module/gallery/view/theme/theme.css
new file mode 100644
index 00000000..3b94602b
--- /dev/null
+++ b/module/gallery/view/theme/theme.css
@@ -0,0 +1,16 @@
+/**
+ * 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-2020, Frédéric Tempez
+ * @license GNU General Public License, version 3
+ * @link http://zwiicms.com/
+ */
+
+
+@import url("core/layout/admin.css");
\ No newline at end of file
diff --git a/module/gallery/view/theme/theme.php b/module/gallery/view/theme/theme.php
new file mode 100644
index 00000000..803e1667
--- /dev/null
+++ b/module/gallery/view/theme/theme.php
@@ -0,0 +1,113 @@
+
+
+
+ 'buttonGrey',
+ 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
+ 'ico' => 'left',
+ 'value' => 'Retour'
+ ]); ?>
+
+
+
+
+
+
+
+
+
Vignettes
+
+
+ 'Alignement des vignettes sur la page :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','thumbAlign'])
+ ]); ?>
+
+
+ 'Largeur des vignettes :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','thumbWidth'])
+ ]); ?>
+
+
+ 'Hauteur des vignettes :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','legendHeight'])
+ ]); ?>
+
+
+
+
+ 'Marges autour des vignettes :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','thumbMargin'])
+ ]); ?>
+
+
+ 'Epaisseur des bordures',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','thumbBorder'])
+ ]); ?>
+
+
+ 'Effet d\'opacité au survol',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','thumbOpacity'])
+ ]); ?>
+
+
+
+
+
+
+
+
+
Légendes
+
+
+ 'Hauteur des légendes :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','legendHeight'])
+ ]); ?>
+
+
+ 'Alignement des légendes dans les vignettes :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','legendAlign'])
+ ]); ?>
+
+
+
+
+ 'colorPicker',
+ 'help' => 'Le curseur horizontal règle le niveau de transparence.',
+ 'label' => 'Couleur du texte de légende',
+ 'value' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','legendTextColor'])
+ ]); ?>
+
+
+ 'colorPicker',
+ 'help' => 'Le curseur horizontal règle le niveau de transparence.',
+ 'label' => 'Couleur du fond de la légende',
+ 'value' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','legendBgColor'])
+ ]); ?>
+
+
+ 'Opacité du fond des légendes :',
+ 'selected' => $this->getData(['module', $this->getUrl(0),$this->getUrl(1),'theme','legendOpacity'])
+ ]); ?>
+
+
+
+
+
+
\ No newline at end of file