You are here

function views_handler::show_expose_button in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 7.3 includes/handlers.inc \views_handler::show_expose_button()

Shortcut to display the expose/hide button.

2 calls to views_handler::show_expose_button()
views_handler_filter::options_form in handlers/views_handler_filter.inc
Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.
views_handler_sort::options_form in handlers/views_handler_sort.inc
Basic options for all sort criteria

File

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

Class

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

Code

function show_expose_button(&$form, &$form_state) {
  $form['expose_button'] = array(
    '#prefix' => '<div class="views-expose clear-block">',
    '#suffix' => '</div>',
  );
  if (empty($this->options['exposed'])) {
    $form['expose_button']['button'] = array(
      '#type' => 'submit',
      '#value' => t('Expose'),
      '#submit' => array(
        'views_ui_config_item_form_expose',
      ),
    );
    $form['expose_button']['markup'] = array(
      '#prefix' => '<div class="description">',
      '#value' => t('This item is currently not exposed. If you <strong>expose</strong> it, users will be able to change the filter as they view it.'),
      '#suffix' => '</div>',
    );
  }
  else {
    $form['expose_button']['button'] = array(
      '#type' => 'submit',
      '#value' => t('Hide'),
      '#submit' => array(
        'views_ui_config_item_form_expose',
      ),
    );
    $form['expose_button']['markup'] = array(
      '#prefix' => '<div class="description">',
      '#value' => t('This item is currently exposed. If you <strong>hide</strong> it, users will not be able to change the filter as they view it.'),
      '#suffix' => '</div>',
    );
  }
}