Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 159 | Rev 168 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 159 Rev 162
Line 19... Line 19...
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.8 2005-02-28 15:38:47 jpm Exp $
24
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.9 2005-03-15 12:57:16 jpm Exp $
25
/**
25
/**
26
* Affichage du moteur de recherche nomenclatural et de ses résultats.
26
* Affichage du moteur de recherche nomenclatural et de ses résultats.
27
*
27
*
28
* Ce script fournit le code html correspondant aux moteurs de recherche nomenclatural et ses résultats.
28
* Ce script fournit le code html correspondant aux moteurs de recherche nomenclatural et ses résultats.
29
*
29
*
Line 31... Line 31...
31
//Auteur original :
31
//Auteur original :
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Aucun
34
*@author        Aucun
35
*@copyright     Tela-Botanica 2000-2004
35
*@copyright     Tela-Botanica 2000-2004
36
*@version       $Revision: 1.8 $ $Date: 2005-02-28 15:38:47 $
36
*@version       $Revision: 1.9 $ $Date: 2005-03-15 12:57:16 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
Line 39... Line 39...
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
Line 54... Line 54...
54
// +------------------------------------------------------------------------------------------------------+
54
// +------------------------------------------------------------------------------------------------------+
55
$sortie .= '<h2>'.EFLORE_LG_RECH_NOM_TITRE.'</h2>';
55
$sortie .= '<h2>'.EFLORE_LG_RECH_NOM_TITRE.'</h2>';
Line 56... Line 56...
56
 
56
 
57
// --------------------------------------------------------------------------------------------------------
57
// --------------------------------------------------------------------------------------------------------
58
// Création du formulaire
-
 
59
$sortie .= '<ul>';
58
// Création du formulaire
60
// Ajout du paramêtre action à l'url courante.
59
// Ajout du paramêtre action à l'url courante.
61
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_RECH_NOM);
60
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_RECH_NOM);
62
// Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
61
// Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
63
$eflore_form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&amp;', '&', $GLOBALS['_EFLORE_']['url']->getUrl()));
62
$eflore_form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&amp;', '&', $GLOBALS['_EFLORE_']['url']->getUrl()));
Line 71... Line 70...
71
                                '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
70
                                '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
72
                                '</li>'."\n");
71
                                '</li>'."\n");
73
$eflore_form->accept($eflore_squelette);
72
$eflore_form->accept($eflore_squelette);
74
$eflore_form->removeAttribute('name');
73
$eflore_form->removeAttribute('name');
Line 75... Line 74...
75
 
74
 
76
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n";
75
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend><ul>'."\n";
Line 77... Line 76...
77
$eflore_form->addElement('html', $partie_menu_debut);
76
$eflore_form->addElement('html', $partie_menu_debut);
78
 
77
 
79
$id = 'eflore_nom';
78
$id = 'eflore_nom';
80
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++, 
79
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++, 
81
                        'size' => EFLORE_RECH_NOM_FORM_NOM_SIZE, 
80
                        'size' => EFLORE_RECH_NOM_FORM_NOM_SIZE, 
82
                        'maxlength' => EFLORE_RECH_NOM_FORM_NOM_MAXLENGTH,
81
                        'maxlength' => EFLORE_RECH_NOM_FORM_NOM_MAXLENGTH,
83
                        'onclick' => "javascript: this.value='';");
82
                        'onclick' => "javascript: this.value='';");
Line 84... Line 83...
84
$label = '<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_NOM.'</label>';
83
$label = '<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_NOM.'</label>';
85
$eflore_form->addElement('text', $id, $label, $aso_attributs);
84
$eflore_form->addElement('text', $id, $label, $aso_attributs);
Line -... Line 85...
-
 
85
 
86
 
86
$liste_type_nom_debut = '<li><ul>'."\n";
87
$liste_type_nom_debut = '<ul>'."\n";
87
$eflore_form->addElement('html', $liste_type_nom_debut);
88
$eflore_form->addElement('html', $liste_type_nom_debut);
88
 
89
 
89
$id = 'eflore_type_nom_scientifique';
90
$id = 'eflore_type_nom';
90
$name = 'eflore_type_nom';
Line -... Line 91...
-
 
91
$valeur = 'nom_scientifique';
-
 
92
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
91
$valeur = 'nom_scientifique';
93
$label = '';
92
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
94
$eflore_form->addElement('radio', $name, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs);
93
$label = '';
95
 
94
$eflore_form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs);
96
$id = 'eflore_type_nom_vernaculaire';
-
 
97
$name = 'eflore_type_nom';
95
 
98
$valeur = 'nom_vernaculaire';
96
$valeur = 'nom_vernaculaire';
99
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
97
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
100
$label = '';
98
$label = '';
101
$eflore_form->addElement('radio', $name, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_VER, $valeur, $aso_attributs);
99
$eflore_form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_VER, $valeur, $aso_attributs);
102
 
100
if (isset($_REQUEST[$id])) {
103
if (isset($_REQUEST[$name])) {
101
    switch ($_REQUEST[$id]) {
104
    switch ($_REQUEST[$name]) {
102
        case 'nom_scientifique':
105
        case 'nom_scientifique' :
103
            $eflore_form->setDefaults(array($id => 'nom_scientifique'));
106
            $eflore_form->setDefaults(array($name => 'nom_scientifique'));
104
            break;
107
            break;
105
        case 'nom_vernaculaire':
108
        case 'nom_vernaculaire' :
106
            $eflore_form->setDefaults(array($id => 'nom_vernaculaire'));
109
            $eflore_form->setDefaults(array($name => 'nom_vernaculaire'));
Line 107... Line 110...
107
            break;
110
            break;
108
    }
111
    }
Line 109... Line 112...
109
} else {
112
} else {
110
    $eflore_form->setDefaults(array($id => 'nom_scientifique'));
113
    $eflore_form->setDefaults(array($name => 'nom_scientifique'));
111
}
114
}
Line 112... Line 115...
112
 
115
 
113
$liste_type_nom_fin = '</ul>'."\n";
116
$liste_type_nom_fin = '</ul></li>'."\n";
Line 114... Line 117...
114
$eflore_form->addElement('html', $liste_type_nom_fin);
117
$eflore_form->addElement('html', $liste_type_nom_fin);
115
 
118
 
116
$id = 'eflore_valider_nom';
119
$id = 'eflore_valider_nom';
117
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++);
120
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++);
Line 118... Line 121...
118
$eflore_form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs);
121
$eflore_form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs);
119
 
122
 
120
$partie_entete_fin = "\n".'</fieldset>';
-
 
Line 121... Line 123...
121
$eflore_form->addElement('html', $partie_entete_fin);
123
$partie_entete_fin = "\n".'</ul></fieldset>';
122
 
124
$eflore_form->addElement('html', $partie_entete_fin);
123
// Instanciation avec les valeur par défaut
125
 
124
if (isset($_SESSION['_EFLORE_']['rechercher'])) {
126
// Instanciation avec les valeur par défaut
Line 176... Line 178...
176
}
178
}
Line 177... Line 179...
177
 
179
 
178
/* +--Fin du code ----------------------------------------------------------------------------------------+
180
/* +--Fin du code ----------------------------------------------------------------------------------------+
179
*
181
*
-
 
182
* $Log: not supported by cvs2svn $
-
 
183
* Revision 1.8  2005/02/28 15:38:47  jpm
-
 
184
* Correction erreur due à un changement de nom.
180
* $Log: not supported by cvs2svn $
185
*
181
* Revision 1.7  2005/02/23 12:39:27  jpm
186
* Revision 1.7  2005/02/23 12:39:27  jpm
182
* Correction bogue lié à QuickForm.
187
* Correction bogue lié à QuickForm.
183
*
188
*
184
* Revision 1.6  2005/02/22 19:27:10  jpm
189
* Revision 1.6  2005/02/22 19:27:10  jpm