2.19 ajustement de valeurs

This commit is contained in:
Fred Tempez 2020-04-19 14:58:38 +02:00
parent 498fd7f4d6
commit b80eab0939
7 changed files with 62 additions and 65 deletions

View File

@ -83,11 +83,11 @@ class gallery extends common {
public static $galleryThemeBorder = [ public static $galleryThemeBorder = [
'0em' => 'Aucune', '0em' => 'Aucune',
'.1em' => 'Très petite', '.1em' => 'Très fine',
'.4em' => 'Petite', '.2em' => 'Fine',
'.5em' => 'Moyenne', '.4em' => 'Moyenne',
'.8em' => 'Grande', '.8em' => 'Epaisse',
'1.2em' => 'Très grande' '1em' => 'Epaisse'
]; ];
public static $galleryThemeOpacity = [ public static $galleryThemeOpacity = [
@ -102,19 +102,19 @@ class gallery extends common {
public static $galleryThemeMargin = [ public static $galleryThemeMargin = [
'0em' => 'Aucune', '0em' => 'Aucune',
'.1em' => 'Très petite', '.1em' => 'Très petite',
'.3em' => 'Petite', '.4em' => 'Petite',
'.6em' => 'Moyenne', '.6em' => 'Moyenne',
'.9em' => 'Grande', '1em' => 'Grande',
'1.2em' => 'Très grande' '2.5em' => 'Très grande'
]; ];
public static $galleryThemeRadius = [ public static $galleryThemeRadius = [
'0px' => 'Aucun', '0em' => 'Aucun',
'5px' => 'Très léger', '.3em' => 'Très léger',
'10px' => 'Léger', '.6em' => 'Léger',
'15px' => 'Moyen', '.9em' => 'Moyen',
'25px' => 'Important', '1.2' => 'Important',
'50px' => 'Très important' '2.em' => 'Très important'
]; ];
public static $galleryThemeShadows = [ public static $galleryThemeShadows = [
@ -627,13 +627,13 @@ class gallery extends common {
$content = str_replace('#legendHeight#',$this->getinput('galleryThemeLegendHeight'),$content ); $content = str_replace('#legendHeight#',$this->getinput('galleryThemeLegendHeight'),$content );
$content = str_replace('#legendTextColor#',$this->getinput('galleryThemeLegendTextColor'),$content ); $content = str_replace('#legendTextColor#',$this->getinput('galleryThemeLegendTextColor'),$content );
$content = str_replace('#legendBgColor#',$this->getinput('galleryThemeLegendBgColor'),$content ); $content = str_replace('#legendBgColor#',$this->getinput('galleryThemeLegendBgColor'),$content );
file_put_contents('module/gallery/view/index/index.css',$content . $themeCss); $success = file_put_contents('module/gallery/view/index/index.css',$content . $themeCss);
file_put_contents('module/gallery/view/gallery/gallery.css',$content . $themeCss); $success = $success && file_put_contents('module/gallery/view/gallery/gallery.css',$content . $themeCss);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl() . '/theme', 'redirect' => helper::baseUrl() . $this->getUrl() . '/theme',
'notification' => 'Modifications enregistrées', 'notification' => $succes ? 'Modifications enregistrées' : 'Modifications non enregistées !',
'state' => true 'state' => $success
]); ]);
} }
// Valeurs en sortie // Valeurs en sortie

4
module/gallery/ressource/defaultdata.php Normal file → Executable file
View File

@ -8,8 +8,8 @@ class theme extends gallery {
'thumbBorder' => '.1em', 'thumbBorder' => '.1em',
'thumbOpacity' => '.7', 'thumbOpacity' => '.7',
'thumbBorderColor' => 'rgba(221, 221, 221, 1)', 'thumbBorderColor' => 'rgba(221, 221, 221, 1)',
'thumbRadius' => '5px', 'thumbRadius' => '.3em',
'thumbShadows' => '1px 1px 5px', 'thumbShadows' => '1px 1px 10px',
'legendHeight' => '.375em', 'legendHeight' => '.375em',
'legendAlign' => 'center', 'legendAlign' => 'center',
'legendTextColor' => 'rgba(255, 255, 255, 1)', 'legendTextColor' => 'rgba(255, 255, 255, 1)',

1
module/gallery/ressource/theme.css Normal file → Executable file
View File

@ -22,6 +22,7 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
border-radius: 0 0 calc(var(--thumbRadius)/2) calc(var(--thumbRadius)/2);
padding: var(--legendHeight); padding: var(--legendHeight);
background: var(--legendBgColor); background: var(--legendBgColor);
color: var(--legendTextColor); color: var(--legendTextColor);

0
module/gallery/ressource/vartheme.css Normal file → Executable file
View File

View File

@ -10,12 +10,12 @@
--thumbHeight: 15em; --thumbHeight: 15em;
--thumbBorder: .1em; --thumbBorder: .1em;
--thumbBorderColor: rgba(221, 221, 221, 1); --thumbBorderColor: rgba(221, 221, 221, 1);
--thumbRadius: 5px; --thumbRadius: .6em;
--thumbShadows: 1px 1px 5px; --thumbShadows: 1px 1px 5px;
} }
.galleryName, .galleryName,
.galleryGalleryName { .galleryGalleryName {
--legendHeight: .375em; --legendHeight: .25em;
--legendAlign: center; --legendAlign: center;
--legendTextColor: rgba(255, 255, 255, 1); --legendTextColor: rgba(255, 255, 255, 1);
--legendBgColor: rgba(0, 0, 0, .6); --legendBgColor: rgba(0, 0, 0, .6);
@ -48,6 +48,7 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
border-radius: 0 0 calc(var(--thumbRadius)/2) calc(var(--thumbRadius)/2);
padding: var(--legendHeight); padding: var(--legendHeight);
background: var(--legendBgColor); background: var(--legendBgColor);
color: var(--legendTextColor); color: var(--legendTextColor);

View File

@ -10,12 +10,12 @@
--thumbHeight: 15em; --thumbHeight: 15em;
--thumbBorder: .1em; --thumbBorder: .1em;
--thumbBorderColor: rgba(221, 221, 221, 1); --thumbBorderColor: rgba(221, 221, 221, 1);
--thumbRadius: 5px; --thumbRadius: .6em;
--thumbShadows: 1px 1px 5px; --thumbShadows: 1px 1px 5px;
} }
.galleryName, .galleryName,
.galleryGalleryName { .galleryGalleryName {
--legendHeight: .375em; --legendHeight: .25em;
--legendAlign: center; --legendAlign: center;
--legendTextColor: rgba(255, 255, 255, 1); --legendTextColor: rgba(255, 255, 255, 1);
--legendBgColor: rgba(0, 0, 0, .6); --legendBgColor: rgba(0, 0, 0, .6);
@ -48,6 +48,7 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
border-radius: 0 0 calc(var(--thumbRadius)/2) calc(var(--thumbRadius)/2);
padding: var(--legendHeight); padding: var(--legendHeight);
background: var(--legendBgColor); background: var(--legendBgColor);
color: var(--legendTextColor); color: var(--legendTextColor);

View File

@ -17,27 +17,25 @@
<div class="block"> <div class="block">
<h4>Configuration des vignettes</h4> <h4>Configuration des vignettes</h4>
<div class="row"> <div class="row">
<div class="col5 offset1"> <div class="col3">
<?php echo template::select('galleryThemeThumbWidth', $module::$galleryThemeSize, [ <?php echo template::select('galleryThemeThumbWidth', $module::$galleryThemeSize, [
'label' => 'Largeur', 'label' => 'Largeur',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbWidth']) 'selected' => $this->getData(['theme', $this->getUrl(0),'thumbWidth'])
]); ?> ]); ?>
</div> </div>
<div class="col5"> <div class="col3">
<?php echo template::select('galleryThemeThumbHeight', $module::$galleryThemeSize, [ <?php echo template::select('galleryThemeThumbHeight', $module::$galleryThemeSize, [
'label' => 'Hauteur', 'label' => 'Hauteur',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbHeight']) 'selected' => $this->getData(['theme', $this->getUrl(0),'thumbHeight'])
]); ?> ]); ?>
</div> </div>
</div> <div class="col4">
<div class="row">
<div class="col5 offset1">
<?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', $this->getUrl(0),'thumbAlign'])
]); ?> ]); ?>
</div> </div>
<div class="col5"> <div class="col2">
<?php echo template::select('galleryThemeThumbMargin', $module::$galleryThemeMargin, [ <?php echo template::select('galleryThemeThumbMargin', $module::$galleryThemeMargin, [
'label' => 'Marges', 'label' => 'Marges',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbMargin']) 'selected' => $this->getData(['theme', $this->getUrl(0),'thumbMargin'])
@ -45,42 +43,40 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col5 offset1"> <div class="col4">
<?php echo template::select('galleryThemeThumbBorder', $module::$galleryThemeBorder, [ <?php echo template::select('galleryThemeThumbBorder', $module::$galleryThemeBorder, [
'label' => 'Bordures', 'label' => 'Bordures',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbBorder']) 'selected' => $this->getData(['theme', $this->getUrl(0),'thumbBorder'])
]); ?> ]); ?>
</div> </div>
<div class="col5"> <div class="col4">
<?php echo template::select('galleryThemeThumbOpacity', $module::$galleryThemeOpacity, [
'label' => 'Opacité au survol',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbOpacity'])
]); ?>
</div>
</div>
<div class="row">
<div class="col5 offset1">
<?php echo template::select('galleryThemeThumbRadius', $module::$galleryThemeRadius, [
'label' => 'Bords arrondis',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbRadius'])
]); ?>
</div>
<div class="col5">
<?php echo template::select('galleryThemeThumbShadows', $module::$galleryThemeShadows, [
'label' => 'Ombres',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbShadows'])
]); ?>
</div>
</div>
<div class="row">
<div class="col5 offset4">
<?php echo template::text('galleryThemeThumbBorderColor', [ <?php echo template::text('galleryThemeThumbBorderColor', [
'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', $this->getUrl(0),'thumbBorderColor'])
]); ?> ]); ?>
</div> </div>
<div class="col4">
<?php echo template::select('galleryThemeThumbRadius', $module::$galleryThemeRadius, [
'label' => 'Bords arrondis',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbRadius'])
]); ?>
</div>
</div>
<div class="row">
<div class="col5 offset1">
<?php echo template::select('galleryThemeThumbOpacity', $module::$galleryThemeOpacity, [
'label' => 'Opacité au survol',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbOpacity'])
]); ?>
</div>
<div class="col5">
<?php echo template::select('galleryThemeThumbShadows', $module::$galleryThemeShadows, [
'label' => 'Ombres',
'selected' => $this->getData(['theme', $this->getUrl(0),'thumbShadows'])
]); ?>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -90,7 +86,7 @@
<div class="block"> <div class="block">
<h4>Configuration des légendes</h4> <h4>Configuration des légendes</h4>
<div class="row"> <div class="row">
<div class="col5 offset1"> <div class="col3">
<?php echo template::text('galleryThemeLegendTextColor', [ <?php echo template::text('galleryThemeLegendTextColor', [
'class' => 'colorPicker', 'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.', 'help' => 'Le curseur horizontal règle le niveau de transparence.',
@ -98,7 +94,7 @@
'value' => $this->getData(['theme', $this->getUrl(0),'legendTextColor']) 'value' => $this->getData(['theme', $this->getUrl(0),'legendTextColor'])
]); ?> ]); ?>
</div> </div>
<div class="col5"> <div class="col3">
<?php echo template::text('galleryThemeLegendBgColor', [ <?php echo template::text('galleryThemeLegendBgColor', [
'class' => 'colorPicker', 'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.', 'help' => 'Le curseur horizontal règle le niveau de transparence.',
@ -106,19 +102,17 @@
'value' => $this->getData(['theme', $this->getUrl(0),'legendBgColor']) 'value' => $this->getData(['theme', $this->getUrl(0),'legendBgColor'])
]); ?> ]); ?>
</div> </div>
</div> <div class="col3">
<div class="row">
<div class="col5 offset1">
<?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', $this->getUrl(0),'legendHeight'])
]); ?> ]); ?>
</div> </div>
<div class="col5"> <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', $this->getUrl(0),'legendAlign'])
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>