Personnalisation module de recherche
This commit is contained in:
parent
fe273b8019
commit
e076950f0e
@ -37,13 +37,13 @@
|
||||
<?php echo template::label('formConfigLabel', 'Aucune option pour une étiquette', [
|
||||
'class' => 'displayNone formConfigLabelWrapper'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="formConfigMore displayNone">
|
||||
<?php echo template::text('formConfigValues[]', [
|
||||
'placeholder' => 'Liste des valeurs séparées par des virgules (valeur1,valeur2,...)',
|
||||
'class' => 'formConfigValues',
|
||||
'classWrapper' => 'displayNone formConfigValuesWrapper'
|
||||
]); ?>
|
||||
]); ?>
|
||||
<?php echo template::checkbox('formConfigRequired[]', true, 'Champ obligatoire'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -82,8 +82,8 @@
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
|
||||
'help' => 'Sélectionnez au moins un groupe, un utilisateur ou saississez un email. Votre serveur doit autoriser les envois de mail.'
|
||||
]); ?>
|
||||
<div id="formConfigMailOptions" class="displayNone">
|
||||
]); ?>
|
||||
<div id="formConfigMailOptions" class="displayNone">
|
||||
<div class="row">
|
||||
<div class="col11 offset1">
|
||||
<?php echo template::text('formConfigSubject', [
|
||||
@ -92,10 +92,10 @@
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
</div>
|
||||
<?php
|
||||
// Element 0 quand aucun membre a été sélectionné
|
||||
$groupMembers = [''] + $module::$groupNews;
|
||||
$groupMembers = [''] + $module::$groupNews;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col3 offset1">
|
||||
@ -110,7 +110,7 @@
|
||||
'label' => 'A un membre',
|
||||
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers)
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::text('formConfigMail', [
|
||||
'label' => 'A une adresse email',
|
||||
@ -124,7 +124,7 @@
|
||||
<?php echo template::checkbox('formConfigMailReplyTo', true, 'Répondre à l\'expéditeur depuis le mail de notification', [
|
||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']),
|
||||
'help' => 'Cette option permet de réponse drectement à l\'expéditeur du message si celui-ci a indiqué un email valide.'
|
||||
]); ?>
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -141,7 +141,7 @@
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::checkbox('formConfigcaptcha', true, 'Valider un captcha afin de soumettre le formulaire.', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
|
||||
]); ?>
|
||||
|
@ -37,13 +37,24 @@ class search extends common {
|
||||
|
||||
// Configuration vide
|
||||
public function config() {
|
||||
if($this->isPost()) {
|
||||
// Soumission du formulaire
|
||||
$this->setData(['module', $this->getUrl(0), [
|
||||
'submitText' => $this->getInput('searchSubmitText'),
|
||||
'placeHolder' => $this->getInput('searchPlaceHolder')
|
||||
]]);
|
||||
// Valeurs en sortie, affichage du formulaire
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(),
|
||||
'notification' => 'Modifications enregistrées',
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
// Valeurs en sortie, affichage du formulaire
|
||||
$this->addOutput([
|
||||
'view' => 'config',
|
||||
'showBarEditButton' => true,
|
||||
'showPageContent' => true
|
||||
'title' => 'Configuration du module',
|
||||
'view' => 'config'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@ -141,15 +152,15 @@ class search extends common {
|
||||
self::$resultList = $result;
|
||||
// Valeurs en sortie, affichage du résultat
|
||||
$this->addOutput([
|
||||
'title' => '',
|
||||
'view' => 'result',
|
||||
'view' => 'index',
|
||||
'notification' => $notification,
|
||||
'state' => $success
|
||||
'state' => $success,
|
||||
'showBarEditButton' => true,
|
||||
'showPageContent' => true
|
||||
]);
|
||||
} else {
|
||||
// Valeurs en sortie, affichage du formulaire
|
||||
$this->addOutput([
|
||||
'title' => '',
|
||||
'view' => 'index',
|
||||
'showBarEditButton' => true,
|
||||
'showPageContent' => true
|
||||
|
@ -1,15 +1,41 @@
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('newsConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'ico' => 'left',
|
||||
'value' => 'Retour'
|
||||
]); ?>
|
||||
<?php echo template::formOpen('searchConfig'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('searchConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'ico' => 'left',
|
||||
'value' => 'Retour'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('searchConfigSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<h2 class="textAlignCenter">Aucun paramètre de configuration</h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Paramètres</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::text('searchSubmitText', [
|
||||
'label' => 'Texte du bouton de soumission',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'submitText']),
|
||||
'placeholder' => 'Rechercher'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('searchPlaceHolder', [
|
||||
'label' => 'Texte dans la zone de recherche',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'placeHolder']),
|
||||
'placeholder' => 'Saisissez vos mots clés ou une phrase'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<div class="moduleVersion">Version n°
|
||||
<?php echo $module::SEARCH_VERSION; ?>
|
||||
</div>
|
@ -2,14 +2,14 @@
|
||||
<div class="row">
|
||||
<div class="col10 offset1">
|
||||
<div class="row">
|
||||
<div class="col10 verticalAlignBottom">
|
||||
<div class="col9 verticalAlignMiddle">
|
||||
<?php echo template::text('searchMotphraseclef', [
|
||||
'placeholder' => 'Saisissez vos mots clés ou une phrase'
|
||||
'placeholder' => $this->getData(['module',$this->getUrl(0),'placeHolder']) ? $this->getData(['module',$this->getUrl(0),'placeHolder']) : 'Saisissez vos mots clés ou une phrase'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 verticalAlignBottom">
|
||||
<div class="col3 verticalAlignMiddle">
|
||||
<?php echo template::submit('pageEditSubmit', [
|
||||
'value' => 'Ok'
|
||||
'value' => $this->getData(['module',$this->getUrl(0),'submitText']) ? $this->getData(['module',$this->getUrl(0),'submitText']) : 'Rechercher'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,4 +22,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$resultTitle && $module::$resultList): ?>
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo $module::$resultTitle; ?></h4>
|
||||
<?php if (!empty($module::$resultList)) {
|
||||
echo $module::$resultList;
|
||||
} else {
|
||||
echo "Rien à afficher";
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo template::formClose(); ?>
|
||||
|
@ -1,36 +0,0 @@
|
||||
<?php echo template::formOpen('searchForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col10 offset1">
|
||||
<div class="row">
|
||||
<div class="col10 verticalAlignBottom">
|
||||
<?php echo template::text('searchMotphraseclef', [
|
||||
'placeholder' => 'Saisissez vos mots clés ou une phrase',
|
||||
'value' => $module::$motclef
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 verticalAlignBottom">
|
||||
<?php echo template::submit('pageEditSubmit', [
|
||||
'value' => 'Ok'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::checkbox('searchMotentier', true, 'Mot entier uniquement', [
|
||||
'checked' => $module::$motentier
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo $module::$resultTitle; ?></h4>
|
||||
<?php if (!empty($module::$resultList)) {
|
||||
echo $module::$resultList;
|
||||
} else {
|
||||
echo "Rien à afficher";
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
Loading…
Reference in New Issue
Block a user