Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 60 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.3                                                                                      |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of eFlore-consultation.                                                            |
// |                                                                                                      |
// | 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: eflore_recherche_nomenclature.inc.php,v 1.1 2004-12-23 20:05:17 jpm Exp $
/**
* Affichage du moteur de recherche nomenclatural et de ses résultats.
*
* Ce script fournit le code html correspondant aux moteurs de recherche nomenclatural et ses résultats.
*
*@package eFlore
//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-23 20:05:17 $
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTÊTE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+


// +------------------------------------------------------------------------------------------------------+
// |                                            CORPS du PROGRAMME                                        |
// +------------------------------------------------------------------------------------------------------+
$sortie .= '<h2>'.EFLORE_LG_RECH_NOM_TITRE.'</h2>';

// --------------------------------------------------------------------------------------------------------
// Création du formulaire
$sortie .= '<ul>';
// 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;
$squelette =& $form->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
$squelette->setElementTemplate( '<li>'."\n".
                                '{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 -->'.
                                '</li>'."\n");
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");

$partie_menu_debut = '<fieldset>'."\n".'<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n";
$form->addElement('html', $partie_menu_debut);

$id = 'eflore_nom';
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++, 
                        'size' => EFLORE_RECH_NOM_FORM_NOM_SIZE, 
                        'maxlength' => EFLORE_RECH_NOM_FORM_NOM_MAXLENGTH,
                        'onclick' => "javascript: this.value='';");
$label = '<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_NOM.'</label>';
$form->addElement('text', $id, $label, $aso_attributs);

$liste_type_nom_debut = '<ul>'."\n";
$form->addElement('html', $$liste_type_nom_debut);

$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>';
$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>';
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_VER, $valeur, $aso_attributs);

$liste_type_nom_fin = '</ul>'."\n";
$form->addElement('html', $$liste_type_nom_fin);

$id = 'eflore_valider';
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++);
$form->addElement('submit', $id, EFLORE_LG_RECH_NOM_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
$sortie .= $form->toHTML()."\n";
$sortie .= '</ul>';

/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>