452 |
aurelien |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* PHP Version 5
|
|
|
4 |
*
|
|
|
5 |
* @category PHP
|
|
|
6 |
* @package bazar_bp
|
|
|
7 |
* @author aurelien <aurelien@tela-botanica.org>
|
|
|
8 |
* @copyright 2009 Tela-Botanica
|
|
|
9 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
|
|
|
10 |
* @version SVN: <svn_id>
|
|
|
11 |
* @link /doc/bazar_bp/
|
|
|
12 |
*/
|
|
|
13 |
|
|
|
14 |
include_once PAP_CHEMIN_API_PEAR.'PEAR.php';
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
class Bazar_radio extends PEAR {
|
|
|
18 |
|
|
|
19 |
var $option = array();
|
|
|
20 |
|
|
|
21 |
function Bazar_radio($options) {
|
|
|
22 |
$this->options = $options;
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
function toHTML($valeur) {
|
|
|
26 |
|
|
|
27 |
$html = '';
|
|
|
28 |
$val = $this->options['nom_bdd'];
|
|
|
29 |
//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id
|
|
|
30 |
$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.
|
|
|
31 |
$GLOBALS['_BAZAR_']['id_fiche'].' AND bfvl_ce_liste='.$this->options['nom_bdd'].
|
|
|
32 |
' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$this->options['nom_bdd'].
|
|
|
33 |
' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"';
|
|
|
34 |
|
|
|
35 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
|
|
36 |
if (DB::isError ($resultat)) {
|
|
|
37 |
return ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
|
|
38 |
}
|
|
|
39 |
$val='';$nb=0;
|
|
|
40 |
while ($tab = $resultat->fetchRow()) {
|
|
|
41 |
if ($nb>0) $val .= ', ';
|
|
|
42 |
$val .= $tab[0];
|
|
|
43 |
$nb++;
|
|
|
44 |
}
|
|
|
45 |
if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
|
|
|
46 |
$html .= '<div class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.
|
|
|
47 |
"\n".'<span class="BAZ_label" id="rubrique_'.$this->options['nom_bdd'].'">'.$this->options['label'].' : </span>'."\n";
|
|
|
48 |
$html .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="description_'.$this->options['nom_bdd'].
|
|
|
49 |
'"> '.$val.'</span>'."\n".'</div>'."\n";
|
|
|
50 |
}
|
|
|
51 |
return $html;
|
|
|
52 |
}
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
56 |
*
|
|
|
57 |
* $Log: not supported by cvs2svn $
|
|
|
58 |
* Revision 1.2 2008-09-17 14:18:12 alexandre_tb
|
|
|
59 |
* fusion avec aha
|
|
|
60 |
*
|
|
|
61 |
* Revision 1.1.2.1 2008-04-16 12:35:25 alexandre_tb
|
|
|
62 |
* version initiale
|
|
|
63 |
*
|
|
|
64 |
*
|
|
|
65 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
66 |
*/
|
|
|
67 |
?>
|
|
|
68 |
|
|
|
69 |
?>
|