You are here

function user_external_invite_form in User External Invite 7

Same name and namespace in other branches
  1. 7.2 user_external_invite.admin.inc \user_external_invite_form()
  2. 1.0.x user_external_invite.admin.inc \user_external_invite_form()

Form to invite a new user as a site owner or content editor.

2 string references to 'user_external_invite_form'
user_external_invite_menu in ./user_external_invite.module
Implements hook_menu().
user_external_invite_page in ./user_external_invite.module
Page callback for admin/people/invite.

File

./user_external_invite.admin.inc, line 173
Contains forms for the user_external_invite module.

Code

function user_external_invite_form($form, &$form_state) {
  drupal_set_title(t('Invite New User'));
  $role_options = array();
  $rids = variable_get('user_external_invite_roles', NULL);
  if (empty($rids)) {
    drupal_set_message(t('Your site is not yet configured to invite users. Contact the site administrator to configure the invite feature.'), 'status');
  }
  else {
    foreach ($rids as $rid) {
      $role_options[$rid] = _user_external_invite_role_name_from_rid($rid);
    }
    asort($role_options);
    $form['rid'] = array(
      '#title' => t('Role'),
      '#type' => 'radios',
      '#options' => $role_options,
      '#default_value' => variable_get('user_external_invite_default_role', key($role_options)),
      '#required' => TRUE,
    );
    $form['email'] = array(
      '#title' => t('Email addresses'),
      '#type' => 'textarea',
      '#description' => t('Comma separated list of email addresses that are sent the invitation email.'),
      '#required' => TRUE,
    );
    $form['custom_message'] = array(
      '#title' => t('Custom message'),
      '#type' => 'textarea',
      '#cols' => 40,
      '#rows' => 5,
      '#description' => t('If added, the custom message will be included before the standard template.  Can be left blank.'),
    );
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Send Invites'),
    );
    return $form;
  }
}