repertoire_id = $id; $this->action = $action; if($this->repertoire_id){ //Modification $req="select repertoire_nom, repertoire_url, repertoire_path, repertoire_navigation, repertoire_hachage, repertoire_subfolder, repertoire_utf8 from upload_repertoire where repertoire_id='".$this->repertoire_id."'"; $res=mysql_query($req,$dbh); if(mysql_num_rows($res)){ $item = mysql_fetch_object($res); $this->repertoire_nom=$item->repertoire_nom; $this->repertoire_url=$item->repertoire_url; $this->repertoire_path=$item->repertoire_path; $this->repertoire_navigation=$item->repertoire_navigation; $this->repertoire_hachage=$item->repertoire_hachage; $this->repertoire_subfolder=$item->repertoire_subfolder; $this->repertoire_utf8=$item->repertoire_utf8; } else { $this->repertoire_nom=''; $this->repertoire_url=''; $this->repertoire_path=''; $this->repertoire_navigation=0; $this->repertoire_hachage=0; $this->repertoire_subfolder=20; $this->repertoire_utf8=0; } } else { //Création $this->repertoire_nom=''; $this->repertoire_url=''; $this->repertoire_path=''; $this->repertoire_navigation=0; $this->repertoire_hachage=0; $this->repertoire_subfolder=20; $this->repertoire_utf8=0; } } /* * Retourne si le repertoire est haché */ function isHashing(){ return $this->repertoire_hachage; } /* * Retourne si le repertoire est en utf8 */ function isUtf8(){ return $this->repertoire_utf8; } /* * Hache le nom de fichier pour le classer */ function hachage($nom_fichier){ $chemin= $this->repertoire_path; $nb_dossier = $this->repertoire_subfolder; $total=0; for($i=0;$iisUtf8()) return utf8_decode($chaine); return $chaine; } /* * encode la chaine dans le bon charset */ function encoder_chaine($chaine){ global $charset; if($charset != "utf-8" && $this->isUtf8()) return utf8_encode($chaine); return $chaine; } function get_path($filename){ $path = ""; if($this->isHashing()) $path = $this-> hachage($filename); else $path = $this->repertoire_path; return $path; } } ?>