You are here

function og_features_role_features_export_options in Organic groups 7.2

Implements hook_features_export_options().

File

includes/og_features_role.features.inc, line 42
Integration with features for og roles.

Code

function og_features_role_features_export_options() {
  $options = array();
  $default_roles = og_get_default_roles();
  $groups = og_get_all_group_bundle();
  foreach ($groups as $group_type => $bundles) {
    foreach ($bundles as $bundle => $name) {
      $roles = og_roles($group_type, $bundle, 0);
      foreach ($roles as $rid => $role) {
        if (!in_array($role, $default_roles)) {
          $key = $group_type . ':' . $bundle . ':' . $role;
          $options[$key] = $key;
        }
      }
    }
  }
  return $options;
}