forked from ZwiiCMS-Team/ZwiiCMS
Search gestion du thème modifié
This commit is contained in:
parent
d2b6c54418
commit
f25b27eae0
6
module/search/ressource/defaultdata.php
Normal file
6
module/search/ressource/defaultdata.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
class theme extends search {
|
||||||
|
public static $defaultData = [
|
||||||
|
'keywordColor' => 'rgba(229, 229, 1, 1)'
|
||||||
|
];
|
||||||
|
}
|
@ -32,21 +32,25 @@ class search extends common {
|
|||||||
public static $motclef = '';
|
public static $motclef = '';
|
||||||
public static $motentier = '';
|
public static $motentier = '';
|
||||||
|
|
||||||
// paramètres pas défaut
|
|
||||||
public static $defaultButtonText = 'Rechercher';
|
|
||||||
public static $defaultPlaceHolder = 'Un plusieurs mots-clés séparés par un espace ou par +';
|
|
||||||
|
|
||||||
const SEARCH_VERSION = '1.1';
|
const SEARCH_VERSION = '1.1';
|
||||||
|
|
||||||
// Configuration vide
|
// Configuration vide
|
||||||
public function config() {
|
public function config() {
|
||||||
|
// 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', 'search']) === null ) {
|
||||||
|
require_once('module/search/ressource/defaultdata.php');
|
||||||
|
$this->setData(['theme', 'search', theme::$defaultData]);
|
||||||
|
}
|
||||||
if($this->isPost()) {
|
if($this->isPost()) {
|
||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
$this->setData(['module', 'search', [
|
$this->setData(['theme', 'search', [
|
||||||
|
'keywordColor' => $this->getInput('searchKeywordColor')
|
||||||
|
]]);
|
||||||
|
$this->setData(['module', $this->getUrl(0), [
|
||||||
'submitText' => $this->getInput('searchSubmitText'),
|
'submitText' => $this->getInput('searchSubmitText'),
|
||||||
'placeHolder' => $this->getInput('searchPlaceHolder'),
|
'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
|
// Création des fichiers CSS
|
||||||
$content = file_get_contents('module/search/ressource/vartheme.css');
|
$content = file_get_contents('module/search/ressource/vartheme.css');
|
||||||
|
@ -17,26 +17,24 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Paramètres</h4>
|
<h4>Paramètres</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col3">
|
||||||
<?php echo template::text('searchKeywordColor', [
|
<?php echo template::text('searchKeywordColor', [
|
||||||
'class' => 'colorPicker',
|
'class' => 'colorPicker',
|
||||||
'help' => 'Le curseur horizontal règle le niveau de transparence.',
|
'help' => ' Cette couleur est commune à tous les modules de recherche. Le curseur horizontal règle le niveau de transparence.',
|
||||||
'label' => 'Mot-clef en évidence',
|
'label' => 'Mot-clef en évidence.',
|
||||||
'value' => $this->getData(['module', 'search', 'keywordColor'])
|
'value' => $this->getData(['theme', 'search', 'keywordColor'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col3">
|
||||||
<?php echo template::text('searchSubmitText', [
|
<?php echo template::text('searchSubmitText', [
|
||||||
'label' => 'Texte du bouton',
|
'label' => 'Texte du bouton',
|
||||||
'value' => $this->getData(['module', 'search', 'submitText']),
|
'value' => $this->getData(['module', $this->getUrl(0), 'submitText']) ? $this->getData(['module', $this->getUrl(0), 'submitText']) : 'Rechercher'
|
||||||
'placeholder' => $module::$defaultButtonText
|
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col6">
|
||||||
<?php echo template::text('searchPlaceHolder', [
|
<?php echo template::text('searchPlaceHolder', [
|
||||||
'label' => 'Aide dans la zone de saisie',
|
'label' => 'Aide dans la zone de saisie',
|
||||||
'value' => $this->getData(['module', 'search', 'placeHolder']),
|
'value' => $this->getData(['module', $this->getUrl(0), 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'placeHolder']) : 'Un plusieurs mots-clés séparés par un espace ou par +'
|
||||||
'placeholder' => $module::$defaultPlaceHolder
|
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.searchKeyword {
|
.searchKeyword {
|
||||||
--keywordColor: rgba(80, 237, 9, 0.88);
|
--keywordColor: rgba(229, 229, 1, 1);
|
||||||
}
|
}
|
||||||
.searchTitle {
|
.searchTitle {
|
||||||
font: caption;
|
font: caption;
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col9 verticalAlignMiddle">
|
<div class="col9 verticalAlignMiddle">
|
||||||
<?php echo template::text('searchMotphraseclef', [
|
<?php echo template::text('searchMotphraseclef', [
|
||||||
'placeholder' => $this->getData(['module',$this->getUrl(0),'placeHolder']) ? $this->getData(['module',$this->getUrl(0),'placeHolder']) : $module::$defaultPlaceHolder,
|
'placeholder' => $this->getData(['module', $this->getUrl(0), 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'placeHolder']) : 'Un plusieurs mots-clés séparés par un espace ou par +',
|
||||||
'value' => $module::$motclef
|
'value' => $module::$motclef
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3 verticalAlignMiddle">
|
<div class="col3 verticalAlignMiddle">
|
||||||
<?php echo template::submit('pageEditSubmit', [
|
<?php echo template::submit('pageEditSubmit', [
|
||||||
'value' => $this->getData(['module',$this->getUrl(0),'submitText']) ? $this->getData(['module',$this->getUrl(0),'submitText']) : $module::$defaultButtonText
|
'value' => $this->getData(['module', $this->getUrl(0), 'submitText']) ? $this->getData(['module', $this->getUrl(0), 'submitText']) : 'Rechercher'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user