analyser();
$lg = $langages->table;
if($user_input) {
$user_input = stripslashes($user_input);
} else {
$user_input = '*';
}
//affichage du selectionneur de thesaurus et du lien vers les thésaurus
$liste_thesaurus = thesaurus::getThesaurusList();
$sel_thesaurus = '';
$lien_thesaurus = '';
if ($thesaurus_mode_pmb != 0) { //la liste des thesaurus n'est pas affichée en mode monothesaurus
$sel_thesaurus = "" ;
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);
$user_query = str_replace("", authorities_statuts::get_form_for(AUT_TABLE_CATEG, $authority_statut, true), $user_query);
//affichage du choix de langue pour la recherche
$sel_langue = '';
$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($user_input,ENT_QUOTES, $charset),$user_query);
categ_browser::search_form((isset($parent) ? $parent : ''));
//recuperation du thesaurus session
if(!$id_thes) {
$id_thes = thesaurus::getSessionThesaurusId();
} else {
thesaurus::setSessionThesaurusId($id_thes);
}
// traitement de la saisie utilisateur
include("$include_path/marc_tables/$pmb_indexation_lang/empty_words");
$categ_searcher = searcher_factory::get_searcher('categories', '', $user_input);
$nbr_lignes = $categ_searcher->get_nb_results();
if(!$page) $page=1;
$debut =($page-1)*$nb_per_page_gestion;
if($nbr_lignes) {
$parity=1;
$num_auth_present = searcher_authorities_categories::has_authorities_sources('category');
$categ_list = "
".$msg[103]."
".$msg["categ_commentaire"]."
".($num_auth_present ? ''.$msg['authorities_number'].' ' : '')."
".$msg["count_notices_assoc"]."
";
$sorted_categ = $categ_searcher->get_sorted_result('default', $debut, $nb_per_page_gestion);
foreach ($sorted_categ as $authority_id) {
// On va chercher les infos spécifique à l'autorité
$authority = new authority($authority_id);
$categ_id = $authority->get_num_object();
$categ = $authority->get_object_instance();
if ($id_thes == -1) {
$display = '['.htmlentities($categ->thes->libelle_thesaurus,ENT_QUOTES, $charset).']';
} else {
$display = '';
}
if (isset($lg_search) && $lg_search) $display.= '['.$lg[$categ->langue].'] ';
if($categ->voir_id) {
$temp = authorities_collection::get_authority(AUT_TABLE_CATEG, $categ->voir_id);
$display .= $categ->libelle." -> ";
$display .= $temp->catalog_form;
$display.= "@ ";
} else {
$display .= $categ->catalog_form;
}
$notice_count = $categ->notice_count(false);
$categ_entry = $authority->get_display_statut_class_html().$display ;
$categ_comment = $categ->commentaire;
$link_categ = "./autorites.php?categ=categories&sub=categ_form&parent=0&id=".$categ_id."&id_thes=".$categ->thes->id_thesaurus."&user_input=".rawurlencode($user_input)."&nbr_lignes=".$nbr_lignes."&page=".$page."&nb_per_page=".$nb_per_page_gestion;
// $link_categ = "./autorites.php?categ=see&sub=category&id=".$categ_id;
if ($parity % 2) {
$pair_impair = "even";
} else {
$pair_impair = "odd";
}
$parity += 1;
$tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='".$pair_impair."'\" ";
$categ_list .= "
$categ_entry
$categ_comment
";
//Numéros d'autorite
if($num_auth_present){
$categ_list .= "".searcher_authorities_categories::get_display_authorities_sources($categ_id, 'category')." ";
}
if($notice_count && $notice_count!=0)
$categ_list .= "".$notice_count." ";
else $categ_list .= " ";
$categ_list .= " ";
} // fin while
//Création barre de navigation
$url_base='./autorites.php?categ=categories&sub=search&id_thes='.$id_thes.'&user_input='.rawurlencode($user_input).'&lg_search='.(isset($lg_search) ? $lg_search : '');
if (!$last_param) $nav_bar = aff_pagination ($url_base, $nbr_lignes, $nb_per_page_gestion, $page, 10, false, true) ;
else $nav_bar = "";
// affichage du résultat
print $categ_searcher->get_results_list_from_search($msg['1320'], $user_input, $categ_list, $nav_bar);
} else {
// la requête n'a produit aucun résultat
error_message($msg[211], str_replace('!!categ_cle!!', $user_input, $msg["categ_no_categ_found_with"]), 0, './autorites.php?categ=categories&sub=search');
}