You are here

function block_access_features_export in Block Access 7

Implements hook_features_export().

File

./block_access.module, line 696

Code

function block_access_features_export($data, &$export, $module_name = '') {
  $export['dependencies']['block_access'] = 'block_access';
  foreach ($data as $module) {
    module_load_include('inc', 'block_access', 'block_access.db');
    $perms = block_access_get_module($module);
    $roles = user_roles();
    foreach (array_keys($perms) as $rid) {
      $export['features']['user_role'][$roles[$rid]] = $roles[$rid];

      // Convert the role from a rid to a 'machine name' for saving. This
      // will be converted back to a rid when the feature is reverted.
      $perms[$roles[$rid]] = $perms[$rid];
      unset($perms[$rid]);
    }
    $export['features']['block_access'][$module] = $perms;
  }
  return array();
}