diff --git a/module/search/ressource/theme.css b/module/search/ressource/theme.css new file mode 100755 index 00000000..63462103 --- /dev/null +++ b/module/search/ressource/theme.css @@ -0,0 +1,11 @@ +.searchTitle { + font: caption; + font-style: italic; + margin-left: 1em; +} +.searchKeyword { + background: var(--keywordColor); +} +.searchResult { + margin: .3em 0 .3em 1em; +} \ No newline at end of file diff --git a/module/search/ressource/vartheme.css b/module/search/ressource/vartheme.css new file mode 100755 index 00000000..9a5c4cdb --- /dev/null +++ b/module/search/ressource/vartheme.css @@ -0,0 +1,3 @@ +.searchKeyword { + --keywordColor: #keywordColor#; +} diff --git a/module/search/search.php b/module/search/search.php index 205aee32..6b65800c 100755 --- a/module/search/search.php +++ b/module/search/search.php @@ -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' + ] ]); } diff --git a/module/search/view/config/config.php b/module/search/view/config/config.php index e2457966..c1fed71d 100755 --- a/module/search/view/config/config.php +++ b/module/search/view/config/config.php @@ -17,14 +17,22 @@