You are here

function global_filter_get_parameter in Views Global Filter 8

Same name and namespace in other branches
  1. 7 global_filter.storage.inc \global_filter_get_parameter()

Returns parameter value of the specified filter or all parameters if omitted.

Parameters

int $filter_key: positive integer or NULL to retrieve all

string $name: name of the filter parameter to retrieve, omit for all

Return value

mixed a single value, array or two-dimensional array

17 calls to global_filter_get_parameter()
global_filter_active_filter_names in ./global_filter.module
Returns a list of all filter names or only those visible on the current page.
global_filter_block_configure in ./global_filter.blocks.inc
Implements hook_block_configure().
global_filter_block_save in ./global_filter.blocks.inc
Implements hook_block_save().
global_filter_clear_filters in ./global_filter.module
Set all or the supplied global filters back to their global defaults.
global_filter_create_widget in ./global_filter.widgets.inc
Based on the requested or field-implied widget.

... See full list

File

./global_filter.storage.inc, line 47
global_filter.storage.inc

Code

function global_filter_get_parameter($filter_key, $name = NULL) {

  // Take advantage of the cache inside global_filter_set_parameter() to
  // fetch all parameters. Then return the one requested or all if $name==null
  $parameters = global_filter_set_parameter(NULL, NULL, NULL);
  if (empty($filter_key) && empty($name)) {
    return $parameters;
  }
  if (empty($name)) {
    return isset($parameters[$filter_key]) ? $parameters[$filter_key] : NULL;
  }
  return isset($parameters[$filter_key][$name]) ? $parameters[$filter_key][$name] : NULL;
}