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: type_fichier_mime.class.php,v 1.2 2005-09-27 16:42:00 alexandre_tb Exp $ |
// CVS : $Id: type_fichier_mime.class.php,v 1.3 2008-08-25 15:03:52 alexandre_tb Exp $ |
/** |
* Application projet |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ |
*@version $Revision: 1.3 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
126,9 → 126,9 |
* @return void |
* @access public |
*/ |
function type_fichier_mime( &$objetDB, $id_type = '', $chemin_icones = "icones/" ) |
function type_fichier_mime( $id_type = '', $chemin_icones = "icones/" ) |
{ |
$this->_db = $objetDB ; |
|
$requete = 'select * from gen_type_de_fichier where ' ; |
if (is_numeric ($id_type)) { |
$requete .= 'gtf_id_type='.$id_type ; |
135,7 → 135,7 |
} else { |
$requete .= 'gtf_type_mime="'.$id_type.'"' ; |
} |
$resultat = $this->_db->query ($requete) ; |
$resultat = $GLOBALS['projet_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
155,19 → 155,22 |
* @static |
* @access public |
*/ |
function factory( $extension, &$objetDB ) |
function factory( $extension, $objetDB = '') |
{ |
if (is_object($objetDB)) { |
$GLOBALS['projet_db'] = $objetDB; |
} |
$requete = "select * from gen_type_de_fichier where gtf_extension=\"$extension\" or gtf_type_mime=\"$extension\"" ; |
$resultat = $objetDB->query ($requete) ; |
$resultat = $GLOBALS['projet_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
return new type_fichier_mime ($objetDB, $ligne->gtf_id_type) ; |
return new type_fichier_mime ( $ligne->gtf_id_type) ; |
} else { |
// si il n'y a pas de résultat, on renvoie inconnue |
return new type_fichier_mime ($objetDB, 12) ; |
return new type_fichier_mime (12) ; |
} |
} // end of member function factory |
|