protected function default_display_filters_user($form, $form_state)
 {
     $filters = array();
     if (!empty($form_state['values']['show']['type']) && $form_state['values']['show']['type'] != 'all') {
         $bundle_key = $this->entity_info['bundle keys']['bundle'];
         // Figure out the table where $bundle_key lives. It may not be the same as
         // the base table for the view; the taxonomy vocabulary machine_name, for
         // example, is stored in taxonomy_vocabulary, not taxonomy_term_data.
         $fields = views_fetch_fields($this->base_table, 'filter');
         if (isset($fields[$this->base_table . '.' . $bundle_key])) {
             $table = $this->base_table;
         } else {
             foreach ($fields as $field_name => $value) {
                 if ($pos = strpos($field_name, '.' . $bundle_key)) {
                     $table = substr($field_name, 0, $pos);
                     break;
                 }
             }
         }
         $table_data = views_fetch_data($table);
         // Check whether the bundle key filter handler is or an child of it views_handler_filter_in_operator
         // If it's not just use a single value instead of an array.
         $handler = $table_data[$bundle_key]['filter']['handler'];
         if ($handler == 'views_handler_filter_in_operator' || is_subclass_of($handler, 'views_handler_filter_in_operator')) {
             $value = backdrop_map_assoc(array($form_state['values']['show']['type']));
         } else {
             $value = $form_state['values']['show']['type'];
         }
         $filters[$bundle_key] = array('id' => $bundle_key, 'table' => $table, 'field' => $bundle_key, 'value' => $value);
     }
     // @todo: Figure out why this isn't part of node_views_wizard.
     if (!empty($form_state['values']['show']['tagged_with']['tids'])) {
         $filters['tid'] = array('id' => 'tid', 'table' => 'taxonomy_index', 'field' => 'tid', 'value' => $form_state['values']['show']['tagged_with']['tids'], 'vocabulary' => $form_state['values']['show']['tagged_with']['vocabulary']);
         // If the user entered more than one valid term in the autocomplete
         // field, they probably intended both of them to be applied.
         if (count($form_state['values']['show']['tagged_with']['tids']) > 1) {
             $filters['tid']['operator'] = 'and';
             // Sort the terms so the filter will be displayed as it normally would
             // on the edit screen.
             sort($filters['tid']['value']);
         }
     }
     return $filters;
 }
/**
 * Add elements to the search settings form.
 *
 * @return
 *   Form array for the Search settings page at admin/config/search/settings.
 *
 * @ingroup search
 */
function hook_search_admin()
{
    // Output form for defining rank factor weights.
    $form['content_ranking'] = array('#type' => 'fieldset', '#title' => t('Content ranking'));
    $form['content_ranking']['#theme'] = 'node_search_admin';
    $form['content_ranking']['info'] = array('#markup' => '<p><em>' . t('Influence is a numeric multiplier used in ordering search results. A higher number means the corresponding factor has more influence on search results; zero means the factor is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '</em></p>');
    // Note: reversed to reflect that higher number = higher ranking.
    $config = config('search.settings');
    $options = backdrop_map_assoc(range(0, 10));
    foreach (module_invoke_all('ranking') as $var => $values) {
        $form['content_ranking']['factors']['node_rank_' . $var] = array('#title' => $values['title'], '#type' => 'select', '#options' => $options, '#default_value' => $config->get('node_rank_' . $var));
    }
    return $form;
}