You are here

function autoassignrole_form_alter in Auto Assign Role 5

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

File

./autoassignrole.module, line 188

Code

function autoassignrole_form_alter($form_id, &$form) {
  if ($form_id == "user_register" && variable_get('AUTOASSIGNROLE_ROLE_USER_ACTIVE', '0') == 1 && !user_access('administer users')) {
    $form['autoassignrole_user'] = array(
      '#type' => 'fieldset',
      '#title' => variable_get('AUTOASSIGNROLE_ROLE_USER_FIELDSET', t('User Role Selection')),
      '#collapsible' => FALSE,
      '#collapsed' => FALSE,
    );
    $form['autoassignrole_user']['AUTOASSIGNROLE_ROLE_USER'] = array(
      '#type' => _autoassignrole_user_input('type'),
      '#title' => variable_get('AUTOASSIGNROLE_ROLE_USER_TITLE', ""),
      '#options' => _autoassignrole_intersect(),
      '#required' => _autoassignrole_user_input('required'),
      '#description' => variable_get('AUTOASSIGNROLE_ROLE_USER_DESCRIPTION', ""),
    );
  }
}