get_sel_header_template(); switch($action){ case 'add': print $this->get_form(); break; case 'update': $saved_id = $this->save(); print $this->get_search_form(); print $this->get_js_script(); if($saved_id) { print $this->get_display_object(0, $saved_id); } break; default: print $this->get_search_form(); print $this->get_js_script(); if($pmb_allow_authorities_first_page || $this->user_input!= ""){ if(!$this->user_input) { $this->user_input = '*'; } print $this->get_display_list(); } break; } print $this->get_sel_footer_template(); } protected function get_add_link() { global $no_display; $link = static::get_base_url()."&action=add&deb_rech='+this.form.f_user_input.value+'&no_display=".$no_display; return $link; } protected function get_add_label() { global $msg; return $msg[get_called_class().'_add']; } protected function get_search_form() { global $charset; global $bt_ajouter; $sel_search_form = $this->get_sel_search_form_template(); if($bt_ajouter == "no"){ $sel_search_form = str_replace("!!bouton_ajouter!!", '', $sel_search_form); } else { $bouton_ajouter = "get_add_link()."'\" value='".htmlentities($this->get_add_label(), ENT_QUOTES, $charset)."' />"; $sel_search_form = str_replace("!!bouton_ajouter!!", $bouton_ajouter, $sel_search_form); } return $sel_search_form; } protected function get_display_list() { global $nb_per_page; global $page; global $no_display; $display_list = ''; if(!$page) { $debut = 0; } else { $debut = ($page-1)*$nb_per_page; } $searcher_instance = $this->get_searcher_instance(); $this->nbr_lignes = $searcher_instance->get_nb_results(); if($this->nbr_lignes) { $sorted_objects = $searcher_instance->get_sorted_result('default', $debut, $nb_per_page); foreach ($sorted_objects as $object_id) { $display_list .= $this->get_display_object($object_id); } $display_list .= $this->get_pagination(); } else { $display_list .= $this->get_message_not_found(); } return $display_list; } public function get_sel_search_form_template() { global $msg, $charset; $sel_search_form ="
"; return $sel_search_form; } protected function get_message_not_found() { global $msg; return $msg['no_'.str_replace('selector_', '', get_called_class()).'_found']; } } ?>