Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 59 → Rev 60

/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.1 2004-12-23 20:05:17 jpm Exp $
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.2 2005-01-03 19:44:40 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.1 $ $Date: 2004-12-23 20:05:17 $
*@version $Revision: 1.2 $ $Date: 2005-01-03 19:44:40 $
// +------------------------------------------------------------------------------------------------------+
*/
 
50,9 → 50,11
// --------------------------------------------------------------------------------------------------------
// Création du formulaire
$sortie .= '<ul>';
// Ajout du paramêtre action à l'url courante.
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_RECH_NOM);
// Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
$form =& new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&amp;', '&', $GLOBALS['_EFLORE_']['objet_pear_url']->getUrl()));
$tab_index = MORE_FORM_MOTIF_TAB;
$form =& new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&amp;', '&', $GLOBALS['_EFLORE_']['url']->getUrl()));
$tab_index = EFLORE_RECH_NOM_FORM_TAB;
$squelette =& $form->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
$squelette->setElementTemplate( '<li>'."\n".
59,7 → 61,7
'{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 -->'.
'<!-- 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");
 
80,14 → 82,24
$id = 'eflore_type_nom';
$valeur = 'nom_scientifique';
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
$label = '';//<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_.'</label>';
$label = '';
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs);
 
$id = 'eflore_type_nom';
$valeur = 'nom_vernaculaire';
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
$label = '';//<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_.'</label>';
$label = '';
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_VER, $valeur, $aso_attributs);
if (isset($_REQUEST[$id])) {
switch ($_REQUEST[$id]) {
case 'nom_scientifique':
$form->setDefaults(array($id => 'nom_scientifique'));
break;
case 'nom_vernaculaire':
$form->setDefaults(array($id => 'nom_vernaculaire'));
break;
}
} else {
$form->setDefaults(array($id => 'nom_scientifique'));
}
 
$liste_type_nom_fin = '</ul>'."\n";
$form->addElement('html', $$liste_type_nom_fin);
106,10 → 118,42
$sortie .= $form->toHTML()."\n";
$sortie .= '</ul>';
 
// --------------------------------------------------------------------------------------------------------
// Lancement de la recherche
if (isset($_REQUEST['eflore_nom']) && $_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']));
//Analyse du squelette
require_once 'HTML/Template/IT.php';
$squelette = new HTML_Template_IT();
$squelette->setTemplate($contenu, true, true);
// Indique l'url pour obtenir fiche d'un nom
$squelette->setCurrentBlock('corps');
// Ajout du paramêtre action à l'url courante.
$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, '');
$squelette->setVariable('UrlFicheNom', $GLOBALS['_EFLORE_']['url']->getURL());
$squelette->parseCurrentBlock('corps');
// Récupère le bloc "corps"
$sortie .= $squelette->get();
} else if ($_REQUEST['eflore_type_nom'] == 'nom_vernaculaire') {
// Recherche sur les noms vernaculaires
}
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/12/23 20:05:17 jpm
* Début prise en maine eflore-consultation.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>