function views_exposed_form

cis7 views.module views_exposed_form($form, &$form_state)
cle7 views.module views_exposed_form($form, &$form_state)
elmsmedia7 views.module views_exposed_form($form, &$form_state)
icor7 views.module views_exposed_form($form, &$form_state)
meedjum_blog7 views.module views_exposed_form($form, &$form_state)
mooc7 views.module views_exposed_form($form, &$form_state)

Form builder for the exposed widgets form.

Be sure that $view and $display are references.

1 call to views_exposed_form()
views_content_views_panes_content_type_edit_form in sites/all/modules/ulmus/ctools/views_content/plugins/content_types/views_panes.inc
Returns an edit form for a block.
4 string references to 'views_exposed_form'
cis_helper_form_alter in profiles/cis/modules/custom/cis_helper/cis_helper.module
Implements hook_form_alter().
media_form_alter in sites/all/modules/ulmus/media/media.module
Implements hook_form_alter().
views_plugin_exposed_form::render_exposed_form in sites/all/modules/ulmus/views/plugins/views_plugin_exposed_form.inc
Render the exposed filter form.
views_theme in sites/all/modules/ulmus/views/views.module
Implement hook_theme(). Register views theming functions.

File

sites/all/modules/ulmus/views/views.module, line 1935
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_exposed_form($form, &$form_state) {
  // Don't show the form when batch operations are in progress.
  if ($batch = batch_get() && isset($batch['current_set'])) {
    return array(
      
      // Set the theme callback to be nothing to avoid errors in template_preprocess_views_exposed_form().
      '#theme' => '',
    );
  }

  // Make sure that we validate because this form might be submitted
  // multiple times per page.
  $form_state['must_validate'] = TRUE;
  $view = &$form_state['view'];
  $display = &$form_state['display'];

  $form_state['input'] = $view->get_exposed_input();

  // Let form plugins know this is for exposed widgets.
  $form_state['exposed'] = TRUE;
  // Check if the form was already created
  if ($cache = views_exposed_form_cache($view->name, $view->current_display)) {
    return $cache;
  }

  $form['#info'] = array();

  if (!variable_get('clean_url', FALSE)) {
    $form['q'] = array(
      '#type' => 'hidden',
      '#value' => $view->get_url(),
    );
  }

  // Go through each handler and let it generate its exposed widget.
  foreach ($view->display_handler->handlers as $type => $value) {
    foreach ($view->$type as $id => $handler) {
      if ($handler->can_expose() && $handler->is_exposed()) {
        // Grouped exposed filters have their own forms.
        // Instead of render the standard exposed form, a new Select or
        // Radio form field is rendered with the available groups.
        // When an user choose an option the selected value is split
        // into the operator and value that the item represents.
        if ($handler->is_a_group()) {
          $handler->group_form($form, $form_state);
          $id = $handler->options['group_info']['identifier'];
        }
        else {
          $handler->exposed_form($form, $form_state);
        }
        if ($info = $handler->exposed_info()) {
          $form['#info']["$type-$id"] = $info;
        }
      }
    }
  }

  $form['submit'] = array(
    '#name' => '', // prevent from showing up in $_GET.
    '#type' => 'submit',
    '#value' => t('Apply'),
    '#id' => drupal_html_id('edit-submit-' . $view->name),
  );

  $form['#action'] = url($view->display_handler->get_url());
  $form['#theme'] = views_theme_functions('views_exposed_form', $view, $display);
  $form['#id'] = drupal_clean_css_identifier('views_exposed_form-' . check_plain($view->name) . '-' . check_plain($display->id));
  //  $form['#attributes']['class'] = array('views-exposed-form');

  // If using AJAX, we need the form plugin.
  if ($view->use_ajax) {
    drupal_add_library('system', 'jquery.form');
  }
  ctools_include('dependent');

  $exposed_form_plugin = $form_state['exposed_form_plugin'];
  $exposed_form_plugin->exposed_form_alter($form, $form_state);

  // Save the form
  views_exposed_form_cache($view->name, $view->current_display, $form);

  return $form;
}