You are here

function domain_settings_domainform in Domain Access 7.2

Same name and namespace in other branches
  1. 6.2 domain_settings/domain_settings.module \domain_settings_domainform()

Implements hook_domainform().

File

domain_settings/domain_settings.module, line 190
Allows domain-specific use of Drupal system settings forms.

Code

function domain_settings_domainform(&$form) {

  // Add the form element to the main screen.
  $form['domain_settings_module'] = array(
    '#type' => 'fieldset',
    '#title' => t('Domain-specific settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['domain_settings_module']['domain_settings_behavior'] = array(
    '#type' => 'radios',
    '#title' => t('Domain settings behavior'),
    '#options' => array(
      0 => t('Use the default domain'),
      1 => t('Use the active domain'),
      2 => t('All domains'),
    ),
    '#default_value' => variable_get('domain_settings_behavior', 0),
    '#description' => t('Default form value when submitting system settings.'),
  );
  $form['domain_settings_module']['domain_settings_form_visibility'] = array(
    '#type' => 'radios',
    '#title' => t('Visibility of domain-specific settings on forms'),
    '#options' => array(
      DOMAIN_SETTINGS_SHOW_EXCEPT_LISTED => t('Show on every system settings form, except those listed below.'),
      DOMAIN_SETTINGS_SHOW_ONLY_LISTED => t('Show only on system settings forms listed below.'),
    ),
    '#default_value' => variable_get('domain_settings_form_visibility', DOMAIN_SETTINGS_SHOW_EXCEPT_LISTED),
  );
  $form['domain_settings_module']['domain_settings_forms'] = array(
    '#type' => 'textarea',
    '#title' => t('Forms'),
    '#rows' => 5,
    '#cols' => 40,
    '#default_value' => variable_get('domain_settings_forms', ''),
    '#description' => t('Allow or disallow specific forms by entering a list of form_ids, one per line.'),
  );
}