You are here

function config_pages_context_groups in Config Pages 7

Get available context groups.

3 calls to config_pages_context_groups()
config_pages_context_get in ./config_pages.inc
Return current context based on groups.
config_pages_edit_form in ./config_pages.admin.inc
Form callback: create or edit a config_pages.
config_pages_type_form in ./config_pages.type.admin.inc
Generates the config_pages type editing form.

File

./config_pages.inc, line 188
Logic functions.

Code

function config_pages_context_groups($type = FALSE) {
  $list = module_invoke_all('config_pages_context_groups');
  drupal_alter('config_pages_context_groups', $list);

  // Filter groups by given type.
  if (!empty($type) && ($config_type = config_pages_get_types($type))) {
    $groups = array_filter($config_type->data['context']['group']);
    $list = array_intersect_key($list, $groups);
  }
  return $list;
}