forked from ZwiiCMS-Team/ZwiiCMS
Rechercher de phrase exacte entre guillemets
This commit is contained in:
parent
590daa8b89
commit
36a2c0fcde
@ -38,6 +38,10 @@ class search extends common {
|
|||||||
400 => '400 caractères',
|
400 => '400 caractères',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Message par défaut
|
||||||
|
public static $messagePlaceHolder = 'Un ou plusieurs mots-clés entre des espaces ou des guillemets';
|
||||||
|
public static $messageButtontext = 'Rechercher';
|
||||||
|
|
||||||
const SEARCH_VERSION = '1.1';
|
const SEARCH_VERSION = '1.1';
|
||||||
|
|
||||||
// Configuration vide
|
// Configuration vide
|
||||||
@ -212,9 +216,11 @@ class search extends common {
|
|||||||
// Accentuation
|
// Accentuation
|
||||||
$contenu = html_entity_decode($contenu);
|
$contenu = html_entity_decode($contenu);
|
||||||
|
|
||||||
|
// Découper le chaîne en tenant compte des quillemets
|
||||||
|
$a = str_getcsv(html_entity_decode($motclef), ' ');
|
||||||
|
|
||||||
// Construire la clé de recherche selon options de recherche
|
// Construire la clé de recherche selon options de recherche
|
||||||
$keywords = '/(';
|
$keywords = '/(';
|
||||||
$a = explode(' ',$motclef);
|
|
||||||
foreach ($a as $key => $value) {
|
foreach ($a as $key => $value) {
|
||||||
$keywords .= $motentier === true ? $value . '|' : '\b' . $value . '\b|' ;
|
$keywords .= $motentier === true ? $value . '|' : '\b' . $value . '\b|' ;
|
||||||
}
|
}
|
||||||
|
@ -4,19 +4,19 @@
|
|||||||
<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']) : 'Un plusieurs mots-clés séparés par un espace ou par +',
|
'placeholder' => $this->getData(['module', $this->getUrl(0), 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'placeHolder']) : $module::$messagePlaceHolder,
|
||||||
'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']) : 'Rechercher'
|
'value' => $this->getData(['module', $this->getUrl(0), 'submitText']) ? $this->getData(['module', $this->getUrl(0), 'submitText']) : $module::$messageButtontext
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::checkbox('searchMotentier', true, 'Mots clés approchants', [
|
<?php echo template::checkbox('searchMotentier', true, 'Mots approchants', [
|
||||||
'checked' => $module::$motentier,
|
'checked' => $module::$motentier,
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user