You are here

function user_patterns_export_all_role_users in Patterns 7.2

Returns a set of PATTERNS_CREATE actionswith the whole set of relationsps between users and roles currently stored in the system.

Parameters

array $args Set of arguments received from the form.:

string $result Current set of actions for the whole process.:

Return value

array $result Set of actions after performing the changes.

1 string reference to 'user_patterns_export_all_role_users'
user_patterns in patterns_components/components/user.inc
Implements hook_patterns() for the user module.

File

patterns_components/components/user.inc, line 184

Code

function user_patterns_export_all_role_users($args = NULL, &$result = NULL) {
  $roles = user_roles(TRUE);
  $result = array();

  //A PATTERNS_CREATE action is generated for each role
  foreach ($roles as $rid => $role) {
    $data = array(
      'tag' => 'role_users',
    );
    $data['role'] = $role;
    $data['users'] = _user_patterns_users_with_role($role);
    $action = array(
      PATTERNS_CREATE => $data,
    );
    array_push($result, $action);
  }
  return $result;
}