You are here

function user_role_features_export in Features 7

Same name and namespace in other branches
  1. 6 includes/features.user.inc \user_role_features_export()
  2. 7.2 includes/features.user.inc \user_role_features_export()

Implements hook_features_export().

File

includes/features.user.inc, line 150

Code

function user_role_features_export($data, &$export, $module_name = '') {
  $export['dependencies']['features'] = 'features';
  $map = features_get_default_map('user_role', 'name');
  foreach ($data as $role) {

    // Role is provided by another module. Add dependency.
    if (isset($map[$role]) && $map[$role] != $module_name) {
      $export['dependencies'][$map[$role]] = $map[$role];
    }
    elseif (user_role_load_by_name($role)) {
      $export['features']['user_role'][$role] = $role;
    }
  }
  return array();
}