Line 18... |
Line 18... |
18 |
// | You should have received a copy of the GNU General Public |
|
18 |
// | You should have received a copy of the GNU 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 |
// +------------------------------------------------------------------------------------------------------+
|
Line 22... |
Line 22... |
22 |
|
22 |
|
Line 23... |
Line 23... |
23 |
// CVS : $Id: bazarTemplate.class.php,v 1.5 2007-08-27 12:33:40 alexandre_tb Exp $
|
23 |
// CVS : $Id: bazarTemplate.class.php,v 1.6 2007-10-22 10:09:21 florian Exp $
|
24 |
|
24 |
|
25 |
/**
|
25 |
/**
|
26 |
* Application projet
|
26 |
* Application projet
|
Line 31... |
Line 31... |
31 |
//Auteur original :
|
31 |
//Auteur original :
|
32 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
32 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
33 |
//Autres auteurs :
|
33 |
//Autres auteurs :
|
34 |
*@author Aucun
|
34 |
*@author Aucun
|
35 |
*@copyright Tela-Botanica 2000-2004
|
35 |
*@copyright Tela-Botanica 2000-2004
|
36 |
*@version $Revision: 1.5 $
|
36 |
*@version $Revision: 1.6 $
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
*/
|
38 |
*/
|
Line 39... |
Line 39... |
39 |
|
39 |
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
Line 67... |
Line 67... |
67 |
|
67 |
|
68 |
function bazarTemplate(&$objetDB) {
|
68 |
function bazarTemplate(&$objetDB) {
|
69 |
$this->_db = $objetDB ;
|
69 |
$this->_db = $objetDB ;
|
Line 70... |
Line 70... |
70 |
}
|
70 |
}
|
71 |
|
71 |
|
72 |
function getTemplate ($id_template, $lang='fr-FR', $categorie_nature = 0) {
|
72 |
function getTemplate ($id_template, $lang='fr-FR', $categorie_nature = 'toutes') {
|
73 |
$requete = 'select bt_template from bazar_template where bt_id_template='.$id_template.
|
- |
|
74 |
' and bt_id_i18n like "'.$lang.'%"' ;
|
73 |
$requete = 'select bt_template from bazar_template where bt_id_template='.$id_template.
|
75 |
|
74 |
' and bt_id_i18n like "'.$lang.'%" ' ;
|
76 |
if($categorie_nature != 0)
|
- |
|
- |
|
75 |
if($categorie_nature != 'toutes')
|
- |
|
76 |
$requete .= ' and bt_categorie_nature='.$categorie_nature ;
|
77 |
$requete .= ' and bt_categorie_nature='.$categorie_nature ;
|
77 |
else //si toutes les catégories natures sont afficher, on affiche par défaut le template du numéro 1
|
78 |
|
78 |
$requete .= ' and bt_categorie_nature=1' ;
|
79 |
$resultat = $this->_db->query($requete) ;
|
79 |
$resultat = $this->_db->query($requete) ;
|
80 |
if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
80 |
if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
81 |
if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template.
|
81 |
if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template.
|
82 |
' et la langue: '.$lang.'<br />'.$requete) ;
|
82 |
' et la langue: '.$lang.'<br />'.$requete) ;
|
83 |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
|
83 |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
|
84 |
|
84 |
|
85 |
return $ligne->bt_template ;
|
85 |
return $ligne->bt_template ;
|
86 |
}
|
86 |
}
|
87 |
}
|
87 |
}
|