analyser(); $lg = $langages->table; //Récuperation de la liste des langues définies pour les thésaurus //autre que la langue par defaut du thesaurus $thes_liste_trad = thesaurus::getTranslationsList(); $lg1 = array(); foreach($thes_liste_trad as $dummykey=>$item) { if ( ($item != $thes->langue_defaut) && ($lg[$item]!= '') ) $lg1[$item] = $lg[$item]; } // dessin du form $see_also=array(); if($id) { $title = $msg[318]; $action = "./autorites.php?categ=categories&sub=update&id=$id&parent=$parent"; $delete_button = ""; $button_voir = ""; // on récupère les données de la catégorie $cat = new category($id); $c_form = '

'.$cat->catalog_form.'

'; $p_value = $cat->parent_id; $p_libelle = $cat->parent_libelle; $v_value = $cat->voir_id; if($v_value) { $voir = new category($v_value); $v_libelle = $voir->catalog_form; } //renvois voir aussi $see_also=$cat->associated_terms; //Non utilisisable en indexation $not_use_in_indexation=$cat->not_use_in_indexation; //numero autorite $n=new noeuds($id); $num_aut=$n->autorite; //import bloqué $import_denied = $n->authority_import_denied; if ($n->isProtected()) { $aff_node_info=false; } else { $aff_node_info=true; } } else { $action = "./autorites.php?categ=categories&sub=update&id=$id&parent=$parent"; $delete_button = ''; $title = $msg[319]; $libelle = ''; $c_form = ''; if($parent) { $pr = new category($parent); $p_value = $pr->id; $p_libelle = $pr->catalog_form; } else { $p_value = 0; $p_libelle = ''; } $v_value = 0; $v_libelle = ''; $not_use_in_indexation = 0; $aff_node_info=true; $import_denied = 0; } if ($thesaurus_mode_pmb != 0) $title.= ' ('.htmlentities($thes->libelle_thesaurus, ENT_QUOTES, $charset).')'; //Traductions $tab_traductions = array(); //Affichage des boutons de traduction $bt_lib_trad = ''; $bt_cm_na_trad = ''; if ( count($lg1) > 0 ) { $bt_lib_trad = ""; $bt_cm_na_trad = ""; } $category_form = str_replace('', $bt_lib_trad, $category_form); $category_form = str_replace('', $bt_cm_na_trad, $category_form); //On lit d'abord dans la langue par défaut du thesaurus if (categories::exists($id, $thes->langue_defaut)) { $c = new categories($id, $thes->langue_defaut); $libelle_categorie = $c->libelle_categorie; $note_application = $c->note_application; $commentaire = $c->comment_public; } else { $libelle_categorie = ''; $note_application = ''; $comment_public = ''; } $tab_traductions [$thes->langue_defaut][0] = $lg[$thes->langue_defaut]; $tab_traductions [$thes->langue_defaut][1] = $libelle_categorie; $tab_traductions [$thes->langue_defaut][2] = $note_application; $tab_traductions [$thes->langue_defaut][3] = $commentaire; //Ensuite, on regarde si les categories existent pour les langues de traduction des thesaurus foreach($lg1 as $key=>$value){ if (categories::exists($id, $key)) { $c = new categories($id, $key); $libelle_categorie = $c->libelle_categorie; $note_application = $c->note_application; $commentaire = $c->comment_public; } else { $libelle_categorie = ''; $note_application = ''; $commentaire = ''; } $tab_traductions[$key][0] = $value; $tab_traductions[$key][1] = $libelle_categorie; $tab_traductions[$key][2] = $note_application; $tab_traductions[$key][3] = $commentaire; } //categories langue par defaut thesaurus $category_form = str_replace('!!lang_def_cle!!', htmlentities('['.$thes->langue_defaut.']', ENT_QUOTES, $charset), $category_form); $category_form = str_replace('!!lang_def!!', htmlentities(' ('.$tab_traductions[$thes->langue_defaut][0].') ', ENT_QUOTES, $charset), $category_form); $category_form = str_replace('!!lang_def_js!!', ' ('.$tab_traductions[$thes->langue_defaut][0].') ', $category_form); $category_form = str_replace('!!lang_def_libelle!!', htmlentities($tab_traductions[$thes->langue_defaut][1], ENT_QUOTES, $charset), $category_form); $label1 = "\t
\n"; $input1 = "\t
\n"; //categories langue interface (si dans la liste des langues pour les thesaurus) if ( ($lang != $thes->langue_defaut) && ($lg1[$lang] != '') ) { $c_libelle_trad = $label1.htmlentities($tab_traductions[$lang][0], ENT_QUOTES, $charset).$label2; $c_libelle_trad.= $input1.$lang.$input2.htmlentities($tab_traductions[$lang][1], ENT_QUOTES, $charset).$input3; } //categories autres langues foreach($tab_traductions as $key=>$value) { if ($key != $thes->langue_defaut && $key != $lang) { $c_libelle_trad.= $label1.htmlentities($tab_traductions[$key][0], ENT_QUOTES, $charset).$label2; $c_libelle_trad.= $input1.$key.$input2.htmlentities($tab_traductions[$key][1], ENT_QUOTES, $charset).$input3; } } $category_form = str_replace('!!c_libelle_trad!!', $c_libelle_trad, $category_form); //Non utilisisable en indexation if($not_use_in_indexation == 1){ $not_use_checked = "checked='checked'"; }else{ $not_use_checked = ""; } $category_form = str_replace('!!not_use_in_indexation!!',$not_use_checked,$category_form); //note d'application langue par defaut thesaurus $category_form = str_replace('!!lang_def_na!!', htmlentities($tab_traductions[$thes->langue_defaut][2], ENT_QUOTES, $charset), $category_form); //commentaire langue par defaut thesaurus $category_form = str_replace('!!lang_def_cm!!', htmlentities($tab_traductions[$thes->langue_defaut][3], ENT_QUOTES, $charset), $category_form); $label1 = "\t
\n"; $input1 = "\t
\n"; $label11 = "\t
\n"; $input11 = "\t
\n"; //note d'application et commentaire en langue de l'interface if ($lang != $thes->langue_defaut) { $cm_na_trad = $label1.htmlentities($tab_traductions[$lang][0], ENT_QUOTES, $charset).$label2; $cm_na_trad.= $input1.$lang.$input2.htmlentities($tab_traductions[$lang][2], ENT_QUOTES, $charset).$input3; $cm_na_trad.= $label11.htmlentities($tab_traductions[$lang][0], ENT_QUOTES, $charset).$label12; $cm_na_trad.= $input11.$lang.$input12.htmlentities($tab_traductions[$lang][3], ENT_QUOTES, $charset).$input13; } //note d'application et commentaire autres langues foreach($tab_traductions as $key=>$value) { if ($key != $thes->langue_defaut && $key != $lang) { $cm_na_trad.= $label1.htmlentities($tab_traductions[$key][0], ENT_QUOTES, $charset).$label2; $cm_na_trad.= $input1.$key.$input2.htmlentities($tab_traductions[$key][2], ENT_QUOTES, $charset).$input3; $cm_na_trad.= $label11.htmlentities($tab_traductions[$key][0], ENT_QUOTES, $charset).$label12; $cm_na_trad.= $input11.$key.$input12.htmlentities($tab_traductions[$key][3], ENT_QUOTES, $charset).$input13; } } $category_form = str_replace('!!cm_na_trad!!', $cm_na_trad, $category_form); $category_form = str_replace('!!id!!', $id, $category_form); $category_form = str_replace('!!parent!!', $parent, $category_form); $category_form = str_replace('!!action!!', $action, $category_form); $category_form = str_replace('!!id_parent!!', $parent, $category_form); $category_form = str_replace('!!form_title!!', $title, $category_form); $category_form = str_replace('!!category_comment!!', htmlentities($commentaire,ENT_QUOTES, $charset), $category_form); if ($aff_node_info) { $form_categ_parent = str_replace('!!parent_value!!', $p_value, $form_categ_parent); $form_categ_parent = str_replace('!!parent_libelle!!', htmlentities($p_libelle,ENT_QUOTES, $charset), $form_categ_parent); $category_form = str_replace('', $form_categ_parent, $category_form); $form_renvoivoir = str_replace('!!voir_value!!', $v_value, $form_renvoivoir); $form_renvoivoir = str_replace('!!voir_libelle!!', htmlentities($v_libelle,ENT_QUOTES, $charset), $form_renvoivoir); $category_form = str_replace('', $form_renvoivoir , $category_form); if (count($see_also)==0) { $max_categ=1; $categ0_id=0; $categ0_lib=""; $categ0_rec="unchecked='unchecked'"; } else { $max_categ=count($see_also); $csa=new category($see_also[0]['id']); $categ0_id=$see_also[0]['id']; $categ0_lib=$csa->catalog_form; if ( $see_also[0]['rec'] )$categ0_rec="checked='checked'"; else $categ0_rec="unchecked='unchecked'"; } $see_also_form=$add_see_also; $see_also_form.="\n"; $categ0=str_replace("!!categ_libelle!!",$categ0_lib,$categ0); $categ0=str_replace("!!categ_id!!",$categ0_id,$categ0); $categ0=str_replace("!!icateg!!","0",$categ0); $categ0=str_replace("!!parent!!", $parent, $categ0); $categ0=str_replace("!!chk!!", $categ0_rec, $categ0); $see_also_form.=$categ0."\n"; $see_also_form.="
\n"; for ($i=1; $icatalog_form,$categ_); $categ_=str_replace("!!categ_id!!",$see_also[$i]['id'],$categ_); $categ_=str_replace("!!icateg!!",$i,$categ_); if ( $see_also[$i]['rec'] )$categ_rec="checked='checked'"; else $categ_rec="unchecked='unchecked'"; $categ_=str_replace("!!chk!!", $categ_rec, $categ_); $see_also_form.=$categ_."\n"; } $see_also_form.="
"; $form_renvoivoiraussi=str_replace("!!renvoi_voir_aussi!!",$see_also_form,$form_renvoivoiraussi); $category_form=str_replace("",$form_renvoivoiraussi,$category_form); //liaisons $has_link = false; $categ_child_content=""; if (noeuds::hasChild($id)) { $has_link = true; $odd_even=1; if ($res = noeuds::listChilds($id, 0)) { $categ_child_content .= "
"; while ($row = mysql_fetch_object($res)) { $tcateg = new category($row->id_noeud); if ($odd_even==0) { $categ_child_content .= " "; $odd_even=1; } else if ($odd_even==1) { $categ_child_content .= " "; $odd_even=0; } $notice_count = $tcateg->notice_count(false); $categ_child_content .= "'; if($notice_count && $notice_count!=0) $categ_child_content .= ""; else $categ_child_content .= ""; $categ_child_content .=''; } $categ_child_content .= "
"; if($tcateg->has_child) { $categ_child_content .= ""; $categ_child_content .= ""; } else { $categ_child_content .= ""; } if ($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 = "" ; } $categ_child_content .= ""; $categ_child_content .= $tcateg->libelle; $categ_child_content .= ''; $categ_child_content .= $zoom_comment.'id'\">".$notice_count." 
"; } } $categ_renvoivoir_content=""; if (noeuds::isTarget($id)){ $has_link = true; $odd_even=1; if ($res = noeuds::listTargets($id)) { $categ_renvoivoir_content .= "
"; while ($row = mysql_fetch_object($res)) { $tcateg = new category($row->id_noeud); $categ_renvoivoir_content .= " "; if ($odd_even==0) { $categ_renvoivoir_content .= " "; $odd_even=1; } else if ($odd_even==1) { $categ_renvoivoir_content .= " "; $odd_even=0; } $notice_count = $tcateg->notice_count(false); $categ_renvoivoir_content .= "'; if($notice_count && $notice_count!=0) $categ_renvoivoir_content .= ""; else $categ_renvoivoir_content .= ""; $categ_renvoivoir_content .=''; } $categ_renvoivoir_content .= "
"; if($tcateg->has_child) { $categ_renvoivoir_content .= ""; $categ_renvoivoir_content .= ""; } else { $categ_renvoivoir_content .= ""; } if ($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 = "" ; } $categ_renvoivoir_content .= ""; $categ_renvoivoir_content .= $tcateg->libelle; $categ_renvoivoir_content .= ''; $categ_renvoivoir_content .= $zoom_comment.'id'\">".$notice_count." 
"; } } $categ_renvoivoiraussi_content=""; //Voir aussi $requete="SELECT distinct num_noeud_orig AS id_noeud FROM voir_aussi WHERE num_noeud_dest='".$id."'"; $res=mysql_query($requete); if (mysql_num_rows($res)) { $has_link = true; $odd_even=1; $categ_renvoivoiraussi_content .= "
"; while ($row = mysql_fetch_object($res)) { $tcateg = new category($row->id_noeud); $categ_renvoivoiraussi_content .= " "; if ($odd_even==0) { $categ_renvoivoiraussi_content .= " "; $odd_even=1; } else if ($odd_even==1) { $categ_renvoivoiraussi_content .= " "; $odd_even=0; } $notice_count = $tcateg->notice_count(false); $categ_renvoivoiraussi_content .= "'; if($notice_count && $notice_count!=0) $categ_renvoivoiraussi_content .= ""; else $categ_renvoivoiraussi_content .= ""; $categ_renvoivoiraussi_content .=''; } $categ_renvoivoiraussi_content .= "
"; if($tcateg->has_child) { $categ_renvoivoiraussi_content .= ""; $categ_renvoivoiraussi_content .= ""; } else { $categ_renvoivoiraussi_content .= ""; } if ($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 = "" ; } $categ_renvoivoiraussi_content .= ""; $categ_renvoivoiraussi_content .= $tcateg->libelle; $categ_renvoivoiraussi_content .= ''; $categ_renvoivoiraussi_content .= $zoom_comment.'id'\">".$notice_count." 
"; } if ($has_link) { $liaison_tpl=str_replace("",$categ_child_content,$liaison_tpl); $liaison_tpl=str_replace("",$categ_renvoivoir_content,$liaison_tpl); $liaison_tpl=str_replace("",$categ_renvoivoiraussi_content,$liaison_tpl); $category_form=str_replace("",$liaison_tpl,$category_form); } else { $category_form=str_replace("","",$category_form); } //Numéro d'autorité $form_num_aut=str_replace("!!num_aut!!",$num_aut,$form_num_aut); $category_form=str_replace("",$form_num_aut,$category_form); if ($id) { // Impression de la branche du thésaurus $lien_impression_thesaurus="".$msg[print_branche].""; $category_form=str_replace("",$lien_impression_thesaurus,$category_form); } //Remplacement $button_remplace = ""; $category_form = str_replace("", $button_remplace, $category_form); //Suppression $category_form = str_replace('', $delete_button, $category_form); } else { $category_form=str_replace("",$num_aut,$category_form); } if($import_denied == 1){ $import_denied_checked = "checked='checked'"; }else{ $import_denied_checked = ""; } $category_form = str_replace('!!authority_import_denied!!',$import_denied_checked,$category_form); require_once("$class_path/aut_link.class.php"); $aut_link= new aut_link(AUT_TABLE_CATEG,$id); $category_form = str_replace('', $aut_link->get_form('categ_form') , $category_form); $category_form = str_replace('!!voir_notices!!', $button_voir, $category_form); print $category_form;