Subversion Repositories Applications.bazar

Rev

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

Rev 54 Rev 57
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bazar.fonct.formulaire.php,v 1.9 2005-11-24 16:17:13 florian Exp $
22
// CVS : $Id: bazar.fonct.formulaire.php,v 1.10 2005-12-01 16:05:41 florian Exp $
23
/**
23
/**
24
* Formulaire
24
* Formulaire
25
*
25
*
26
* Les fonctions de mise en page des formulaire
26
* Les fonctions de mise en page des formulaire
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
30
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aleandre GRANIER <alexandre@tela-botanica.org>
32
*@author        Aleandre GRANIER <alexandre@tela-botanica.org>
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.9 $ $Date: 2005-11-24 16:17:13 $
34
*@version       $Revision: 1.10 $ $Date: 2005-12-01 16:05:41 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
Line 59... Line 59...
59
	}
59
	}
60
	while ($ligne = $resultat->fetchRow()) {
60
	while ($ligne = $resultat->fetchRow()) {
61
		$select[$ligne[0]] = $ligne[1] ;
61
		$select[$ligne[0]] = $ligne[1] ;
62
	}
62
	}
63
	$option=array('style'=>'width: '.$limite1.'px;');
63
	$option=array('style'=>'width: '.$limite1.'px;');
64
	require_once PAP_CHEMIN_RACINE.'api/pear/HTML/QuickForm/select.php';
64
	require_once 'HTML/QuickForm/select.php';
65
	$select= new HTML_QuickForm_select($nom_bdd, constant($label), $select, $option);
65
	$select= new HTML_QuickForm_select($nom_bdd, constant($label), $select, $option);
66
	$select->setSize($limite2); 
66
	$select->setSize($limite2); 
67
	$select->setMultiple(0);
67
	$select->setMultiple(0);
68
	$select->setSelected($defaut);
68
	$select->setSelected($defaut);
69
	$formtemplate->addElement($select) ;
69
	$formtemplate->addElement($select) ;
Line 93... Line 93...
93
	$requete = 'SELECT * FROM '.$source;
93
	$requete = 'SELECT * FROM '.$source;
94
	$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
94
	$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
95
	if (DB::isError ($resultat)) {
95
	if (DB::isError ($resultat)) {
96
		die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ;
96
		die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ;
97
	}
97
	}
98
	require_once PAP_CHEMIN_RACINE.'api/pear/HTML/QuickForm/advcheckbox.php' ;
98
	require_once 'HTML/QuickForm/advcheckbox.php' ;
99
	$i=0;
99
	$i=0;
100
	while ($ligne = $resultat->fetchRow()) {
100
	while ($ligne = $resultat->fetchRow()) {
101
		//$chkbox[$ligne[0]] = $ligne[1] ;
101
		//$chkbox[$ligne[0]] = $ligne[1] ;
102
		if ($i==0) $labelchkbox=constant($label) ; else $labelchkbox='&nbsp;' ;
102
		if ($i==0) $labelchkbox=constant($label) ; else $labelchkbox='&nbsp;' ;
103
		$checkbox[]= & HTML_Quickform::createElement('checkbox', $ligne[0], $labelchkbox, $ligne[1], array ('style'=>'display:inline;margin-left:2px;')) ;		
103
		$checkbox[]= & HTML_Quickform::createElement('checkbox', $ligne[0], $labelchkbox, $ligne[1], array ('style'=>'display:inline;margin-left:2px;')) ;		
Line 211... Line 211...
211
* @param    string  table source pour les valeurs du texte (pas utilisé)
211
* @param    string  table source pour les valeurs du texte (pas utilisé)
212
* @param    string  ce champs est il obligatoire? (required) (pas utilisé)
212
* @param    string  ce champs est il obligatoire? (required) (pas utilisé)
213
* @return   void
213
* @return   void
214
*/
214
*/
215
function labelhtml(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) {
215
function labelhtml(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) {
216
	require_once PAP_CHEMIN_RACINE.'api/pear/HTML/QuickForm/html.php';
216
	require_once 'HTML/QuickForm/html.php';
217
	$formhtml= new HTML_QuickForm_html('<li>'.constant($label).'</li>'."\n");
217
	$formhtml= new HTML_QuickForm_html('<li>'.constant($label).'</li>'."\n");
218
	$formtemplate->addElement($formhtml) ;
218
	$formtemplate->addElement($formhtml) ;
219
}
219
}
Line 220... Line 220...
220
 
220
 
221
/* +--Fin du code ----------------------------------------------------------------------------------------+
221
/* +--Fin du code ----------------------------------------------------------------------------------------+
222
*
222
*
-
 
223
* $Log: not supported by cvs2svn $
-
 
224
* Revision 1.9  2005/11/24 16:17:13  florian
-
 
225
* corrections bugs, ajout des cases à cocher
223
* $Log: not supported by cvs2svn $
226
*
224
* Revision 1.8  2005/11/18 16:03:23  florian
227
* Revision 1.8  2005/11/18 16:03:23  florian
225
* correction bug html entites
228
* correction bug html entites
226
*
229
*
227
* Revision 1.7  2005/11/07 17:51:06  florian
230
* Revision 1.7  2005/11/07 17:51:06  florian