1 handlers.inc views_handler::show_expose_form(&$form, &$form_state)

Shortcut to display the exposed options form.


core/modules/views/includes/handlers.inc, line 436
Defines the various handler objects to help build and display views.


Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.


function show_expose_form(&$form, &$form_state) {
  if (empty($this->options['exposed'])) {

  $this->expose_form($form, $form_state);

  // When we click the expose button, we add new gadgets to the form but they
  // have no data in $_POST so their defaults get wiped out. This prevents
  // these defaults from getting wiped out. This setting will only be TRUE
  // during a 2nd pass rerender.
  if (!empty($form_state['force_expose_options'])) {
    foreach (element_children($form['expose']) as $id) {
      if (isset($form['expose'][$id]['#default_value']) && !isset($form['expose'][$id]['#value'])) {
        $form['expose'][$id]['#value'] = $form['expose'][$id]['#default_value'];