You are here

function filter_harmonizer_filter_is_empty in Views Filter Harmonizer 7

Determine whether the supplied argument constitutes an empty filter.

0, and one or more spaces are not considered empty, but other modules may override this.

Parameters

mixed $form_value: The value to test for "emptiness".

object $filter_handler: The Views exposed filter handler, if required.

Return value

bool TRUE when $form_value is considered empty.

1 call to filter_harmonizer_filter_is_empty()
filter_harmonizer_views_exposed_form_submit in ./filter_harmonizer.module
Supplementary submit handler for 'views_exposed_form'.

File

./filter_harmonizer.module, line 406
filter_harmonizer.module For Views where both exposed and contextual filters are active on a page.

Code

function filter_harmonizer_filter_is_empty($form_value, $filter_handler = NULL) {
  $is_empty = FALSE;
  if (!isset($form_value) || $form_value == '' || $form_value == 'All') {
    $is_empty = TRUE;
  }
  elseif (is_array($form_value)) {
    $is_empty = _filter_harmonizer_is_empty($form_value);
  }

  // Allow other modules to change the definition of 'empty' by them
  // implementing hook_filter_harmonizer_filter_is_empty_alter().
  drupal_alter('filter_harmonizer_filter_is_empty', $form_value, $is_empty, $filter_handler);
  return $is_empty;
}