\n";
// lien pour retour au sommaire
unset($_SESSION['facette']);
if (!$mode) {
switch ($search_type) {
case "simple_search":
print pmb_bidi("
$msg[search_result_for]".htmlspecialchars(stripslashes($user_query),ENT_QUOTES,$charset)."$activation_surlignage
");
if ($user_query=="") {
if ($opac_search_other_function) {
if (search_other_function_has_values()) $user_query="*";
}
}
if ($user_query!="") {
$_SESSION["level1"]=array();
$aq=new analyse_query(stripslashes($user_query),0,0,1,1,$opac_stemming_active);
if ($aq->error) {
print pmb_bidi(sprintf($msg["searcher_syntax_error_desc"],$aq->current_car,$aq->input_html,$aq->error_message)."
");
break;
}
if ($opac_modules_search_title && $look_TITLE) {
require_once($base_path.'/search/level1/title.inc.php');
$total_results += $nb_result_titres;
}
if ($opac_modules_search_author && $look_AUTHOR) {
require_once($base_path.'/search/level1/author.inc.php');
$total_results += $nb_result_auteurs;
}
if ($opac_modules_search_publisher && $look_PUBLISHER) {
require_once($base_path.'/search/level1/publisher.inc.php');
$total_results += $nb_result_editeurs;
}
if ($opac_modules_search_titre_uniforme && $look_TITRE_UNIFORME) {
require_once($base_path.'/search/level1/titre_uniforme.inc.php');
$total_results += $nb_result_titres_uniformes;
}
if ($opac_modules_search_collection && $look_COLLECTION) {
require_once($base_path.'/search/level1/collection.inc.php');
$total_results += $nb_result_collections;
}
if ($opac_modules_search_subcollection && $look_SUBCOLLECTION) {
require_once($base_path.'/search/level1/subcollection.inc.php');
$total_results += $nb_result_subcollections;
}
if ($opac_modules_search_category && $look_CATEGORY) {
require_once($base_path.'/search/level1/category.inc.php');
$total_results += $nb_result_categories;
}
if ($opac_modules_search_indexint && $look_INDEXINT) {
require_once($base_path.'/search/level1/indexint.inc.php');
$total_results += $nb_result_indexint;
}
if ($opac_modules_search_keywords && $look_KEYWORDS) {
require_once($base_path.'/search/level1/keyword.inc.php');
$total_results += $nb_result_keywords;
}
if ($opac_modules_search_abstract && $look_ABSTRACT) {
require_once($base_path.'/search/level1/abstract.inc.php');
$total_results += $nb_result_abstract;
}
if ($opac_modules_search_docnum && $look_DOCNUM) {
require_once($base_path.'/search/level1/docnum.inc.php');
$total_results += $nb_result_docnum;
}
if ($opac_modules_search_all && $look_ALL) {
require_once($base_path.'/search/level1/tous.inc.php');
$total_results += $nb_result;
$nb_all_results=$nb_result;
}
if ($opac_show_suggest) {
$bt_sugg = " ".$msg[empr_bt_make_sugg]."";
} else $bt_sugg="";
if ($opac_allow_external_search)
$bt_external="".$msg["connecteurs_external_search_sources"]."";
else $bt_external="";
// affichage pied-de-page
if(!$total_results && (!$opac_allow_affiliate_search || ($opac_modules_search_docnum && $look_DOCNUM) )) {
print "".$msg[no_result]." ".$bt_sugg.($bt_external?" $bt_external":"");
} else if ($bt_external || $bt_sugg) print "
".$bt_sugg.($bt_external?" $bt_external":"")."
";
//if (($nb_all_results)&&(!$get_query))
//Suggestions
if(!$total_results && $opac_simple_search_suggestions){
$tableSuggest="";
if ($opac_autolevel2==2) {
$actionSuggest = $base_path."/index.php?lvl=more_results&autolevel1=1";
} else {
$actionSuggest = $base_path."/index.php?lvl=search_result&search_type_asked=simple_search";
}
$termes=str_replace('*','',stripslashes($user_query));
if (trim($termes)){
$suggestion = new suggest($termes);
$tmpArray = array();
$tmpArray = $suggestion->listUniqueSimilars();
if(count($tmpArray)){
$tableSuggest.="";
foreach($tmpArray as $word){
$tableSuggest.="
".$word."
|
";
}
$tableSuggest.="
";
print "
".$msg['facette_suggest']."
".$tableSuggest;
}
}
}
if (($nb_all_results)&&($opac_autolevel2)&& !$get_query) print ""; else print "";
} else {
print "".$msg[no_result]."";
}
break;
case "extended_search":
print "$msg[search_result]
";
$allow_search_affiliate_and_external=true;
if($opac_allow_affiliate_search || $opac_allow_external_search){
$es_uni=new search("search_fields_unimarc");
if(count($_SESSION['facette']) || $facette_test || $es_uni->has_forbidden_fields()){
$allow_search_affiliate_and_external=false;
}
}
require_once($base_path.'/search/level1/extended.inc.php');
if ($opac_show_suggest) {
$bt_sugg = " ".$msg[empr_bt_make_sugg]."";
} else $bt_sugg="";
if ($opac_allow_external_search && $allow_search_affiliate_and_external)
$bt_external="".$msg["connecteurs_external_search_sources"]."";
else $bt_external="";
if (!$nb_result_extended) {
print "".$msg[no_result]." ".htmlentities($search_error_message,ENT_QUOTES,$charset)." ".$bt_sugg.($bt_external?" $bt_external":"");
} else if ($bt_external || $bt_sugg) print $bt_sugg.($bt_external?" $bt_external":"");
break;
case "external_search":
if ($_SESSION["ext_type"]!="multi")
print "$msg[search_result_for]".htmlentities(stripslashes($user_query),ENT_QUOTES,$charset)."
";
else
print "$msg[search_result]
";
require_once($base_path.'/search/level1/external.inc.php');
if (!$nb_result_external) {
print "".$msg[no_result]." ".htmlentities($search_error_message,ENT_QUOTES,$charset)."";
}
break;
// *************************************************
// Tags
case "tags_search":
print "$msg[search_result_for]".htmlentities(stripslashes($user_query),ENT_QUOTES,$charset)."
";
$tag = new tags();
if ($user_query=="*") echo $tag->listeAlphabetique();
else echo $tag->chercheTag($user_query);
break;
}
} else {
switch ($mode) {
case "keyword":
require_once($base_path.'/search/level1/keyword.inc.php');
break;
}
}
print "";
print $search_result_footer;
/** Fin affichage de la page **/