/trunk/papyrus/applettes/moteur_recherche/configuration/more_configuration.inc.php |
---|
New file |
0,0 → 1,78 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_configuration.inc.php,v 1.1 2004-12-07 10:24:12 jpm Exp $ |
/** |
* Fichier de configuration général de l'applette Moteur_Recherche. |
* |
* Permet de définir certains paramètres valables pour toutes l'applette MORE. |
* |
*@package Applette |
*@subpackage Moteur_Recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-12-07 10:24:12 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Constante stockant la valeur de la langue par défaut pour l'applette MORE.*/ |
define('MORE_I18N_DEFAUT', GEN_I18N_ID_DEFAUT); |
// Chemin des fichiers à inclure. |
/** Chemin vers la bibliothèque PEAR.*/ |
define('MORE_CHEMIN_BIBLIOTHEQUE_PEAR', ''); |
// Chemin vers les dossiers de l'applette |
/** Chemin vers l'applette Moteur de Recherche de Papyrus.*/ |
define('MORE_CHEMIN_APPLETTE', GEN_CHEMIN_APPLETTE.'moteur_recherche/'); |
/** Chemin vers les fichiers de traduction de l'applette Moteur de Recherche de Papyrus.*/ |
define('MORE_CHEMIN_LANGUE', MORE_CHEMIN_APPLETTE.'langues/'); |
/** Chemin vers les fichiers de la bibliotheque de l'applette Moteur de Recherche de Papyrus.*/ |
define('MORE_CHEMIN_BIBLIO', MORE_CHEMIN_APPLETTE.'bibliotheque/'); |
// Configuration du formulaire de recherche |
/** Valeur de départ des tabulations pour le formulaire de recherche.*/ |
define('MORE_FORM_MOTIF_TAB', 100); |
/** Taille de la zone de saisie de texte du formulaire de recherche.*/ |
define('MORE_FORM_MOTIF_SIZE', 20); |
/** Nombre de caractères maximum pouvant être saisis dans la zone de texte du formulaire de recherche.*/ |
define('MORE_FORM_MOTIF_MAXLENGTH', 100); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/moteur_recherche/moteur_recherche.php |
---|
New file |
0,0 → 1,211 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: moteur_recherche.php,v 1.1 2004-12-07 10:24:01 jpm Exp $ |
/** |
* Applette : moteur de recherche |
* |
* Génère un formulaire contenant une zone de saisie permettant de taper un texte à rechercher sur l'ensemble |
* des sites gérés par Papyrus. |
* |
*@package Applette |
*@subpackage Moteur_recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-12-07 10:24:01 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$_GEN_commun['info_applette_nom_fonction'] = 'afficherMoteurRecherche'; |
$_GEN_commun['info_applette_balise'] = 'MOTEUR_RECHERCHE'; |
// -------------------------------------------------------------------------------------------------------- |
/** Inclusion du fichier de configuration de cette application.*/ |
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_configuration.inc.php'; |
/** Inclusion de la bibliotheque permettant d'accéder aux fonctions sur les balises Meta.*/ |
//require_once GEN_CHEMIN_BIBLIO.'pap_meta.fonct.php'; |
//Utilisation de la bibliothèque PEAR NET_URL |
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/ |
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php'; |
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus |
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$_GEN_commun['i18n'].'.inc.php')) { |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/ |
require_once MORE_CHEMIN_LANGUE.'more_langue_'.$_GEN_commun['i18n'].'.inc.php'; |
} else { |
/** Inclusion du fichier de traduction par défaut.*/ |
require_once MORE_CHEMIN_LANGUE.'more_langue_'.MORE_I18N_DEFAUT.'.inc.php'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
if (isset($_POST['more_motif']) && $_POST['more_motif'] != '') { |
// Initialisation de variable extérieures |
$GLOBALS['_VEI_']['usurpation'] = 'Recherche de '.$_POST['more_motif']; |
$GLOBALS['_GEN_commun']['info_menu'] = null; |
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = null; |
// Titre de la page |
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = 'Résultat de la recherche de '.$_POST['more_motif']; |
// Modification des meta de l'entête de la page |
GEN_modifierMetaHttpEquiv('Content-Type', 'text/html; charset=iso-8859-15'); |
GEN_modifierMetaHttpEquiv('Content-style-type', 'text/css'); |
GEN_modifierMetaHttpEquiv('Content-script-type', 'text/javascript'); |
GEN_modifierMetaHttpEquiv('Content-language', $_GEN_commun['i18n']); |
GEN_modifierMetaName('revisit-after', '15 days'); |
GEN_modifierMetaName('robots', 'index,follow'); |
GEN_modifierMetaName('author', 'Tela Botanica'); |
GEN_modifierMetaName('keywords', 'Recherche, résultat.'); |
GEN_modifierMetaName('description', 'Page de résultats du moteur de recherche de Papyrus.'); |
GEN_viderMeta('dc'); |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/** Fonnction afficherMoteurRecherche() - Fournit un formulaire de recherche. |
* |
* Renvoie un formulaire permettant de rechercher une chaine de caractères dans les sites |
* gérés par Papyrus. |
* Necessite l'utilisation de Pear Net_URL par le programme appelant cette fonction. |
* |
* @param array tableau d'éventuel arguments présent dans la balise transmis à la fonction. |
* @param array tableau global de Papyrus. |
* @return string formulaire XHTML de recherche. |
*/ |
function afficherMoteurRecherche($tab_applette_arguments, $_GEN_commun) |
{ |
// -------------------------------------------------------------------------------------------------------- |
// Initialisation de variable de configuration. |
$liste_type_site = '102, 103';// Les id des types des sites pouvant apparaître dans le sélecteur |
$objet_pear_db = $_GEN_commun['pear_db'];//objet Pear créé par DB contenant la connexion à la base de données. |
$code_site = $_GEN_commun['url_site'];//identifiant du site courant. |
$id_langue = $_GEN_commun['url_i18n'];//identifiant de la langue principale du site courant. |
$GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] = $_GEN_commun['pear_db'];// Connexion à la BD de Papyrus |
$url = $_GEN_commun['url']; |
$url_base = PAP_URL; |
$url_cle_site = GEN_URL_CLE_SITE; |
$url_cle_i18n = GEN_URL_CLE_I18N; |
$url_id_type_site = GEN_URL_ID_TYPE_SITE; |
$indent_origine = 12;// Indentation de départ en nombre d'espace |
$indent_pas = 4;// Pas d'indentation en nombre d'espace |
$retour = ''; |
$retour_resultats = ''; |
// -------------------------------------------------------------------------------------------------------- |
// Lancement de la recherche si nécessaire |
$_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = ''; |
if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') { |
$_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE; |
} else { |
$_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = $_POST['more_motif']; |
/** Inclusion de la classe Recherche.*/ |
require_once MORE_CHEMIN_BIBLIO.'more_recherche.class.php'; |
/** Inclusion de la classe Recherche_Menu_Meta.*/ |
require_once MORE_CHEMIN_BIBLIO.'more_recherche_papyrus_menu.class.php'; |
$moteur = new Recherche($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']); |
$recherche_papyrus_menu = new Recherche_Papyrus_Menu($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']); |
$moteur->ajouterRecherche($recherche_papyrus_menu); |
$aso_resultats = $moteur->rechercherMotif(); |
//$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($aso_resultats, true).'</pre>'; |
$retour_resultats .= '<h1>'.MORE_LG_RESULTAT_TITRE.'</h1>'."\n"; |
$retour_resultats .= '<ul>'."\n"; |
foreach ($aso_resultats as $val) { |
if (!empty($val['url'])) { |
$retour_resultats .= '<li>'."\n"; |
$retour_resultats .= '<a href="'.$val['url'].'">'.$val['titre'].'</a> '.MORE_LG_RESULTAT_SEPARATEUR.' '; |
$retour_resultats .= MORE_LG_RESULTAT_POIDS.$val['poids']."\n"; |
$retour_resultats .= '</li>'."\n"; |
} |
} |
$retour_resultats .= '</ul>'."\n"; |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = ''; |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = ''; |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = $retour_resultats; |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = ''; |
$GLOBALS['_GEN_commun']['info_menu'] = ''; |
} |
// -------------------------------------------------------------------------------------------------------- |
// Création du formulaire de l'applette |
// Notes : Quickform semble remplacer les & des & à nouveau par des & solution utiliser str_replace()... |
$form =& new HTML_QuickForm('form_more_recherche', 'post', str_replace('&', '&', $url->getUrl())); |
$tab_index = MORE_FORM_MOTIF_TAB; |
$squelette =& $form->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'); |
$squelette->setElementTemplate( '{label}'."\n". |
'{element}'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n"); |
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n"); |
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n"; |
$form->addElement('html', $partie_menu_debut); |
$id = 'more_motif'; |
$aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'size' => MORE_FORM_MOTIF_SIZE, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH, |
'onclick' => "javascript: this.value='';"); |
$label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>'; |
$form->addElement('text', $id, $label, $aso_attributs); |
$id = 'more_ok'; |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++); |
$form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs); |
$partie_entete_fin = "\n".'</fieldset>'; |
$form->addElement('html', $partie_entete_fin); |
// Instanciation avec les valeur par défaut |
$form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']); |
// Transformation en XHTML du formulaire |
$retour .= $form->toHTML()."\n"; |
// -------------------------------------------------------------------------------------------------------- |
return $retour; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php |
---|
New file |
0,0 → 1,130 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_recherche.class.php,v 1.1 2004-12-07 10:24:06 jpm Exp $ |
/** |
* Classe permettant d'effectuer des recherches sur les métas informations des menus. |
* |
* Permet de rechercher et classer les menus en fonction d'une chaine. |
* |
*@package Applette |
*@subpackage Moteur_Recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-12-07 10:24:06 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
class Recherche { |
var $motif = ''; |
var $moteurs_recherches = array(); |
var $resultats = array(); |
// Constructeur |
function Recherche($motif) { |
$this->setMotif($motif); |
} |
// Accesseurs |
function getMotif() { |
return $this->motif; |
} |
function setMotif($motif) { |
$this->motif = $motif; |
} |
function getMoteurs() { |
return $this->moteurs_recherches; |
} |
function getMoteur($id) { |
return $this->moteurs_recherches[$id]; |
} |
function setMoteur($val) { |
$id_nouveau = count($this->moteurs_recherches); |
$this->moteurs_recherches[$id_nouveau] = $val; |
} |
function getResultats() { |
return $this->resultats; |
} |
function setResultats($val) { |
$this->resultats = $val; |
} |
function setResultat($aso_page) { |
$id_nouveau = count($this->resultats); |
$this->resultats[$id_nouveau] = $aso_page; |
} |
// Méthodes |
function ajouterRecherche(&$objet_recherche) { |
return $this->setMoteur($objet_recherche); |
} |
/* |
function supprimerRecherche($id_objet_recherche) { |
if (isset($this->getMoteur($id_objet_recherche))) { |
$this->setMoteur($id_objet_recherche, null); |
return true; |
} else { |
return false; |
} |
} |
*/ |
function rechercherMotif() { |
foreach ($this->getMoteurs() as $cle => $val) { |
$this->setResultats(array_merge($this->getResultats(), $val->rechercherMotif($this->getMotif()))); |
} |
$aso_resultats = $this->getResultats(); |
function comparer($a, $b) { |
if ($a['poids'] > $b['poids']) { |
return -1; |
} |
if ($a['poids'] < $b['poids']) { |
return +1; |
} |
if ($a['poids'] = $b['poids']) { |
return 0; |
} |
} |
usort($aso_resultats, 'comparer'); |
return $aso_resultats; |
} |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_papyrus_menu.class.php |
---|
New file |
0,0 → 1,118 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_recherche_papyrus_menu.class.php,v 1.1 2004-12-07 10:24:06 jpm Exp $ |
/** |
* Classe permettant d'effectuer des recherches sur les informations des menus de Papyrus. |
* |
* Permet de rechercher et classer les menus en fonction d'une chaine. |
* |
*@package Applette |
*@subpackage Moteur_Recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-12-07 10:24:06 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier contenant les fonctions de manipulations des menus de Papyrus.*/ |
require_once GEN_CHEMIN_BIBLIO.'pap_menu.fonct.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
class Recherche_Papyrus_Menu extends Recherche{ |
// Constructeur |
function Recherche_Menu_Meta($motif) { |
$this->setMotif($motif); |
} |
// Accesseurs |
function getMotif() { |
return $this->motif; |
} |
function setMotif($motif) { |
$this->motif = $motif; |
} |
// Méthodes |
function rechercherMotif($motif) { |
$db = $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus']; |
// Préparation de l'url de l'entrée |
$objet_pear_url = & new Net_URL('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); |
$champs_code_menu = (GEN_URL_ID_TYPE_MENU == 'int') ? 'gm_code_num' : 'gm_code_alpha'; |
$tab_menus = GEN_retournerMenus($db); |
foreach ($tab_menus as $cle => $menu_id) { |
// Initialisation du tableau de résultat vide |
$aso_resultat = array('poids' => 0, 'url' => '', 'titre' => ''); |
// Récupération des infos du menu courant |
$aso_menu_info = GEN_lireInfoMenu($db, $menu_id, DB_FETCHMODE_ASSOC); |
// Récupération du contenu du menu courant |
$aso_menu_contenu = GEN_lireContenuMenu($db, $menu_id, DB_FETCHMODE_ASSOC); |
// Construction de l'url de ce menu |
$objet_pear_url->addQueryString(GEN_URL_CLE_MENU, $aso_menu_info[$champs_code_menu]); |
$aso_resultat['url'] = $objet_pear_url->getURL(); |
// Récupération du titre de la page |
if ($aso_menu_info['gm_nom'] != '') { |
$aso_resultat['titre'] = $aso_menu_info['gm_nom']; |
} else if ($aso_menu_info['gm_titre'] != '') { |
$aso_resultat['titre'] = $aso_menu_info['gm_titre']; |
} else if ($aso_menu_info['gm_titre_alternatif'] != '') { |
$aso_resultat['titre'] = $aso_menu_info['gm_titre_alternatif']; |
} |
// Analyse du poids de cette page |
$tab_champs_a_visiter = array( 'gm_nom', 'gm_titre', 'gm_titre_alternatif', 'gm_mots_cles', |
'gm_description_libre', 'gm_description_resume', 'gm_description_table_matieres', |
'gm_source', 'gm_auteur', 'gm_contributeur', 'gm_editeur', 'gm_categorie', |
'gm_public'); |
foreach ($tab_champs_a_visiter as $val) { |
if (stristr($aso_menu_info[$val] , $motif)) { |
$aso_resultat['poids']++; |
} |
} |
$nbre_correspondance = preg_match_all('/'.$motif.'/i', $aso_menu_contenu['gmc_contenu'], $tab_morceaux); |
$aso_resultat['poids'] = $aso_resultat['poids'] + $nbre_correspondance; |
if ($aso_resultat['poids'] > 0) { |
$this->setResultat($aso_resultat); |
} |
} |
return $this->getResultats(); |
} |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/moteur_recherche/langues/more_langue_fr.inc.php |
---|
New file |
0,0 → 1,73 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_langue_fr.inc.php,v 1.1 2004-12-07 10:24:16 jpm Exp $ |
/** |
* Gestion des langues de l'applette Moteur_Recherche |
* |
* Contient les constantes pour la langue française de l'applette MORE. |
* |
*@package Applette |
*@subpackage Moteur_Recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-12-07 10:24:16 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Le formulaire de sélection du site dont les menus doivent être administrer : |
define('MORE_LG_FORM_TITRE', 'Moteur de recherche'); |
define('MORE_LG_FORM_MOTIF', 'Rechercher : '); |
define('MORE_LG_FORM_MOTIF_REGLE', 'Une chaine doit être saisie pour pouvoir lancer la recherche !'); |
define('MORE_LG_FORM_MOTIF_VALUE', 'Rechercher'); |
define('MORE_LG_FORM_VALIDER', 'ok'); |
define('MORE_LG_FORM_SYMBOLE_OBLIGATOIRE', '*'); |
// Les résultats de la recherche : |
define('MORE_LG_RESULTAT_TITRE', 'Résultats de la recherche'); |
define('MORE_LG_RESULTAT_POIDS', 'Poids : '); |
define('MORE_LG_RESULTAT_SEPARATEUR', '-'); |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |