function _key_configs_filter in Key 7
Same name and namespace in other branches
- 7.2 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 138 - 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['type'])) {
$include &= in_array($config['type'], (array) $filters['type']);
}
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;
}