";
$form .= $searcher_tabs->get_content_form();
$form .= "
";
$form .= $searcher_tabs->get_script_js_form($this->get_sel_search_form_name());
return $form;
}
protected function get_advanced_search_form() {
global $search;
global $opac_extended_search_dnd_interface;
global $mode;
$advanced_search_form = '';
//onglets de recherche objets
$searcher_tabs = $this->get_searcher_tabs_instance();
$searcher_tabs->set_current_mode($searcher_tabs->get_mode_multi_search_criteria());
$tab = $searcher_tabs->get_tab($searcher_tabs->get_mode_multi_search_criteria());
$sc = $this->get_search_instance();
$sc->set_filtered_objects_types($this->get_search_fields_filtered_objects_types());
if($tab['PREDEFINEDSEARCH'] && !(is_array($search) && count($search))) {
$search_perso = $this->get_search_perso_instance($tab['PREDEFINEDSEARCH']);
$sc->unserialize_search($search_perso->query);
}
/**
* TODO: Ajouter une url ou dériver le showform
*
*/
$advanced_search_form .= $sc->show_form('','');
if ($opac_extended_search_dnd_interface){
if(!isset($search_perso) || !is_object($search_perso)) {
$search_perso = $this->get_search_perso_instance();
}
$advanced_search_form .= '
'.$search_perso->get_forms_list().'
';
}
return $advanced_search_form;
}
protected function get_js_script() {
global $jscript;
global $jscript_common_selector;
global $param1, $param2, $p1, $p2;
global $infield;
if(!isset($jscript)) $jscript = $jscript_common_selector;
$jscript = str_replace('!!param1!!', ($param1 ? $param1 : $p1), $jscript);
$jscript = str_replace('!!param2!!', ($param2 ? $param2 : $p2), $jscript);
$jscript = str_replace('!!infield!!', $infield, $jscript);
return $jscript;
}
protected function get_display_object($id=0, $object_id=0) {
}
protected function get_display_list() {
}
protected function results_search() {
global $mode;
$searcher_tabs = $this->get_searcher_tabs_instance();
$searcher_tabs->set_current_mode($mode);
$searcher_tabs->proceed_search();
}
protected function get_message_not_found() {
}
protected function get_link_pagination() {
$link = static::get_base_url()."&user_input=".rawurlencode($this->user_input)."&page=!!page!!";
return $link;
}
public function get_pagination() {
global $nb_per_page;
global $page;
// constitution des liens
$nbepages = ceil($this->nbr_lignes/$nb_per_page);
if(!$page) {
$page = 1;
}
$suivante = $page+1;
$precedente = $page-1;
// affichage du lien précédent si nécéssaire
$pagination = "
";
$pagination .= printnavbar($page, $this->nbr_lignes, $nb_per_page, $this->get_link_pagination()) ;
$pagination .= "
";
return $pagination;
}
public function get_title() {
global $msg;
return $msg[static::class];
}
public function get_sel_header_template() {
global $charset;
global $base_path;
$sel_header = "
";
return $sel_header;
}
protected function get_sel_search_form_name() {
if($this->objects_type) {
return "selector_".$this->objects_type."_search_form";
} else {
return "selector_search_form";
}
}
public function get_sel_search_form_template() {
global $msg, $charset;
$sel_search_form ="
";
return $sel_search_form;
}
public function get_sel_footer_template() {
$sel_footer = "";
return $sel_footer;
}
protected function get_sub_tabs(){
$current_url = static::get_base_url();
$current_url = str_replace('select.php?', 'ajax.php?module=selectors&', $current_url);
$searcher_tab = $this->get_searcher_tabs_instance();
return '
';
}
public function get_objects_type() {
return $this->objects_type;
}
protected function get_searcher_tabs_instance() {
}
protected function get_search_perso_instance($id=0) {
}
protected function get_search_instance() {
}
// traitement en entrée des requêtes utilisateur
public static function format_user_input($user_input='') {
global $deb_rech;
global $f_user_input;
if ($deb_rech) {
$user_input = stripslashes($deb_rech);
} else {
if(!$user_input) {
if($f_user_input) {
$user_input = stripslashes($f_user_input);
}
}
}
return $user_input;
}
public static function get_params_url() {
global $param1, $param2, $p1, $p2;
$params_url = ($param1 ? "¶m1=".urlencode($param1) : "").($param2 ? "¶m2=".urlencode($param2) : "").($p1 ? "&p1=".urlencode($p1) : "").($p2 ? "&p2=".urlencode($p2) : "");
return $params_url;
}
public static function get_base_url() {
global $base_path;
global $what, $caller;
global $no_display, $bt_ajouter, $dyn, $callback, $infield;
global $max_field, $field_id, $field_name_id, $add_field, $nb_per_page;
global $selector_data, $iframe;
// gestion d'un élément à ne pas afficher
if (!$no_display) $no_display=0;
$base_url = $base_path."/select.php?what=".$what."&caller=".$caller;
$base_url .= static::get_params_url();
if($no_display) $base_url .= "&no_display=".$no_display;
if($bt_ajouter) $base_url .= "&bt_ajouter=".$bt_ajouter;
if($dyn) $base_url .= "&dyn=".$dyn;
if($callback) $base_url .= "&callback=".$callback;
if($infield) $base_url .= "&infield=".$infield;
if($max_field) $base_url .= "&max_field=".$max_field;
if($field_id) $base_url .= "&field_id=".$field_id;
if($field_name_id) $base_url .= "&field_name_id=".$field_name_id;
if($add_field) $base_url .= "&add_field=".$add_field;
if($nb_per_page) $base_url .= "&nb_per_page=".$nb_per_page;
if($selector_data) $base_url .= "&selector_data=".$selector_data;
if($iframe) $base_url .= "&iframe=".$iframe;
return $base_url;
}
public function set_data(string $data) {
$this->data = encoding_normalize::json_decode($data, true);
return $this;
}
}
?>