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.6 2005-02-22 19:27:10 jpm Exp $ |
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.5 2005-02-22 17:43:53 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.6 $ $Date: 2005-02-22 19:27:10 $ |
*@version $Revision: 1.5 $ $Date: 2005-02-22 17:43:53 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
60,21 → 60,20 |
// 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 & à nouveau par des & solution utiliser str_replace()... |
$eflore_form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&', '&', $GLOBALS['_EFLORE_']['url']->getUrl())); |
$form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&', '&', $GLOBALS['_EFLORE_']['url']->getUrl())); |
$tab_index = EFLORE_RECH_NOM_FORM_TAB; |
$eflore_squelette = $eflore_form->defaultRenderer(); |
$eflore_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'); |
$eflore_squelette->setElementTemplate( '<li>'."\n". |
$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">'.EFLORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
'</li>'."\n"); |
$eflore_form->accept($eflore_squelette); |
$eflore_form->removeAttribute('name'); |
//$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"; |
$eflore_form->addElement('html', $partie_menu_debut); |
$form->addElement('html', $partie_menu_debut); |
|
$id = 'eflore_nom'; |
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++, |
82,21 → 81,20 |
'maxlength' => EFLORE_RECH_NOM_FORM_NOM_MAXLENGTH, |
'onclick' => "javascript: this.value='';"); |
$label = '<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_NOM.'</label>'; |
$eflore_form->addElement('text', $id, $label, $aso_attributs); |
$form->addElement('text', $id, $label, $aso_attributs); |
|
$liste_type_nom_debut = '<ul>'."\n"; |
$eflore_form->addElement('html', $liste_type_nom_debut); |
$form->addElement('html', $liste_type_nom_debut); |
|
$id = 'eflore_type_nom'; |
$valeur = 'nom_scientifique'; |
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++); |
$label = ''; |
$eflore_form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs); |
|
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs); |
$valeur = 'nom_vernaculaire'; |
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++); |
$label = ''; |
$eflore_form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_VER, $valeur, $aso_attributs); |
$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': |
107,26 → 105,26 |
break; |
} |
} else { |
$eflore_form->setDefaults(array($id => 'nom_scientifique')); |
$form->setDefaults(array($id => 'nom_scientifique')); |
} |
|
$liste_type_nom_fin = '</ul>'."\n"; |
$eflore_form->addElement('html', $liste_type_nom_fin); |
$form->addElement('html', $liste_type_nom_fin); |
|
$id = 'eflore_valider_nom'; |
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++); |
$eflore_form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs); |
$form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs); |
|
$partie_entete_fin = "\n".'</fieldset>'; |
$eflore_form->addElement('html', $partie_entete_fin); |
$form->addElement('html', $partie_entete_fin); |
|
// Instanciation avec les valeur par défaut |
if (isset($_SESSION['_EFLORE_']['rechercher'])) { |
$eflore_form->setDefaults($_SESSION['_EFLORE_']['rechercher']); |
$form->setDefaults($_SESSION['_EFLORE_']['rechercher']); |
} |
|
// Transformation en XHTML du formulaire |
$sortie .= $eflore_form->toHTML()."\n"; |
$sortie .= $form->toHTML()."\n"; |
$sortie .= '</ul>'."\n"; |
|
// -------------------------------------------------------------------------------------------------------- |
178,9 → 176,6 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2005/02/22 17:43:53 jpm |
* Suppression de référence posant problème. |
* |
* Revision 1.4 2005/02/15 13:00:23 jpm |
* Ajout d'un test pour initialiser une variable. |
* |