You are here

function user_role_configuration_export in Configuration Management 7

Implements hook_configuration_export().

File

includes/configuration.user.inc, line 155

Code

function user_role_configuration_export($data, &$export, $module_name = '') {
  $export['dependencies']['configuration'] = 'configuration';
  $map = configuration_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];
    }

    // Export.
    if (user_role_load_by_name($role)) {
      $export['configuration']['user_role'][$role] = $role;
    }
  }
  return array();
}