Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 391 → Rev 392

/trunk/bibliotheque/bazar.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.class.php,v 1.9 2007-10-10 13:27:06 alexandre_tb Exp $
// CVS : $Id: bazar.class.php,v 1.10 2008-09-17 14:08:45 alexandre_tb Exp $
/**
*
*@package bazar
27,7 → 27,7
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@author Florian Schmitt <florian@ecole-et-nature.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.9 $
*@version $Revision: 1.10 $
// +------------------------------------------------------------------------------------------------------+
*/
 
214,11 → 214,58
}
return $tableau_mail;
}
/**
* getMailAdmin Renvoie un tableau de mail des super administrateurs
*
* @global DB Un objet DB de PEAR $GLOBALS['_BAZAR_']['db']
*/
function getMailSuperAdmin() {
$requete = 'select '.BAZ_CHAMPS_EMAIL.' from '.BAZ_ANNUAIRE.', bazar_droits ' .
'where bd_niveau_droit="'.BAZ_DROIT_SUPER_ADMINISTRATEUR.'"' .
' and '.BAZ_CHAMPS_ID.'= bd_id_utilisateur';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete);
if (DB::isError($resultat)) $this->raiseError();
$tableau_mail = array();
if ($resultat->numRows() == 0) return false;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
array_push ($tableau_mail, $ligne[BAZ_CHAMPS_EMAIL]) ;
}
return $tableau_mail;
}
}
 
class Bazar_element {
function &factory($type, $options = false)
{
if (file_exists (BAZ_CHEMIN_APPLI."bibliotheque/elements/{$type}.php")) include_once BAZ_CHEMIN_APPLI."bibliotheque/elements/{$type}.php";
else return PEAR::raiseError("Impossible d inclure le fichier /{$type}.php", "Impossible d inclure le fichier ".
BAZ_CHEMIN_APPLI."bibliotheque/elements/{$type}.php<br />", null, null,
"Impossible d inclure le fichier /{$type}.php"
, 'PEAR_Error', true);;
$classname = "Bazar_{$type}";
 
if (!class_exists($classname)) {
$tmp = PEAR::raiseError(null, -2, null, null,
"la classe $classname n'existe pas"
, 'PEAR_Error', true);
return $tmp;
}
 
@$obj =& new $classname($options);
 
return $obj;
}
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.9 2007-10-10 13:27:06 alexandre_tb
* encodage et remplacement de die en return
*
* Revision 1.8 2007-10-01 10:35:14 alexandre_tb
* petit hack pour tester la presence de $GLOBALS['droit_depot'] qui indique le niveau de droit minimum pour pouvoir deposer une fiche.
*