You are here

public function views_handler_filter_history_user_timestamp::value_form in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 modules/node/views_handler_filter_history_user_timestamp.inc \views_handler_filter_history_user_timestamp::value_form()
  2. 6.2 modules/node/views_handler_filter_history_user_timestamp.inc \views_handler_filter_history_user_timestamp::value_form()

Options form subform for setting options.

This should be overridden by all child classes and it must define $form['value'].

Overrides views_handler_filter::value_form

See also

options_form()

File

modules/node/views_handler_filter_history_user_timestamp.inc, line 37
Definition of views_handler_filter_history_user_timestamp.

Class

views_handler_filter_history_user_timestamp
Filter for new content.

Code

public function value_form(&$form, &$form_state) {

  // Only present a checkbox for the exposed filter itself. There's no way
  // to tell the difference between not checked and the default value, so
  // specifying the default value via the views UI is meaningless.
  if (!empty($form_state['exposed'])) {
    if (isset($this->options['expose']['label'])) {
      $label = $this->options['expose']['label'];
    }
    else {
      $label = t('Has new content');
    }
    $form['value'] = array(
      '#type' => 'checkbox',
      '#title' => $label,
      '#default_value' => $this->value,
    );
  }
}