You are here

function domain_conf_default in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_conf/domain_conf.admin.inc \domain_conf_default()
  2. 7.2 domain_conf/domain_conf.admin.inc \domain_conf_default()

Special configuration options for the main domain.

Parameters

$domain: The $domain object for the default domain.

Return value

A $form array according to the FormsAPI, if unique configuration is possible.

1 string reference to 'domain_conf_default'
domain_conf_page in domain_conf/domain_conf.module
The domain conf page callback router.

File

domain_conf/domain_conf.module, line 85
Domain manager configuration options.

Code

function domain_conf_default($domain) {
  drupal_set_title(t('@site : Domain site settings', array(
    '@site' => $domain['sitename'],
  )));
  $form = array();

  // Grab any extra elements defined by other modules.
  $extra = domain_conf_api();
  if (!empty($extra)) {

    // Convert the $extra array to the $form array.
    $form = $extra;
    $form['domain_conf_message'] = array(
      '#type' => 'markup',
      '#value' => t('<p>The following custom settings may be applied to the main domain.  These options are specific to the Domain module and do not have standard configuration pages.</p>'),
      '#weight' => -100,
    );

    // Domain information, for saving.
    $form['domain_id'] = array(
      '#type' => 'value',
      '#value' => $domain['domain_id'],
    );

    // Submit functions
    $form['#submit']['domain_conf_form_submit'] = array();
    $form['#validate']['domain_conf_form_validate'] = array();
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Save domain settings'),
      '#weight' => 10,
    );
  }
  else {
    $form['domain_conf_message'] = array(
      '#type' => 'markup',
      '#value' => t('There are no custom domain settings to configure.'),
    );
  }
  return $form;
}