id = $id; if ($id) $this->get_data(); } function get_data() { global $dbh; global $categorie_separator; global $lang; // on récupère les infos de la catégorie $this->thes = thesaurus::getByEltId($this->id); if (categories::exists($this->id, $lang)) $lg=$lang; else $lg=$this->thes->langue_defaut; $query = "select "; $query.= "categories.libelle_categorie,categories.note_application, categories.comment_public, "; $query.= "noeuds.num_parent, noeuds.num_renvoi_voir "; $query.= "from noeuds, categories "; $query.= "where categories.langue = '".$lg."' "; $query.= "and noeuds.id_noeud = '".$this->id."' "; $query.= "and noeuds.id_noeud = categories.num_noeud "; $query.= "limit 1"; $result = mysql_query($query, $dbh); $current = mysql_fetch_object($result); $this->libelle = $current->libelle_categorie; $this->parent = $current->num_parent; $this->voir = $current->num_renvoi_voir; $this->note = $current->note_application; $this->comment = $current->comment_public; // on regarde si la catégorie à des enfants $query = "select count(1) from noeuds where num_parent = '".$this->id."' "; $result = mysql_query($query, $dbh); $this->has_child = mysql_result($result, 0, 0); // on regarde si la catégorie à des associées $query = "select count(1) from voir_aussi where num_noeud_orig = '".$this->id."' or num_noeud_dest = '".$this->id."' "; $result = mysql_query($query, $dbh); $this->has_child = $this->has_child + mysql_result($result, 0, 0); // on regarde si la catégorie est utilisée dans des notices $query = "select count(1) from notices_categories where num_noeud = '".$this->id."' "; $result = mysql_query($query, $dbh); $this->has_notices = mysql_result($result, 0, 0); } function categ_path($sep=' > ',$css) { global $dbh; global $css; global $main; global $lang; if(!$this->id) return; $desc_categ = $this->zoom_categ($this->id, $this->comment); $current = "$sep".$this->libelle.''." ".$desc_categ['zoom']; // si pas de parent, le path se résume à la catégorie if(!$this->parent) return $current; // les parents sont mis en tableau $parent_id = $this->parent; $path_array = array(); $path_array = categories::listAncestors($parent_id, $lang); while(list($cle, $valeur) = each($path_array)) { $ret .= $sep.""; $ret .= $valeur['libelle_categorie'].''; } return $ret.$current; } function zoom_categ($id, $note) { global $charset; global $opac_show_infobulles_categ; if($opac_show_infobulles_categ) { if ($note) { $zoom_com = "
"; if(category::has_notices($id)) $l .= " "; else $l .= ""; $l .= "".$result_com['zoom']; $l .= "".$libelle." | "; if ($current_col == $opac_categories_nb_col_subcat-1 ) { $l .= '