コード例 #1
0
 /**
  * prints the whole search/sort form as a shortcut function
  *
  */
 public function show_search_sort_form()
 {
     if (Participants_Db::$search_set === true) {
         return;
     }
     Participants_Db::$search_set = true;
     $output = array();
     if ($this->_sort_filter_mode() != 'none' && !$this->shortcode_atts['filtering']) {
         $output[] = $this->search_error_style;
         $output[] = '<div class="pdb-searchform">';
         $output[] = '<div class="pdb-error pdb-search-error" style="display:none">';
         $output[] = sprintf('<p class="search_field_error">%s</p>', __('Please select a column to search in.', 'participants-database'));
         $output[] = sprintf('<p class="value_error">%s</p>', __('Please type in something to search for.', 'participants-database'));
         $output[] = '</div>';
         $output[] = $this->search_sort_form_top(false, false, false);
         if ($this->_sort_filter_mode() == 'filter' || $this->_sort_filter_mode() == 'both') {
             $output[] = '<fieldset class="widefat inline-controls">';
             $output[] = sprintf('<legend>%s:</legend>', __('Search', 'participants-database'));
             $output[] = $this->column_selector(false, false);
             $output[] = $this->search_form(false);
             $output[] = '</fieldset>';
         }
         if ($this->_sort_filter_mode() == 'sort' || $this->_sort_filter_mode() == 'both' and (!empty($this->sortables) and is_array($this->sortables))) {
             $output[] = '<fieldset class="widefat inline-controls">';
             $output[] = sprintf('<legend>%s:</legend>', __('Sort by', 'participants-database'));
             $output[] = $this->sort_form(false);
             $output[] = '</fieldset>';
         }
         $output[] = '</form></div>';
     }
     echo $this->output_HTML($output);
 }