You are here

public function date_views_filter_handler_simple::get_filter_value in Date 7.2

Same name and namespace in other branches
  1. 8 date_views/includes/date_views_filter_handler_simple.inc \date_views_filter_handler_simple::get_filter_value()
  2. 7.3 date_views/includes/date_views_filter_handler_simple.inc \date_views_filter_handler_simple::get_filter_value()

Helper function to see if we need to swap in the default value.

Views exposed filters treat everything as submitted, so if it's an empty value we have to see if anything actually was submitted. If nothing has really been submitted, we need to swap in our default value logic.

4 calls to date_views_filter_handler_simple::get_filter_value()
date_views_filter_handler_simple::accept_exposed_input in date_views/includes/date_views_filter_handler_simple.inc
Do some minor translation of the exposed input.
date_views_filter_handler_simple::op_between in date_views/includes/date_views_filter_handler_simple.inc
@todo Document this.
date_views_filter_handler_simple::op_contains in date_views/includes/date_views_filter_handler_simple.inc
@todo Document this.
date_views_filter_handler_simple::op_simple in date_views/includes/date_views_filter_handler_simple.inc
@todo Document this.

File

date_views/includes/date_views_filter_handler_simple.inc, line 123
A standard Views filter for a single date field.

Class

date_views_filter_handler_simple
A standard Views filter for a single date field.

Code

public function get_filter_value($prefix, $input) {

  // All our date widgets provide datetime values but we use ISO in our SQL
  // for consistency between the way filters and arguments work (arguments
  // cannot contain spaces).
  if (empty($input)) {
    if (empty($this->options['exposed'])) {
      return str_replace(' ', 'T', $this
        ->date_default_value($prefix));
    }
    elseif (isset($this->options['expose']['identifier']) && !isset($_GET[$this->options['expose']['identifier']])) {
      return str_replace(' ', 'T', $this
        ->date_default_value($prefix));
    }
  }
  return str_replace(' ', 'T', $input);
}