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_DSC = 'SORT_DSC';
const SORT_HAND = 'SORT_HAND';
const GALLERY_VERSION = '2.26';
const GALLERY_VERSION = '2.3';
public static $directories = [];
@ -608,14 +608,14 @@ class gallery extends common {
}
// Initialisation des données de thème de la galerie dasn theme.json
// 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');
$this->setData(['theme', $this->getUrl(0), theme::$defaultData]);
$this->setData(['theme', 'gallery', theme::$defaultData]);
}
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['theme', $this->getUrl(0), [
$this->setData(['theme', 'gallery', [
'thumbAlign' => $this->getinput('galleryThemeThumbAlign'),
'thumbWidth' => $this->getinput('galleryThemeThumbWidth'),
'thumbHeight' => $this->getinput('galleryThemeThumbHeight'),

View File

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

View File

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

View File

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