Module search choix couleur des mots-clés

This commit is contained in:
Fred Tempez 2020-08-19 18:46:00 +02:00
parent 6f3e81f7ce
commit 04c5fe5193
6 changed files with 45 additions and 7 deletions

View File

@ -0,0 +1,11 @@
.searchTitle {
font: caption;
font-style: italic;
margin-left: 1em;
}
.searchKeyword {
background: var(--keywordColor);
}
.searchResult {
margin: .3em 0 .3em 1em;
}

View File

@ -0,0 +1,3 @@
.searchKeyword {
--keywordColor: #keywordColor#;
}

View File

@ -45,19 +45,32 @@ class search extends common {
$this->setData(['module', $this->getUrl(0), [
'submitText' => $this->getInput('searchSubmitText'),
'placeHolder' => $this->getInput('searchPlaceHolder'),
'resultHideContent' => $this->getInput('searchResultHideContent',helper::FILTER_BOOLEAN)
'resultHideContent' => $this->getInput('searchResultHideContent',helper::FILTER_BOOLEAN),
'keywordColor' => $this->getInput('searchKeywordColor')
]]);
// Création des fichiers CSS
$content = file_get_contents('module/search/ressource/vartheme.css');
$themeCss = file_get_contents('module/search/ressource/theme.css');
// Injection des variables
$content = str_replace('#keywordColor#',$this->getinput('searchKeywordColor'),$content );
$success = file_put_contents('module/search/view/index/index.css',$content . $themeCss);
// Valeurs en sortie, affichage du formulaire
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => 'Modifications enregistrées',
'state' => true
'notification' => $success !== FALSE ? 'Modifications enregistrées' : 'Modifications non enregistées !',
'state' => $success !== FALSE
]);
}
// Valeurs en sortie, affichage du formulaire
$this->addOutput([
'title' => 'Configuration du module',
'view' => 'config'
'view' => 'config',
'vendor' => [
'tinycolorpicker'
]
]);
}

View File

@ -17,14 +17,22 @@
<div class="block">
<h4>Paramètres</h4>
<div class="row">
<div class="col6">
<div class="col4">
<?php echo template::text('searchKeywordColor', [
'class' => 'colorPicker',
'help' => 'Le curseur horizontal règle le niveau de transparence.',
'label' => 'Mot-clef en évidence',
'value' => $this->getData(['module', $this->getUrl(0), 'keywordColor'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('searchSubmitText', [
'label' => 'Texte du bouton',
'value' => $this->getData(['module', $this->getUrl(0), 'submitText']),
'placeholder' => $module::$defaultButtonText
]); ?>
</div>
<div class="col6">
<div class="col4">
<?php echo template::text('searchPlaceHolder', [
'label' => 'Aide dans la zone de saisie',
'value' => $this->getData(['module', $this->getUrl(0), 'placeHolder']),

5
module/search/view/index/index.css Normal file → Executable file
View File

@ -1,10 +1,13 @@
.searchKeyword {
--keywordColor: rgba(227, 227, 14, 0.8);
}
.searchTitle {
font: caption;
font-style: italic;
margin-left: 1em;
}
.searchKeyword {
background: yellow;
background: var(--keywordColor);
}
.searchResult {
margin: .3em 0 .3em 1em;

0
site/file/source/icones/loupe.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB