num_noeud_racine; // on constitue un tableau avec les catégories à afficher $requete = "select "; $requete.= "noeuds.id_noeud AS num_noeud, noeuds.num_renvoi_voir, noeuds.num_thesaurus,"; if(($lang==$thes->langue_defaut) || (in_array($lang, thesaurus::getTranslationsList())===false)){ $requete.=" catdef.comment_public as comment_public,"; $requete.= "catdef.libelle_categorie "; $requete.= "from noeuds JOIN categories as catdef on noeuds.id_noeud=catdef.num_noeud and catdef.langue = '".$thes->langue_defaut."' "; $requete.= "where "; $requete.= "noeuds.num_thesaurus = '".$id_thes."' "; $requete.= "and noeuds.num_parent = '".$thes->num_noeud_racine."' "; $requete.= "and catdef.libelle_categorie not like '~%' "; }else{ $requete.=" if (catlg.num_noeud is null, catdef.comment_public, catlg.comment_public ) as comment_public,"; $requete.= "if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie ) as libelle_categorie "; $requete.= "from noeuds left join categories as catdef on noeuds.id_noeud=catdef.num_noeud and catdef.langue = '".$thes->langue_defaut."' "; $requete.= "left join categories as catlg on catdef.num_noeud = catlg.num_noeud and catlg.langue = '".$lang."' "; $requete.= "where "; $requete.= "noeuds.num_thesaurus = '".$id_thes."' "; $requete.= "and noeuds.num_parent = '".$thes->num_noeud_racine."' "; $requete.= "and if (catlg.num_noeud is null, catdef.libelle_categorie not like '~%', catlg.libelle_categorie not like '~%') "; } $requete.= "order by libelle_categorie limit ".$opac_categories_max_display; $result = mysql_query($requete, $dbh); while ($level0 = mysql_fetch_object($result)) { // mise en forme de la catégorie chapeau if(!$level0->num_renvoi_voir) { $id = $level0->num_noeud; $link = $level0->libelle_categorie; } else { $id = $level0->num_renvoi_voir; $link = ''.$level0->libelle_categorie.'@'; } // Si il y a présence d'un commentaire affichage du layer $result_com = categorie::zoom_categ($id, $level0->comment_public); $categ = "$link"; $categ .= $result_com['zoom']; $requete = "select "; $requete.= "noeuds.id_noeud AS num_noeud, noeuds.num_renvoi_voir, noeuds.num_thesaurus,"; if(($lang==$thes->langue_defaut) || (in_array($lang, thesaurus::getTranslationsList())===false)){ $requete.=" catdef.comment_public as comment_public,"; $requete.= "catdef.libelle_categorie "; $requete.= "from noeuds JOIN categories as catdef on noeuds.id_noeud=catdef.num_noeud and catdef.langue = '".$thes->langue_defaut."' "; $requete.= "where "; $requete.= "noeuds.num_parent = '".$level0->num_noeud."' "; $requete.= "and catdef.libelle_categorie not like '~%' "; }else{ $requete.=" if (catlg.num_noeud is null, catdef.comment_public, catlg.comment_public ) as comment_public,"; $requete.= "if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie ) as libelle_categorie "; $requete.= "from noeuds left join categories as catdef on noeuds.id_noeud=catdef.num_noeud and catdef.langue = '".$thes->langue_defaut."' "; $requete.= "left join categories as catlg on catdef.num_noeud = catlg.num_noeud and catlg.langue = '".$lang."' "; $requete.= "where "; $requete.= "noeuds.num_parent = '".$level0->num_noeud."' "; $requete.= "and if (catlg.num_noeud is null, catdef.libelle_categorie not like '~%', catlg.libelle_categorie not like '~%') "; } $requete.= "order by ".$opac_categories_sub_mode." limit ".$opac_categories_sub_display; $result_bis = mysql_query($requete, $dbh); $child = array(); while($sub_categ = mysql_fetch_object($result_bis)) { if(!$sub_categ->num_renvoi_voir) { $id = $sub_categ->num_noeud; $link = $sub_categ->libelle_categorie; } else { $id = $sub_categ->num_renvoi_voir; $link = ''.$sub_categ->libelle_categorie.'@'; } // Si il y a présence d'un commentaire affichage du layer $result_com = categorie::zoom_categ($id, $sub_categ->comment_public); $child[] = "".$link."".$result_com['zoom']; } $categ_array[] = array( categ => $categ, child => $child); } //affichage des liens vers les autres thésaurus $liste_thesaurus = thesaurus::getThesaurusList($opac_show_categ_browser_home_id_thes); if($opac_show_categ_browser_home_id_thes_tab){ $liste_thesaurus_tmp=array(); foreach ( $opac_show_categ_browser_home_id_thes_tab as $value ) { if($liste_thesaurus[$value]){ $liste_thesaurus_tmp[$value]=$liste_thesaurus[$value]; unset($liste_thesaurus[$value]); } } foreach ( $liste_thesaurus as $key => $value ) { $liste_thesaurus_tmp[$key]=$value; } $liste_thesaurus = $liste_thesaurus_tmp; } $liens_thesaurus = ''; if ($opac_thesaurus != 0) { //la liste des thesaurus n'est pas affichée en mode monothesaurus $liens_thesaurus.= ""; } $tpl_div_categories=str_replace("",$liens_thesaurus,$tpl_div_categories); // Préparation à l'affichage $toprint = $tpl_div_categories; $toprint_rootcategories = ""; $to_jump=0; while(list($cle, $valeur) = each($categ_array)) { if ($to_jump==0) $toprint_rootcategories .="
"; $toprint_rootcategories .= $tpl_div_category; $toprint_rootcategories = str_replace("!!category_name!!", $valeur['categ'], $toprint_rootcategories); $toprint_subcategories = ""; $cpt=0; while(list($key, $sub) = each($valeur[child])) { $toprint_subcategories .= $tpl_subcategory; $toprint_subcategories = str_replace("!!sub_category!!", $sub, $toprint_subcategories); $cpt++; } // evite de mettre ... si moins que $opac_categories_sub_display if($toprint_subcategories && ($cpt== $opac_categories_sub_display)) $toprint_subcategories .= "..."; $toprint_rootcategories = str_replace("!!sub_categories!!", $toprint_subcategories, $toprint_rootcategories); if ($to_jump==($opac_categories_columns-1)) $toprint_rootcategories.="
"; $to_jump++; if ($to_jump>($opac_categories_columns-1)) $to_jump=0; } if ($to_jump!=0) { while ($to_jump<=($opac_categories_columns-1) ) { $toprint_rootcategories.="
 
"; $to_jump++ ; } $toprint_rootcategories.=""; } $toprint_rootcategories.="
"; $toprint = str_replace("!!root_categories!!", $toprint_rootcategories, $toprint); print pmb_bidi($toprint);