You are here

function subuser_form_user_register_form_alter in Subuser 8

Same name and namespace in other branches
  1. 7.2 subuser.module \subuser_form_user_register_form_alter()

Implements hook_form_FORM_ID_alter(): user_register_form.

File

./subuser.module, line 235
Provides primary Drupal hook implementations.

Code

function subuser_form_user_register_form_alter(&$form, &$form_state) {
  if (arg(0) == 'user') {
    $account = user_load(arg(1));
    $form['subuser_relation'] = array(
      '#type' => 'checkbox',
      '#title' => t('User relation'),
      '#description' => t('Store a relationship that will allow for further management of the user.'),
      '#default_value' => $account
        ->id(),
      //&& variable_get('subuser_relation', TRUE),
      '#access' => TRUE,
    );
    $form['#submit'][] = 'subuser_user_register_form_submit';
  }
}