You are here

function autoassignrole_get_active_path_roles in Auto Assign Role 7.2

Same name and namespace in other branches
  1. 6.2 autoassignrole.module \autoassignrole_get_active_path_roles()
  2. 6 autoassignrole.module \autoassignrole_get_active_path_roles()

Finds any role ids attached to current page, if any.

2 calls to autoassignrole_get_active_path_roles()
autoassignrole_form_user_register_form_alter in ./autoassignrole.module
Implements hook_form_FORM_ID_alter() for user_register_form().
autoassignrole_user_presave in ./autoassignrole.module
Implements hook_user_presave().

File

./autoassignrole.module, line 217
The main autoassignrole.module file

Code

function autoassignrole_get_active_path_roles() {
  $item = menu_get_item();
  if ($item['page_callback'] == 'autoassignrole_register') {
    return $item['page_arguments'][0];
  }
  return FALSE;
}