66,29 → 66,6 |
return $masque; |
} |
|
/*private function obtenirChaineRecherche() { |
$chaine = ''; |
if (!is_null($this->chaine_recherche)) { |
$chaine = $this->chaine_recherche; |
} else if (isset($_GET['recherche'])) { |
// Pré-traitement de la chaine de recherche |
$chaine = $_GET['recherche']; |
// Suppression des slash ajouté automatiquement par PHP devant les guillemets |
$chaine = stripslashes($chaine); |
// Mémorisation de la chaine |
$this->memoriserChaineRecherche($chaine); |
// Stockage dans la classe pour éviter d'effectuer à nouveau le traitement ci-dessus |
$this->chaine_recherche = $chaine; |
} else if (isset($_SESSION['col']['recherche'])) { |
$chaine = $_SESSION['col']['recherche']; |
} |
return $chaine; |
}*/ |
|
/*private function memoriserChaineRecherche($chaine) { |
$_SESSION['col']['recherche'] = $chaine; |
}*/ |
|
public static function getUrlExemple($chaine) { |
$url = ''; |
if (!is_null(self::$url_exemple)) { |
111,14 → 88,6 |
$donnees['masque'] = $masque; |
$rechercheDao = new RechercheDao(); |
$parametres = array('mots' => '*'); |
|
// Récupération des paramêtres de l'url |
/*$chaine_de_recherche = $this->obtenirChaineRecherche(); |
echo "CH RECH: $chaine_de_recherche<br/>"; |
if (!empty($chaine_de_recherche)) { |
$this->url->setVariableRequete('recherche', $chaine_de_recherche); |
} |
$parametres = $this->parserChaineDeRecherche($chaine_de_recherche);*/ |
|
// Récupération des paramètres depuis le masque |
$parametres = $masque; |
229,31 → 198,6 |
} |
return $masque; |
} |
|
/*private function parserChaineDeRecherche($chaine) { |
$mots = preg_split('/ /i', $chaine, -1, PREG_SPLIT_NO_EMPTY); |
$parametres = array('mots' => ''); |
$cle_precedente = null; |
foreach ($mots as $mot) { |
if (preg_match('/^(sci|veg|bot|zg|p|pr|str-d):(.*)$/', $mot, $match)) { |
$cle = $match[1]; |
$cle_precedente = $cle; |
$valeur = $match[2]; |
$parametres[$cle] = $valeur; |
} else if (!is_null($cle_precedente)) { |
$parametres[$cle_precedente] .= ' '.$mot; |
} else if (is_null($cle_precedente)) { |
if (empty($parametres['mots'])) { |
$parametres['mots'] = $mot; |
} else { |
$parametres['mots'] .= ' '.$mot; |
} |
} |
} |
$this->remplacerAbreviationParId($parametres); |
|
return $parametres; |
}*/ |
|
private function remplacerAbreviationParId(&$parametres) { |
// liste 27 : Liste des relations entre une collection et une personne (id:1030) |