function creer_categ_xml($dom, $parent, $niveau, $num_noeud, $libelle_categorie, $note_application, $comment_public, $num_parent) { global $dbh, $aff_langue; global $aff_note_application, $aff_commentaire, $aff_voir, $aff_voir_aussi, $aff_tg, $aff_ts; $noeud_categ = creer_noeud_xml($dom, $parent, "DE"); //ID creer_noeud_xml($dom, $noeud_categ, "ID", $num_noeud); //Libellé creer_noeud_xml($dom, $noeud_categ, "LIB_DE", $libelle_categorie); //Note application if ($note_application && $aff_note_application) { creer_noeud_xml($dom, $noeud_categ, "NA", $note_application); } //Commentaire public if ($comment_public && $aff_commentaire) { creer_noeud_xml($dom, $noeud_categ, "NOTE", $comment_public); } //Voir aussi if ($aff_voir_aussi) { $requete = "SELECT libelle_categorie,num_noeud_dest FROM voir_aussi JOIN categories ON num_noeud_dest=num_noeud AND categories.langue='" . $aff_langue . "' WHERE num_noeud_orig='" . $num_noeud . "' AND voir_aussi.langue='" . $aff_langue . "' ORDER BY libelle_categorie"; $res = pmb_mysql_query($requete); if ($res && pmb_mysql_num_rows($res)) { while ($va = pmb_mysql_fetch_object($res)) { if (trim($va->libelle_categorie)) { creer_noeud_xml($dom, $noeud_categ, "TA", $va->libelle_categorie); } } } } //Employé pour if ($aff_voir) { $requete = "SELECT libelle_categorie,id_noeud FROM noeuds JOIN categories ON id_noeud=num_noeud AND categories.langue='" . $aff_langue . "' WHERE num_renvoi_voir='" . $num_noeud . "' ORDER BY libelle_categorie"; $res = pmb_mysql_query($requete); if ($res && pmb_mysql_num_rows($res)) { while ($ep = pmb_mysql_fetch_object($res)) { if (trim($ep->libelle_categorie)) { creer_noeud_xml($dom, $noeud_categ, "EP", $ep->libelle_categorie); } } } } //Terme générique if ($aff_tg && $num_parent) { $requete = "SELECT libelle_categorie FROM categories WHERE langue='" . $aff_langue . "' AND num_noeud='" . $num_parent . "'"; $res = pmb_mysql_query($requete); if ($res && pmb_mysql_num_rows($res)) { while ($tg = pmb_mysql_fetch_object($res)) { if (trim($tg->libelle_categorie)) { creer_noeud_xml($dom, $noeud_categ, "TG", $tg->libelle_categorie); } } } } //TS if ($aff_ts) { $res = categories::listChilds($num_noeud, $aff_langue, 0, "libelle_categorie"); if ($res && pmb_mysql_num_rows($res)) { $noeud_ts = creer_noeud_xml($dom, $noeud_categ, "TS" . $niveau); while ($categ = pmb_mysql_fetch_object($res)) { if (trim($categ->libelle_categorie)) { creer_categ_xml($dom, $noeud_ts, $niveau + 1, $categ->num_noeud, $categ->libelle_categorie, $categ->note_application, $categ->comment_public, $categ->num_parent); } } } } }
function child_list($image = './images/folder.gif', $css) { global $css; global $dbh; global $opac_categories_nb_col_subcat, $opac_categories_sub_mode; global $main; global $lang; global $charset; global $base_path; $current_col = 0; // récupération des enfants if ($this->id == $this->thes->num_noeud_racine) { $result = categories::listChilds($this->id, $lang, 0, $opac_categories_sub_mode); } else { $result = categories::listChilds($this->id, $lang, 1, $opac_categories_sub_mode); } if (pmb_mysql_num_rows($result) < $opac_categories_nb_col_subcat) { // nombre de sous-catégories réduit while ($child = pmb_mysql_fetch_object($result)) { $libelle = $child->libelle_categorie; $note = $child->comment_public; $id = $child->num_noeud; //$c2_categ = new category($id); if ($child->num_renvoi_voir) { $libelle = "<i>{$libelle}</i>@"; $id = $child->num_renvoi_voir; } // Si il y a présence d'un commentaire affichage du layer $result_com = self::zoom_categ($id, $note); $l .= "<a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small'>"; if (category::has_notices($id)) { $l .= " <img src='{$base_path}/images/folder_search.gif' border=0 align='absmiddle' />"; } else { $l .= "<img src='{$image}' border='0' align='top' />"; } $l .= "<a/>" . $result_com['zoom']; $l .= "<a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small' " . $result_com['java_com'] . ">" . $libelle . "</a><br />"; } $l = "<br /><div style='margin-left:48px'>{$l}</div>"; } else { $l = "<table border='0' style='margin-left:48px' cellpadding='3'>"; while ($child = pmb_mysql_fetch_object($result)) { $libelle = $child->libelle_categorie; $note = $child->comment_public; $id = $child->num_noeud; //$c_categ = new category($id); if ($child->num_renvoi_voir) { $libelle = "<i>{$libelle}</i>@"; $id = $child->num_renvoi_voir; } // Si il y a présence d'un commentaire affichage du layer $result_com = self::zoom_categ($id, $note); if ($current_col == 0) { $l .= "\n<tr>"; } $l .= "<td align='top'><a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small'>"; if (category::has_notices($id)) { $l .= " <img src='{$base_path}/images/folder_search.gif' border=0 align='absmiddle' />"; } else { $l .= "<img src='{$image}' border='0' align='top' />"; } $l .= "</a>" . $result_com['zoom']; $l .= "<a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small' " . $result_com['java_com'] . ">" . $libelle . "</a></td>"; if ($current_col == $opac_categories_nb_col_subcat - 1) { $l .= '</tr>'; $current_col = 0; } else { $current_col++; } } $l .= '</table>'; } return $l; }