function mobile_tools_roles_form_alter in Mobile Tools 6.3
Same name and namespace in other branches
- 6.2 modules/mobile_tools_roles/mobile_tools_roles.module \mobile_tools_roles_form_alter()
Alteration to global setting form
File
- ./
mobile_tools_roles.module, line 135 - Contains the functionality to add mobile user roles
Code
function mobile_tools_roles_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'user_profile_form':
// We make sure that the mobile roles are not being displayed
$mobile_roles = mobile_tools_roles_mobile_user_roles();
if (!empty($mobile_roles)) {
foreach ($mobile_roles as $mobile_role) {
unset($form['account']['roles']['#options'][$mobile_role->mrid]);
}
}
}
}