You are here

function mobile_tools_user_roles in Mobile Tools 7.2

Same name in this branch
  1. 7.2 mobile_tools_roles/mobile_tools_roles.module \mobile_tools_user_roles()
  2. 7.2 mobile_tools_roles/mobile_tools_roles.inc \mobile_tools_user_roles()
Same name and namespace in other branches
  1. 5 mobile_tools.module \mobile_tools_user_roles()
  2. 6 mobile_tools_roles.inc \mobile_tools_user_roles()

Helper function to return the desktop user roles

File

mobile_tools_roles/mobile_tools_roles.inc, line 121
Contains the functionality to add mobile user roles

Code

function mobile_tools_user_roles() {

  //$roles = array('none');
  $roles = user_roles();
  $desktop_roles = array();
  foreach ($roles as $key => $value) {
    $role = mobile_tools_roles_info(array(
      'id' => $key,
    ));
    if ($role->type == 'desktop') {
      $desktop_roles[$key] = $value;
    }
  }
  return $desktop_roles;
}