Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 154 → Rev 155

/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.5 2005-02-22 17:43:53 jpm Exp $
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.6 2005-02-22 19:27:10 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.5 $ $Date: 2005-02-22 17:43:53 $
*@version $Revision: 1.6 $ $Date: 2005-02-22 19:27:10 $
// +------------------------------------------------------------------------------------------------------+
*/
 
60,20 → 60,21
// 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()...
$form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&', '&', $GLOBALS['_EFLORE_']['url']->getUrl()));
$eflore_form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&', '&', $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".
$eflore_squelette = $eflore_form->defaultRenderer();
$eflore_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
$eflore_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");
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
$eflore_form->accept($eflore_squelette);
$eflore_form->removeAttribute('name');
 
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n";
$form->addElement('html', $partie_menu_debut);
$eflore_form->addElement('html', $partie_menu_debut);
 
$id = 'eflore_nom';
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++,
81,20 → 82,21
'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);
$eflore_form->addElement('text', $id, $label, $aso_attributs);
 
$liste_type_nom_debut = '<ul>'."\n";
$form->addElement('html', $liste_type_nom_debut);
$eflore_form->addElement('html', $liste_type_nom_debut);
 
$id = 'eflore_type_nom';
$valeur = 'nom_scientifique';
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
$label = '';
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs);
$eflore_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 = '';
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_VER, $valeur, $aso_attributs);
$eflore_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':
105,26 → 107,26
break;
}
} else {
$form->setDefaults(array($id => 'nom_scientifique'));
$eflore_form->setDefaults(array($id => 'nom_scientifique'));
}
 
$liste_type_nom_fin = '</ul>'."\n";
$form->addElement('html', $liste_type_nom_fin);
$eflore_form->addElement('html', $liste_type_nom_fin);
 
$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);
$eflore_form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs);
 
$partie_entete_fin = "\n".'</fieldset>';
$form->addElement('html', $partie_entete_fin);
$eflore_form->addElement('html', $partie_entete_fin);
 
// Instanciation avec les valeur par défaut
if (isset($_SESSION['_EFLORE_']['rechercher'])) {
$form->setDefaults($_SESSION['_EFLORE_']['rechercher']);
$eflore_form->setDefaults($_SESSION['_EFLORE_']['rechercher']);
}
 
// Transformation en XHTML du formulaire
$sortie .= $form->toHTML()."\n";
$sortie .= $eflore_form->toHTML()."\n";
$sortie .= '</ul>'."\n";
 
// --------------------------------------------------------------------------------------------------------
176,6 → 178,9
/* +--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.
*