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.class.php,v 1.9 2007-10-10 13:27:06 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.class.php,v 1.10 2008-09-17 14:08:45 alexandre_tb Exp $
|
23 |
/**
|
23 |
/**
|
24 |
*
|
24 |
*
|
25 |
*@package bazar
|
25 |
*@package bazar
|
26 |
//Auteur original :
|
26 |
//Auteur original :
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
29 |
*@copyright Tela-Botanica 2000-2004
|
29 |
*@copyright Tela-Botanica 2000-2004
|
30 |
*@version $Revision: 1.9 $
|
30 |
*@version $Revision: 1.10 $
|
31 |
// +------------------------------------------------------------------------------------------------------+
|
31 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
*/
|
32 |
*/
|
Line 33... |
Line 33... |
33 |
|
33 |
|
34 |
// +------------------------------------------------------------------------------------------------------+
|
34 |
// +------------------------------------------------------------------------------------------------------+
|
Line 212... |
Line 212... |
212 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
212 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
213 |
array_push ($tableau_mail, $ligne[BAZ_CHAMPS_EMAIL]) ;
|
213 |
array_push ($tableau_mail, $ligne[BAZ_CHAMPS_EMAIL]) ;
|
214 |
}
|
214 |
}
|
215 |
return $tableau_mail;
|
215 |
return $tableau_mail;
|
216 |
}
|
216 |
}
|
- |
|
217 |
|
- |
|
218 |
/**
|
- |
|
219 |
* getMailAdmin Renvoie un tableau de mail des super administrateurs
|
- |
|
220 |
*
|
- |
|
221 |
* @global DB Un objet DB de PEAR $GLOBALS['_BAZAR_']['db']
|
- |
|
222 |
*/
|
- |
|
223 |
function getMailSuperAdmin() {
|
- |
|
224 |
$requete = 'select '.BAZ_CHAMPS_EMAIL.' from '.BAZ_ANNUAIRE.', bazar_droits ' .
|
- |
|
225 |
'where bd_niveau_droit="'.BAZ_DROIT_SUPER_ADMINISTRATEUR.'"' .
|
- |
|
226 |
' and '.BAZ_CHAMPS_ID.'= bd_id_utilisateur';
|
- |
|
227 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete);
|
- |
|
228 |
if (DB::isError($resultat)) $this->raiseError();
|
- |
|
229 |
$tableau_mail = array();
|
- |
|
230 |
if ($resultat->numRows() == 0) return false;
|
- |
|
231 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
232 |
array_push ($tableau_mail, $ligne[BAZ_CHAMPS_EMAIL]) ;
|
- |
|
233 |
}
|
- |
|
234 |
return $tableau_mail;
|
- |
|
235 |
}
|
- |
|
236 |
}
|
- |
|
237 |
|
- |
|
238 |
class Bazar_element {
|
- |
|
239 |
|
- |
|
240 |
function &factory($type, $options = false)
|
- |
|
241 |
{
|
- |
|
242 |
|
- |
|
243 |
if (file_exists (BAZ_CHEMIN_APPLI."bibliotheque/elements/{$type}.php")) include_once BAZ_CHEMIN_APPLI."bibliotheque/elements/{$type}.php";
|
- |
|
244 |
else return PEAR::raiseError("Impossible d inclure le fichier /{$type}.php", "Impossible d inclure le fichier ".
|
- |
|
245 |
BAZ_CHEMIN_APPLI."bibliotheque/elements/{$type}.php<br />", null, null,
|
- |
|
246 |
"Impossible d inclure le fichier /{$type}.php"
|
- |
|
247 |
, 'PEAR_Error', true);;
|
- |
|
248 |
$classname = "Bazar_{$type}";
|
- |
|
249 |
|
- |
|
250 |
if (!class_exists($classname)) {
|
- |
|
251 |
$tmp = PEAR::raiseError(null, -2, null, null,
|
- |
|
252 |
"la classe $classname n'existe pas"
|
- |
|
253 |
, 'PEAR_Error', true);
|
- |
|
254 |
return $tmp;
|
- |
|
255 |
}
|
- |
|
256 |
|
- |
|
257 |
@$obj =& new $classname($options);
|
- |
|
258 |
|
- |
|
259 |
return $obj;
|
- |
|
260 |
}
|
217 |
}
|
261 |
}
|
Line 218... |
Line 262... |
218 |
|
262 |
|
219 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
263 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
220 |
*
|
264 |
*
|
- |
|
265 |
* $Log: not supported by cvs2svn $
|
- |
|
266 |
* Revision 1.9 2007-10-10 13:27:06 alexandre_tb
|
- |
|
267 |
* encodage et remplacement de die en return
|
221 |
* $Log: not supported by cvs2svn $
|
268 |
*
|
222 |
* Revision 1.8 2007-10-01 10:35:14 alexandre_tb
|
269 |
* Revision 1.8 2007-10-01 10:35:14 alexandre_tb
|
223 |
* petit hack pour tester la presence de $GLOBALS['droit_depot'] qui indique le niveau de droit minimum pour pouvoir deposer une fiche.
|
270 |
* petit hack pour tester la presence de $GLOBALS['droit_depot'] qui indique le niveau de droit minimum pour pouvoir deposer une fiche.
|
224 |
*
|
271 |
*
|
225 |
* Revision 1.7 2007-07-04 09:59:09 alexandre_tb
|
272 |
* Revision 1.7 2007-07-04 09:59:09 alexandre_tb
|