\n";
// lien pour retour au sommaire
unset($_SESSION['facette']);
if (!$mode) {
print static::get_title();
switch (static::$search_type) {
case "simple_search":
static::proceed_simple_search();
break;
case "extended_search":
$allow_search_affiliate_and_external=true;
if($opac_allow_affiliate_search || $opac_allow_external_search){
$es_uni=new search("search_fields_unimarc");
if((isset($_SESSION['facette']) && count($_SESSION['facette'])) || $facette_test || $es_uni->has_forbidden_fields()){
$allow_search_affiliate_and_external=false;
}
}
$nb_result_extended = static::get_display_level1_records_search('extended', 'level1_records_extended_search');
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":
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":
$tag = new tags();
if (static::$user_query=="*") echo $tag->listeAlphabetique();
else echo $tag->chercheTag(static::$user_query);
break;
case "extended_search_authorities":
$nb_result_extended = static::get_display_level1_authorities_search('extended', 'level1_authorities_extended_search');
break;
}
} else {
switch ($mode) {
case "keyword":
static::get_display_level1_records_search('keywords', 'level1_records_keywords_search');
break;
}
}
print "
";
}
public static function set_url_base($url_base) {
static::$url_base = $url_base;
}
public static function set_search_type($search_type) {
static::$search_type = $search_type;
}
public static function set_user_query($user_query) {
static::$user_query = $user_query;
}
public static function format_url($url) {
if(strpos(static::$url_base, "lvl=search_segment")) {
return static::$url_base.str_replace('lvl', '&action', $url);
} else {
return static::$url_base.$url;
}
}
protected static function load_class($file){
global $base_path;
global $class_path;
global $include_path;
global $javascript_path;
global $styles_path;
global $msg,$charset;
if(file_exists($class_path.$file)){
require_once($class_path.$file);
}else{
return false;
}
return true;
}
}