You are here

function _key_configs_filter in Key 7.2

Same name and namespace in other branches
  1. 7 key.module \_key_configs_filter()

Filter an array of key configurations.

1 call to _key_configs_filter()
_key_element_expand in ./key.module
Process function to expand the key element.

File

./key.module, line 203
Provides the ability to manage keys, which can be used by other modules.

Code

function _key_configs_filter($configs, $filters) {
  $target_configs = array();
  foreach (key_get_configs() as $config) {
    $include = TRUE;
    if (!empty($filters['provider'])) {
      $include &= in_array($config['provider'], (array) $filters['provider']);
    }
    if ($include) {
      $target_configs[$config['name']] = TRUE;
    }
  }
  $configs = array_intersect_key($configs, $target_configs);
  return $configs;
}