You are here

function domain_create_form in Domain Access 5

FormsAPI for creating domain records.

Parameters

$arguments: An array of additional hidden key/value pairs to pass to the form. Used by child modules to control behaviors. Currently supported arguments are: 'user_submitted' => TRUE Indicates that a form should not process administrative messages and paths upon form submit. Used by the Domain User module.

2 string references to 'domain_create_form'
domain_create in ./domain_admin.inc
Create a new domain record
domain_user_user in domain_user/domain_user.module
Implement hook_user()

File

./domain_admin.inc, line 425
Administration functions for the domain module.

Code

function domain_create_form($arguments = array()) {
  $form = array();

  // The $arguments arrray allows other modules to pass values to change the bahavior
  // of submit and validate functions.
  if (!empty($arguments)) {
    $form['domain_arguments'] = array(
      '#type' => 'value',
      '#value' => $arguments,
    );
  }
  $form['domain'] = array(
    '#type' => 'fieldset',
    '#title' => t('New domain record'),
    '#collapsible' => TRUE,
  );
  $form['domain']['subdomain'] = array(
    '#type' => 'textfield',
    '#title' => t('Domain'),
    '#size' => 40,
    '#maxlength' => 80,
    '#required' => TRUE,
    '#description' => t('The allowed subdomain, using the full <em>path.example.com</em> format.  Can only contain lower-case alphanumeric characters.  Leave off the http:// and the trailing slash.'),
  );
  $form['domain']['sitename'] = array(
    '#type' => 'textfield',
    '#title' => t('Site name'),
    '#size' => 40,
    '#maxlength' => 80,
    '#required' => TRUE,
    '#description' => t('The human-readable name of this domain.'),
  );
  $form['domain']['scheme'] = array(
    '#type' => 'radios',
    '#title' => t('Domain URL scheme'),
    '#required' => TRUE,
    '#options' => array(
      'http' => 'http://',
      'https' => 'https://',
    ),
    '#default_value' => 'http',
    '#description' => t('The URL scheme for accessing this domain.'),
  );
  $form['domain']['valid'] = array(
    '#type' => 'radios',
    '#title' => t('Domain status'),
    '#required' => TRUE,
    '#options' => array(
      1 => t('Active'),
      0 => t('Inactive'),
    ),
    '#default_value' => 1,
    '#description' => t('Must be set to "Active" for users to navigate to this domain.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Create domain record'),
  );
  return $form;
}