You are here

function user_patterns_export_all_roles in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns_components/components/user.inc \user_patterns_export_all_roles()
1 string reference to 'user_patterns_export_all_roles'
user_patterns in patterns_components/components/user.inc
Implements hook_patterns() for the user module.

File

patterns_components/components/user.inc, line 59

Code

function user_patterns_export_all_roles($args = NULL, &$result = NULL) {
  $roles = user_roles(TRUE);
  $result = array();
  foreach ($roles as $role) {
    $data = array(
      'tag' => 'role',
    );
    $data['name'] = $role;
    $action = array(
      PATTERNS_CREATE => $data,
    );
    array_push($result, $action);
  }
  return $result;
}