Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 126 → Rev 127

/trunk/eflore_recherche_nomenclature.inc.php
21,7 → 21,7
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.2 2005-01-03 19:44:40 jpm Exp $
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.3 2005-01-28 19:47:55 jpm Exp $
/**
* Affichage du moteur de recherche nomenclatural et de ses résultats.
*
33,7 → 33,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $ $Date: 2005-01-03 19:44:40 $
*@version $Revision: 1.3 $ $Date: 2005-01-28 19:47:55 $
// +------------------------------------------------------------------------------------------------------+
*/
 
41,6 → 41,13
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
function remplacerUrlFicheNom($arguments) {
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_FICHE);
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ONGLET, EFLORE_LG_URL_ONGLET_SYNTHESE);
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NN, $arguments[0]);
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NVP, $arguments[1]);
return $GLOBALS['_EFLORE_']['url']->getURL();
}
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
60,7 → 67,7
$squelette->setElementTemplate( '<li>'."\n".
'{label}'."\n".
'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">'.EFLORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
77,7 → 84,7
$form->addElement('text', $id, $label, $aso_attributs);
 
$liste_type_nom_debut = '<ul>'."\n";
$form->addElement('html', $$liste_type_nom_debut);
$form->addElement('html', $liste_type_nom_debut);
 
$id = 'eflore_type_nom';
$valeur = 'nom_scientifique';
102,9 → 109,9
}
 
$liste_type_nom_fin = '</ul>'."\n";
$form->addElement('html', $$liste_type_nom_fin);
$form->addElement('html', $liste_type_nom_fin);
 
$id = 'eflore_valider';
$id = 'eflore_valider_nom';
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++);
$form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs);
 
112,23 → 119,25
$form->addElement('html', $partie_entete_fin);
 
// Instanciation avec les valeur par défaut
$form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']);
$form->setDefaults($_SESSION['_EFLORE_']['rechercher']);
 
// Transformation en XHTML du formulaire
$sortie .= $form->toHTML()."\n";
$sortie .= '</ul>';
$sortie .= '</ul>'."\n";
 
// --------------------------------------------------------------------------------------------------------
// Lancement de la recherche
if (isset($_REQUEST['eflore_nom']) && $_REQUEST['eflore_nom'] != '') {
if (isset($_REQUEST['eflore_nom']) && $_REQUEST['eflore_nom'] != '' && !eregi("^%{1,}$", $_REQUEST['eflore_nom']) ) {
// Formatage de la chaine à rechercher
$_REQUEST['eflore_nom'] = '%'.str_replace(' ', '%', $_REQUEST['eflore_nom']).'%';
if ($_REQUEST['eflore_type_nom'] == 'nom_scientifique') {
// Recherche sur les noms scientifiques
$contenu = file_get_contents(sprintf(EFLORE_URL_LISTE_NOM_LATIN, $_REQUEST['eflore_nom']));
$contenu = file_get_contents(sprintf(EFLORE_URL_LISTE_NOM_LATIN, rawurlencode($_REQUEST['eflore_nom'])));
//Analyse du squelette
require_once 'HTML/Template/IT.php';
$squelette = new HTML_Template_IT();
$squelette->setTemplate($contenu, true, true);
$squelette->setTemplate($contenu, FALSE, FALSE);
// Indique l'url pour obtenir fiche d'un nom
$squelette->setCurrentBlock('corps');
140,10 → 149,25
$squelette->parseCurrentBlock('corps');
// Récupère le bloc "corps"
$sortie .= $squelette->get();
$sortie .= $squelette->get('corps');
} else if ($_REQUEST['eflore_type_nom'] == 'nom_vernaculaire') {
// Recherche sur les noms vernaculaires
$contenu = file_get_contents(sprintf(EFLORE_URL_LISTE_NOM_VERNA, rawurlencode($_REQUEST['eflore_nom'])));
//Analyse du squelette
require_once 'HTML/Template/ITX.php';
$squelette = new HTML_Template_ITX();
$squelette->setTemplate($contenu, FALSE, FALSE);
// Indique l'url pour obtenir fiche d'un nom
$squelette->setCurrentBlock('corps');
$squelette->setCallbackFunction('UrlFicheNom', 'remplacerUrlFicheNom');
$squelette->performCallback();
$squelette->parseCurrentBlock('corps');
// Récupère le bloc "corps"
$sortie .= $squelette->get('corps');
}
}
 
150,6 → 174,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/01/03 19:44:40 jpm
* Ajout de la gestion de l'action "fiche".
*
* Revision 1.1 2004/12/23 20:05:17 jpm
* Début prise en maine eflore-consultation.
*