Textes par défaut dans la config

This commit is contained in:
Fred Tempez 2020-08-16 16:24:09 +02:00
parent e076950f0e
commit 9b847547f3
3 changed files with 20 additions and 7 deletions

View File

@ -33,6 +33,10 @@ class search extends common {
public static $motentier = '';
public static $defaultButtonText = 'Rechercher';
public static $defaultPlaceHolder = 'Un mot clé ou une phrase entière sans guillemets';
const SEARCH_VERSION = '1.1';
// Configuration vide
@ -41,7 +45,8 @@ class search extends common {
// Soumission du formulaire
$this->setData(['module', $this->getUrl(0), [
'submitText' => $this->getInput('searchSubmitText'),
'placeHolder' => $this->getInput('searchPlaceHolder')
'placeHolder' => $this->getInput('searchPlaceHolder'),
'resultHideContent' => $this->getInput('searchResultHideContent',helper::FILTER_BOOLEAN)
]]);
// Valeurs en sortie, affichage du formulaire
$this->addOutput([
@ -156,7 +161,7 @@ class search extends common {
'notification' => $notification,
'state' => $success,
'showBarEditButton' => true,
'showPageContent' => true
'showPageContent' => !$this->getData(['module', $this->getUrl(0),'resultHideContent'])
]);
} else {
// Valeurs en sortie, affichage du formulaire

View File

@ -21,17 +21,24 @@
<?php echo template::text('searchSubmitText', [
'label' => 'Texte du bouton de soumission',
'value' => $this->getData(['module', $this->getUrl(0), 'submitText']),
'placeholder' => 'Rechercher'
'placeholder' => $module::$defaultButtonText
]); ?>
</div>
<div class="col6">
<?php echo template::text('searchPlaceHolder', [
'label' => 'Texte dans la zone de recherche',
'label' => 'Aide dans la zone de saisie',
'value' => $this->getData(['module', $this->getUrl(0), 'placeHolder']),
'placeholder' => 'Saisissez vos mots clés ou une phrase'
'placeholder' => $module::$defaultPlaceHolder
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::checkbox('searchResultHideContent', true, 'Résultats : masquer le contenu de la page', [
'checked' => $this->getData(['module', $this->getUrl(0), 'resultHideContent']),
]); ?>
</div>
</div>
</div>
</div>
</div>

View File

@ -4,12 +4,13 @@
<div class="row">
<div class="col9 verticalAlignMiddle">
<?php echo template::text('searchMotphraseclef', [
'placeholder' => $this->getData(['module',$this->getUrl(0),'placeHolder']) ? $this->getData(['module',$this->getUrl(0),'placeHolder']) : 'Saisissez vos mots clés ou une phrase'
'placeholder' => $this->getData(['module',$this->getUrl(0),'placeHolder']) ? $this->getData(['module',$this->getUrl(0),'placeHolder']) : $module::$defaultPlaceHolder,
'value' => $module::$motclef
]); ?>
</div>
<div class="col3 verticalAlignMiddle">
<?php echo template::submit('pageEditSubmit', [
'value' => $this->getData(['module',$this->getUrl(0),'submitText']) ? $this->getData(['module',$this->getUrl(0),'submitText']) : 'Rechercher'
'value' => $this->getData(['module',$this->getUrl(0),'submitText']) ? $this->getData(['module',$this->getUrl(0),'submitText']) : $module::$defaultButtonText
]); ?>
</div>
</div>