Browse Source

[9.0.01] Retour du backgroundcolor picker avec une image

pull/5/head
fredtempez 3 years ago
parent
commit
fa828215ca
  1. 7
      core/module/theme/theme.php
  2. 8
      core/module/theme/view/header/header.js.php
  3. 5
      core/module/theme/view/header/header.php

7
core/module/theme/theme.php

@ -299,13 +299,8 @@ class theme extends common {
// Soumission du formulaire
if($this->isPost()) {
// Si une image est positionnée, l'arrière en transparent.
if ($this->getInput('themeHeaderImage') === "") {
$themeHeaderBackgroundColor = $this->getInput('themeHeaderBackgroundColor'); }
else {
$themeHeaderBackgroundColor = 'rgba(0, 0, 0, 0)';
}
$this->setData(['theme', 'header', [
'backgroundColor' => $themeHeaderBackgroundColor,
'backgroundColor' => $this->getInput('themeHeaderBackgroundColor'),
'font' => $this->getInput('themeHeaderFont'),
'fontSize' => $this->getInput('themeHeaderFontSize'),
'fontWeight' => $this->getInput('themeHeaderFontWeight'),

8
core/module/theme/view/header/header.js.php

@ -92,14 +92,6 @@ $("input, select").on("change", function() {
.appendTo("head");
});
$("#themeHeaderImage").on("change", function() {
if($("#themeHeaderImage").val()) {
$("#themeHeaderBackgroundColorWrapper").slideUp();
$("#themeHeaderBackgroundColor").val($("#themeHeaderBackgroundColor").val());
} else {
$("#themeHeaderBackgroundColorWrapper").slideDown();
}
});
// Affiche / Cache les options de l'image du fond
$("#themeHeaderImage").on("change", function() {

5
core/module/theme/view/header/header.php

@ -1,7 +1,4 @@
<?php echo template::formOpen('themeHeaderForm'); ?>
<?php echo template::hidden('themeSiteBackgrounColor', [
'value' => $this->getData(['theme', 'site', 'backgroundColor'])
]); ?>
<div class="row">
<div class="col2">
<?php echo template::button('themeHeaderBack', [
@ -26,7 +23,7 @@
'label' => 'Fond',
'value' => $this->getData(['theme', 'header', 'backgroundColor'])
]); ?>
</div>
</div>
<div class="col6">
<?php echo template::text('themeHeaderTextColor', [
'class' => 'colorPicker',

Loading…
Cancel
Save