[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: boxes.php,v 1.16 2005/03/05 16:51:26 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/boxes.php,v $ 21 * 22 */ 23 24 /** 25 \file htdocs/boxes.php 26 \brief Fichier de la classe boxes 27 \author Rodolphe Qiedeville 28 \author Laurent Destailleur 29 \version $Revision: 1.16 $ 30 */ 31 32 33 34 /** 35 \class InfoBox 36 \brief Classe permettant la gestion des boxes sur une page 37 */ 38 39 class InfoBox 40 { 41 var $db; 42 43 /** 44 * \brief Constructeur de la classe 45 * \param $DB Handler d'accès base 46 */ 47 function InfoBox($DB) 48 { 49 $this->db=$DB; 50 } 51 52 53 /** 54 * \brief Retourne liste des boites elligibles pour la zone 55 * \param $zone ID de la zone (0 pour la Homepage, ...) 56 * \return array Tableau des boites qualifiées 57 */ 58 function listBoxes($zone) 59 { 60 $boxes=array(); 61 62 $sql = "SELECT b.rowid, b.box_id, d.file"; 63 $sql .= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d"; 64 $sql .= " WHERE b.box_id = d.rowid"; 65 $sql .= " AND position = ".$zone; 66 $sql .= " ORDER BY box_order"; 67 $result = $this->db->query($sql); 68 if ($result) 69 { 70 $num = $this->db->num_rows($result); 71 $j = 0; 72 while ($j < $num) 73 { 74 $obj = $this->db->fetch_object($result); 75 $boxes[$j]=eregi_replace('.php$','',$obj->file); 76 $j++; 77 } 78 } 79 else { 80 return array(); 81 } 82 return $boxes; 83 } 84 85 } 86 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |