You are here

function context_og_condition_group_type::condition_values in Context OG 6.3

Same name and namespace in other branches
  1. 7.2 plugins/context_og_condition_group_type.inc \context_og_condition_group_type::condition_values()
  2. 7 plugins/context_og_condition_group_type.inc \context_og_condition_group_type::condition_values()

File

plugins/context_og_condition_group_type.inc, line 7

Class

context_og_condition_group_type
Expose organic groups group types as a context condition.

Code

function condition_values() {
  $values = array(
    '_none_' => t('Not in a group'),
  );
  $og_types = og_get_types('group');
  foreach (node_get_types() as $type) {
    if (in_array($type->type, $og_types)) {
      $values[$type->type] = $type->name;
    }
  }
  return $values;
}