" ;
foreach($liste_thesaurus as $id_thesaurus=>$libelle_thesaurus) {
$sel_thesaurus.= "".htmlentities($libelle_thesaurus,ENT_QUOTES, $charset)." ";
}
$sel_thesaurus.= "".htmlentities($msg['thes_all'],ENT_QUOTES, $charset)." ";
$sel_thesaurus.= " ";
$lien_thesaurus = "".$msg[thes_lien]." ";
}
$user_query=str_replace("",$sel_thesaurus,$user_query);
$user_query=str_replace("",$lien_thesaurus,$user_query);
if ($id_thes>=1)
$lien_imprimer_thesaurus = " ".$msg[print_thesaurus]." ";
else
$lien_imprimer_thesaurus = "" ;
$user_query=str_replace("",$lien_imprimer_thesaurus,$user_query);
//affichage du choix de langue pour la recherche
$sel_langue = "
";
$sel_langue.= " ".htmlentities($msg['thes_sel_langue'],ENT_QUOTES, $charset);
$sel_langue.= "
";
$user_query=str_replace("",$sel_langue,$user_query);
$user_query=str_replace("!!user_input!!",htmlentities(stripslashes($user_input),ENT_QUOTES, $charset),$user_query);
// nombre de références par pages
if ($nb_per_page_author != "")
$nb_per_page = $nb_per_page_author ;
else $nb_per_page = 10;
if ($id_thes == -1) { //on affiche la liste des thesaurus
$odd_even = 0;
foreach($liste_thesaurus as $id_thesaurus=>$libelle_thesaurus) {
if ($odd_even==0) {
$browser_content .= " ";
$odd_even=1;
} else if ($odd_even==1) {
$browser_content .= " ";
$odd_even=0;
}
$browser_content.= "".htmlentities($libelle_thesaurus,ENT_QUOTES, $charset)." ";
$browser_content.= " ";
}
} else {
$thes = new thesaurus($id_thes);
//si le parent n'est pas passe, on positionne
//le parent comme étant le noeud racine du thesaurus
if (!$parent) {
$parent = $thes->num_noeud_racine;
}
//Si le parent n'as pas de fils, on remonte au noeud supérieur.
if (!noeuds::hasChild($parent)) {
$noeud=new noeuds($parent);
$parent = $noeud->num_parent;
}
if($thes == NULL){
$browser_content = $msg[4051];
affiche();
exit;
}
// on récupére le nombre de lignes qui vont bien
$requete = "select count(1) " ;
$requete.= "from noeuds ";
$requete.= "where ";
$requete.= "noeuds.num_thesaurus = '".$id_thes."' ";
$requete.= "and noeuds.num_parent = '".$parent."' ";
$res = mysql_query($requete, $dbh);
$nbr_lignes = mysql_result($res, 0, 0);
if(!$page) $page=1;
$debut =($page-1)*$nb_per_page;
$nbmax_cat=500;
$pagine=false;
$requete = "select catdef.num_noeud, ";
$requete.= "autorite, ";
$requete.= "if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie ) as lib ";
$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 = '".$parent."' ";
$requete.= "order by lib ";
if($nbr_lignes>$nbmax_cat){
$nb_per_page = $nbmax_cat;
$pagine = true;
$debut =($page-1)*$nb_per_page;
$requete.= "limit ".$debut.",".$nb_per_page." ";
}
$result = mysql_query($requete, $dbh);
if(mysql_num_rows($result)) {
$browser_top = "";
$browser_top.= " ";
// récupération de la 1ère entrée et création du header
$cat = mysql_fetch_row($result);
$tcateg = new category($cat[0]);
if(sizeof($tcateg->path_table)) {
for($i=0; $i < sizeof($tcateg->path_table) - 1; $i++){
$browser_header ? $browser_header .= '>' : $browser_header = '';
$browser_header .= "path_table[$i]['commentaire']."'>";
$browser_header .= $tcateg->path_table[$i]['libelle'];
$browser_header .= " ";
}
$browser_header ? $browser_header .= '>' : $browser_header = '';
$browser_header .= $tcateg->path_table[sizeof($tcateg->path_table) - 1]['libelle'];
$browser_header .= ' ';
}
$odd_even=0;
mysql_data_seek($result, 0);
while($cat = mysql_fetch_row($result)) {
$tcateg = new category($cat[0]);
if ($odd_even==0) {
$browser_content .= " ";
$odd_even=1;
} else if ($odd_even==1) {
$browser_content .= " ";
$odd_even=0;
}
$notice_count = $tcateg->notice_count(false);
$browser_content .= "";
if($tcateg->has_child) {
$browser_content .= "";
$browser_content .= " ";
} else {
$browser_content .= " ";
}
if ($cat[1] || $tcateg->commentaire) {
$zoom_comment = "";
$java_comment = " onmouseover=\"z=document.getElementById('zoom_comment".$tcateg->id."'); z.style.display=''; \" onmouseout=\"z=document.getElementById('zoom_comment".$tcateg->id."'); z.style.display='none'; \"" ;
} else {
$zoom_comment = "" ;
$java_comment = "" ;
}
$browser_content .= "";
$browser_content .= $tcateg->libelle;
$browser_content .= ' ';
$browser_content .= $zoom_comment.' ';
if($notice_count && $notice_count!=0)
$browser_content .= "id'\">".$notice_count." ";
else $browser_content .= " ";
$browser_content .=' ';
} //fin while
} else {
$browser_content = $msg[4051];
}
}
//Barre de navigation
$url_base=$PHP_SELF."?categ=categories&sub=&id_thes=".$id_thes."&parent=".$parent;
if (!$last_param && $pagine)
$nav_bar = aff_pagination ($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true) ;
else $nav_bar = "";
affiche($nav_bar);
exit;
// création du tableau à partir du template et affichage
function affiche($nav_bar='') {
global $categ_browser;
global $browser_top;
global $liste_thesaurus;
global $browser_header;
global $browser_content;
global $parent;
global $user_query;
$categ_browser = str_replace('!!browser_top!!', $browser_top, $categ_browser);
$categ_browser = str_replace('!!liste_thesaurus!!', $liste_thesaurus, $categ_browser);
$categ_browser = str_replace('!!browser_header!!', $browser_header, $categ_browser);
$categ_browser = str_replace('!!browser_content!!', $browser_content, $categ_browser);
$categ_browser = str_replace('!!id_parent!!', $parent, $categ_browser);
categ_browser::search_form($parent);
print pmb_bidi($categ_browser);
if ($nav_bar) print $nav_bar;
}
?>