You are here

function mobile_tools_mobile_user_roles in Mobile Tools 6

Same name and namespace in other branches
  1. 7.2 mobile_tools_roles/mobile_tools_roles.module \mobile_tools_mobile_user_roles()
  2. 7.2 mobile_tools_roles/mobile_tools_roles.inc \mobile_tools_mobile_user_roles()

Helper function to return the mobile user roles

1 call to mobile_tools_mobile_user_roles()
mobile_tools_form_alter in ./mobile_tools.module
Alteration to global setting form

File

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

Code

function mobile_tools_mobile_user_roles() {

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