Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 322 → Rev 323

/trunk/bibliotheque/bazarTemplate.class.php
20,7 → 20,7
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
 
// CVS : $Id: bazarTemplate.class.php,v 1.5 2007-08-27 12:33:40 alexandre_tb Exp $
// CVS : $Id: bazarTemplate.class.php,v 1.6 2007-10-22 10:09:21 florian Exp $
 
/**
* Application projet
33,7 → 33,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.5 $
*@version $Revision: 1.6 $
// +------------------------------------------------------------------------------------------------------+
*/
 
69,19 → 69,19
$this->_db = $objetDB ;
}
function getTemplate ($id_template, $lang='fr-FR', $categorie_nature = 0) {
function getTemplate ($id_template, $lang='fr-FR', $categorie_nature = 'toutes') {
$requete = 'select bt_template from bazar_template where bt_id_template='.$id_template.
' and bt_id_i18n like "'.$lang.'%"' ;
if($categorie_nature != 0)
' and bt_id_i18n like "'.$lang.'%" ' ;
if($categorie_nature != 'toutes')
$requete .= ' and bt_categorie_nature='.$categorie_nature ;
else //si toutes les catégories natures sont afficher, on affiche par défaut le template du numéro 1
$requete .= ' and bt_categorie_nature=1' ;
$resultat = $this->_db->query($requete) ;
if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template.
' et la langue: '.$lang.'<br />'.$requete) ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
 
return $ligne->bt_template ;
}
}