Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev 154 Rev 155
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.5 2005-02-22 17:43:53 jpm Exp $
24
// CVS : $Id: eflore_recherche_nomenclature.inc.php,v 1.6 2005-02-22 19:27:10 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.5 $ $Date: 2005-02-22 17:43:53 $
36
*@version       $Revision: 1.6 $ $Date: 2005-02-22 19:27:10 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
Line 39... Line 39...
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
Line 58... Line 58...
58
// Création du formulaire
58
// Création du formulaire
59
$sortie .= '<ul>';
59
$sortie .= '<ul>';
60
// Ajout du paramêtre action à l'url courante.
60
// Ajout du paramêtre action à l'url courante.
61
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_RECH_NOM);
61
$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()...
62
// Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
63
$form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&amp;', '&', $GLOBALS['_EFLORE_']['url']->getUrl()));
63
$eflore_form = new HTML_QuickForm('eflore_form_nomenclature', 'post', str_replace('&amp;', '&', $GLOBALS['_EFLORE_']['url']->getUrl()));
64
$tab_index = EFLORE_RECH_NOM_FORM_TAB;
64
$tab_index = EFLORE_RECH_NOM_FORM_TAB;
65
$squelette = $form->defaultRenderer();
65
$eflore_squelette = $eflore_form->defaultRenderer();
66
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
66
$eflore_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
67
$squelette->setElementTemplate( '<li>'."\n".
67
$eflore_squelette->setElementTemplate( '<li>'."\n".
68
                                '{label}'."\n".
68
                                '{label}'."\n".
69
                                '{element}'."\n".
69
                                '{element}'."\n".
70
                                '<!-- BEGIN required --><span class="symbole_obligatoire">'.EFLORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
70
                                '<!-- BEGIN required --><span class="symbole_obligatoire">'.EFLORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
71
                                '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
71
                                '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
72
                                '</li>'."\n");
72
                                '</li>'."\n");
73
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
73
$eflore_form->accept($eflore_squelette);
-
 
74
$eflore_form->removeAttribute('name');
Line 74... Line 75...
74
 
75
 
75
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n";
76
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n";
Line 76... Line 77...
76
$form->addElement('html', $partie_menu_debut);
77
$eflore_form->addElement('html', $partie_menu_debut);
77
 
78
 
78
$id = 'eflore_nom';
79
$id = 'eflore_nom';
79
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++, 
80
$aso_attributs = array( 'id'=>$id, 'class' => 'champ', 'tabindex' => $tab_index++, 
80
                        'size' => EFLORE_RECH_NOM_FORM_NOM_SIZE, 
81
                        'size' => EFLORE_RECH_NOM_FORM_NOM_SIZE, 
81
                        'maxlength' => EFLORE_RECH_NOM_FORM_NOM_MAXLENGTH,
82
                        'maxlength' => EFLORE_RECH_NOM_FORM_NOM_MAXLENGTH,
82
                        'onclick' => "javascript: this.value='';");
83
                        'onclick' => "javascript: this.value='';");
Line 83... Line 84...
83
$label = '<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_NOM.'</label>';
84
$label = '<label for="'.$id.'">'.EFLORE_LG_RECH_NOM_FORM_NOM.'</label>';
84
$form->addElement('text', $id, $label, $aso_attributs);
85
$eflore_form->addElement('text', $id, $label, $aso_attributs);
Line 85... Line 86...
85
 
86
 
86
$liste_type_nom_debut = '<ul>'."\n";
87
$liste_type_nom_debut = '<ul>'."\n";
87
$form->addElement('html', $liste_type_nom_debut);
88
$eflore_form->addElement('html', $liste_type_nom_debut);
88
 
89
 
89
$id = 'eflore_type_nom';
90
$id = 'eflore_type_nom';
-
 
91
$valeur = 'nom_scientifique';
90
$valeur = 'nom_scientifique';
92
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
91
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
93
$label = '';
92
$label = '';
94
$eflore_form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs);
93
$form->addElement('radio', $id, $label, EFLORE_LG_RECH_NOM_FORM_TYPE_NOM_SCI, $valeur, $aso_attributs);
95
 
94
$valeur = 'nom_vernaculaire';
96
$valeur = 'nom_vernaculaire';
95
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
97
$aso_attributs = array( 'id'=> $id, 'tabindex' => $tab_index++);
96
$label = '';
98
$label = '';
97
$form->addElement('radio', $id, $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);
98
if (isset($_REQUEST[$id])) {
100
if (isset($_REQUEST[$id])) {
99
    switch ($_REQUEST[$id]) {
101
    switch ($_REQUEST[$id]) {
100
        case 'nom_scientifique':
102
        case 'nom_scientifique':
101
            $form->setDefaults(array($id => 'nom_scientifique'));
103
            $form->setDefaults(array($id => 'nom_scientifique'));
102
            break;
104
            break;
103
        case 'nom_vernaculaire':
105
        case 'nom_vernaculaire':
104
            $form->setDefaults(array($id => 'nom_vernaculaire'));
106
            $form->setDefaults(array($id => 'nom_vernaculaire'));
105
            break;
107
            break;
Line 106... Line 108...
106
    }
108
    }
107
} else {
109
} else {
Line 108... Line 110...
108
    $form->setDefaults(array($id => 'nom_scientifique'));
110
    $eflore_form->setDefaults(array($id => 'nom_scientifique'));
109
}
111
}
110
 
112
 
Line 111... Line 113...
111
$liste_type_nom_fin = '</ul>'."\n";
113
$liste_type_nom_fin = '</ul>'."\n";
112
$form->addElement('html', $liste_type_nom_fin);
114
$eflore_form->addElement('html', $liste_type_nom_fin);
Line 113... Line 115...
113
 
115
 
114
$id = 'eflore_valider_nom';
116
$id = 'eflore_valider_nom';
115
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++);
117
$aso_attributs = array('id'=> $id, 'class' => 'champ', 'tabindex' => $tab_index++);
116
$form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs);
118
$eflore_form->addElement('submit', $id, EFLORE_LG_RECH_NOM_FORM_VALIDER, $aso_attributs);
Line 117... Line 119...
117
 
119
 
118
$partie_entete_fin = "\n".'</fieldset>';
120
$partie_entete_fin = "\n".'</fieldset>';
119
$form->addElement('html', $partie_entete_fin);
121
$eflore_form->addElement('html', $partie_entete_fin);
Line 120... Line 122...
120
 
122
 
121
// Instanciation avec les valeur par défaut
123
// Instanciation avec les valeur par défaut
122
if (isset($_SESSION['_EFLORE_']['rechercher'])) {
124
if (isset($_SESSION['_EFLORE_']['rechercher'])) {
Line 174... Line 176...
174
}
176
}
Line 175... Line 177...
175
 
177
 
176
/* +--Fin du code ----------------------------------------------------------------------------------------+
178
/* +--Fin du code ----------------------------------------------------------------------------------------+
177
*
179
*
-
 
180
* $Log: not supported by cvs2svn $
-
 
181
* Revision 1.5  2005/02/22 17:43:53  jpm
-
 
182
* Suppression de référence posant problème.
178
* $Log: not supported by cvs2svn $
183
*
179
* Revision 1.4  2005/02/15 13:00:23  jpm
184
* Revision 1.4  2005/02/15 13:00:23  jpm
180
* Ajout d'un test pour initialiser une variable.
185
* Ajout d'un test pour initialiser une variable.
181
*
186
*
182
* Revision 1.3  2005/01/28 19:47:55  jpm
187
* Revision 1.3  2005/01/28 19:47:55  jpm