Gallery stockage unique des paramètres de theme

This commit is contained in:
Fred Tempez 2020-08-19 21:08:00 +02:00
parent 3feab64a17
commit d2b6c54418
4 changed files with 42 additions and 42 deletions

View File

@ -19,7 +19,7 @@ class gallery extends common {
const SORT_ASC = 'SORT_ASC'; const SORT_ASC = 'SORT_ASC';
const SORT_DSC = 'SORT_DSC'; const SORT_DSC = 'SORT_DSC';
const SORT_HAND = 'SORT_HAND'; const SORT_HAND = 'SORT_HAND';
const GALLERY_VERSION = '2.26'; const GALLERY_VERSION = '2.3';
public static $directories = []; public static $directories = [];
@ -608,14 +608,14 @@ class gallery extends common {
} }
// Initialisation des données de thème de la galerie dasn theme.json // Initialisation des données de thème de la galerie dasn theme.json
// Création des valeur par défaut absentes // Création des valeur par défaut absentes
if ( $this->getData(['theme', $this->getUrl(0)]) === null ) { if ( $this->getData(['theme', 'gallery']) === null ) {
require_once('module/gallery/ressource/defaultdata.php'); require_once('module/gallery/ressource/defaultdata.php');
$this->setData(['theme', $this->getUrl(0), theme::$defaultData]); $this->setData(['theme', 'gallery', theme::$defaultData]);
} }
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
$this->setData(['theme', $this->getUrl(0), [ $this->setData(['theme', 'gallery', [
'thumbAlign' => $this->getinput('galleryThemeThumbAlign'), 'thumbAlign' => $this->getinput('galleryThemeThumbAlign'),
'thumbWidth' => $this->getinput('galleryThemeThumbWidth'), 'thumbWidth' => $this->getinput('galleryThemeThumbWidth'),
'thumbHeight' => $this->getinput('galleryThemeThumbHeight'), 'thumbHeight' => $this->getinput('galleryThemeThumbHeight'),

View File

@ -2,28 +2,28 @@
--thumbAlign: center; --thumbAlign: center;
} }
.colPicture { .colPicture {
--thumbWidth: 18em; --thumbWidth: 15em;
--thumbMargin: .5em; --thumbMargin: .3em;
} }
.galleryPicture, .galleryPicture,
.galleryGalleryPicture { .galleryGalleryPicture {
--thumbHeight: 15em; --thumbHeight: 12em;
--thumbBorder: .1em; --thumbBorder: 0em;
--thumbBorderColor: rgba(221, 221, 221, 1); --thumbBorderColor: rgba(121, 176, 214, 1);
--thumbRadius: .3em; --thumbRadius: 0em;
--thumbShadows: 1px 1px 10px; --thumbShadows: 0px;
--thumbShadowsColor: rgba(125, 125, 125, 1); --thumbShadowsColor: rgba(29, 72, 104, 1);
} }
.galleryName, .galleryName,
.galleryGalleryName { .galleryGalleryName {
--legendHeight: .375em; --legendHeight: .125em;
--legendAlign: center; --legendAlign: center;
--legendTextColor: rgba(255, 255, 255, 1); --legendTextColor: rgba(4, 21, 39, 1);
--legendBgColor: rgba(0, 0, 0, .6); --legendBgColor: rgba(143, 181, 184, 0.74);
} }
.galleryPicture:hover, .galleryPicture:hover,
.galleryGalleryPicture:hover { .galleryGalleryPicture:hover {
--thumbOpacity: .7; --thumbOpacity: 1;
} }
.galleryPicture, .galleryPicture,
.galleryGalleryPicture { .galleryGalleryPicture {

View File

@ -2,28 +2,28 @@
--thumbAlign: center; --thumbAlign: center;
} }
.colPicture { .colPicture {
--thumbWidth: 18em; --thumbWidth: 15em;
--thumbMargin: .5em; --thumbMargin: .3em;
} }
.galleryPicture, .galleryPicture,
.galleryGalleryPicture { .galleryGalleryPicture {
--thumbHeight: 15em; --thumbHeight: 12em;
--thumbBorder: .1em; --thumbBorder: 0em;
--thumbBorderColor: rgba(221, 221, 221, 1); --thumbBorderColor: rgba(121, 176, 214, 1);
--thumbRadius: .3em; --thumbRadius: 0em;
--thumbShadows: 1px 1px 10px; --thumbShadows: 0px;
--thumbShadowsColor: rgba(125, 125, 125, 1); --thumbShadowsColor: rgba(29, 72, 104, 1);
} }
.galleryName, .galleryName,
.galleryGalleryName { .galleryGalleryName {
--legendHeight: .375em; --legendHeight: .125em;
--legendAlign: center; --legendAlign: center;
--legendTextColor: rgba(255, 255, 255, 1); --legendTextColor: rgba(4, 21, 39, 1);
--legendBgColor: rgba(0, 0, 0, .6); --legendBgColor: rgba(143, 181, 184, 0.74);
} }
.galleryPicture:hover, .galleryPicture:hover,
.galleryGalleryPicture:hover { .galleryGalleryPicture:hover {
--thumbOpacity: .7; --thumbOpacity: 1;
} }
.galleryPicture, .galleryPicture,
.galleryGalleryPicture { .galleryGalleryPicture {

View File

@ -20,25 +20,25 @@
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeThumbWidth', $module::$galleryThemeSizeWidth, [ <?php echo template::select('galleryThemeThumbWidth', $module::$galleryThemeSizeWidth, [
'label' => 'Largeur', 'label' => 'Largeur',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbWidth']) 'selected' => $this->getData(['theme', 'gallery','thumbWidth'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeThumbHeight', $module::$galleryThemeSizeHeight, [ <?php echo template::select('galleryThemeThumbHeight', $module::$galleryThemeSizeHeight, [
'label' => 'Hauteur', 'label' => 'Hauteur',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbHeight']) 'selected' => $this->getData(['theme', 'gallery','thumbHeight'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbAlign', $module::$galleryThemeFlexAlign, [ <?php echo template::select('galleryThemeThumbAlign', $module::$galleryThemeFlexAlign, [
'label' => 'Alignement', 'label' => 'Alignement',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbAlign']) 'selected' => $this->getData(['theme', 'gallery','thumbAlign'])
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::select('galleryThemeThumbMargin', $module::$galleryThemeMargin, [ <?php echo template::select('galleryThemeThumbMargin', $module::$galleryThemeMargin, [
'label' => 'Marge', 'label' => 'Marge',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbMargin']) 'selected' => $this->getData(['theme', 'gallery','thumbMargin'])
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -46,7 +46,7 @@
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbBorder', $module::$galleryThemeBorder, [ <?php echo template::select('galleryThemeThumbBorder', $module::$galleryThemeBorder, [
'label' => 'Bordure', 'label' => 'Bordure',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbBorder']) 'selected' => $this->getData(['theme', 'gallery','thumbBorder'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
@ -54,13 +54,13 @@
'class' => 'colorPicker', 'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.', 'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Couleur de la bordure', 'label' => 'Couleur de la bordure',
'value' => $this->getData(['theme', $this->getUrl(0),'thumbBorderColor']) 'value' => $this->getData(['theme', 'gallery','thumbBorderColor'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbRadius', $module::$galleryThemeRadius, [ <?php echo template::select('galleryThemeThumbRadius', $module::$galleryThemeRadius, [
'label' => 'Arrondi des angles', 'label' => 'Arrondi des angles',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbRadius']) 'selected' => $this->getData(['theme', 'gallery','thumbRadius'])
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -68,7 +68,7 @@
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbShadows', $module::$galleryThemeShadows, [ <?php echo template::select('galleryThemeThumbShadows', $module::$galleryThemeShadows, [
'label' => 'Ombre', 'label' => 'Ombre',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbShadows']) 'selected' => $this->getData(['theme', 'gallery','thumbShadows'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
@ -76,13 +76,13 @@
'class' => 'colorPicker', 'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.', 'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Couleur de l\'ombre', 'label' => 'Couleur de l\'ombre',
'value' => $this->getData(['theme', $this->getUrl(0),'thumbShadowsColor']) 'value' => $this->getData(['theme', 'gallery','thumbShadowsColor'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbOpacity', $module::$galleryThemeOpacity, [ <?php echo template::select('galleryThemeThumbOpacity', $module::$galleryThemeOpacity, [
'label' => 'Opacité au survol', 'label' => 'Opacité au survol',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbOpacity']) 'selected' => $this->getData(['theme', 'gallery','thumbOpacity'])
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -99,7 +99,7 @@
'class' => 'colorPicker', 'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.', 'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Texte', 'label' => 'Texte',
'value' => $this->getData(['theme', $this->getUrl(0),'legendTextColor']) 'value' => $this->getData(['theme', 'gallery','legendTextColor'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
@ -107,19 +107,19 @@
'class' => 'colorPicker', 'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.', 'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Fond', 'label' => 'Fond',
'value' => $this->getData(['theme', $this->getUrl(0),'legendBgColor']) 'value' => $this->getData(['theme', 'gallery','legendBgColor'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeLegendHeight', $module::$galleryThemeLegendHeight, [ <?php echo template::select('galleryThemeLegendHeight', $module::$galleryThemeLegendHeight, [
'label' => 'Hauteur', 'label' => 'Hauteur',
'selected' => $this->getData(['theme', $this->getUrl(0),'legendHeight']) 'selected' => $this->getData(['theme', 'gallery','legendHeight'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeLegendAlign', $module::$galleryThemeAlign, [ <?php echo template::select('galleryThemeLegendAlign', $module::$galleryThemeAlign, [
'label' => 'Alignement', 'label' => 'Alignement',
'selected' => $this->getData(['theme', $this->getUrl(0),'legendAlign']) 'selected' => $this->getData(['theme', 'gallery','legendAlign'])
]); ?> ]); ?>
</div> </div>
</div> </div>