get_sel_header_template(); print $this->get_search_form(); print $this->get_js_script(); if(!$this->user_input) { $this->user_input = '*'; } print $this->get_display_list(); print $this->get_sel_footer_template(); } protected function get_display_list() { global $nb_per_page; global $page; global $grammars; $display_list = ''; if(!$page) { $debut = 0; } else { $debut = ($page-1)*$nb_per_page; } if(!$grammars) { $grammars_in = "'notice_authors'"; } else { $grammars_in = "'".implode("','", explode(',', $grammars))."'"; } $user_input = str_replace('*','',$this->user_input); // on récupére le nombre de lignes if($user_input=="") { $query = "SELECT COUNT(1) FROM vedette where grammar in (".$grammars_in.")"; } else { $query = "SELECT count(id_vedette) FROM vedette where label like '%".$user_input."%' and grammar in (".$grammars_in.") "; } $result = pmb_mysql_query($query); $this->nbr_lignes = pmb_mysql_result($result, 0, 0); if($this->nbr_lignes) { // on lance la vraie requête if($user_input=="") { $query = "SELECT id_vedette, label FROM vedette where grammar in (".$grammars_in.") ORDER BY label LIMIT $debut,$nb_per_page "; } else { $query = "SELECT id_vedette, label FROM vedette where label like '%".$user_input."%' and grammar in (".$grammars_in.") ORDER BY label limit $debut,$nb_per_page"; } $result = pmb_mysql_query($query); $display_list .= ""; while($vedette=pmb_mysql_fetch_object($result)) { $display_list .= $this->get_display_element($vedette->id_vedette, $vedette->label); } $display_list .= "
"; $display_list .= $this->get_pagination(); } return $display_list; } protected function get_display_element($index='', $value='') { global $charset; global $caller; global $callback; $display = " ".htmlentities($value,ENT_QUOTES,$charset)." "; return $display; } public function get_title() { global $msg; return $msg["notice_vedette_composee_author"]; } public static function get_params_url() { global $grammars, $mode; $params_url = parent::get_params_url(); $params_url .= ($grammars ? "&grammars=".$grammars : "").($mode ? "&mode=".$mode : ""); return $params_url; } } ?>