You are here

function hosting_features_form in Hostmaster (Aegir) 6

The Hosting features form.

This returns a form with any known Hosting features grouped and listed. It allows administrators to enable or disable the features.

Return value

A drupal form.

See also

hosting_features_form_submit()

1 string reference to 'hosting_features_form'
hosting_menu in modules/hosting/hosting.module
Implementation of hook_menu().

File

modules/hosting/hosting.features.inc, line 60
Include for functionality related to Hosting module features.

Code

function hosting_features_form() {
  $form['features'] = array(
    '#type' => 'item',
    '#title' => t('Optional system features'),
    '#value' => t('You may choose any of the additional system features from the list below.'),
  );
  $experimental = array(
    '#type' => 'fieldset',
    '#title' => t('Experimental'),
    '#collapsed' => TRUE,
    '#collapsible' => TRUE,
    '#description' => t('Features marked experimental have not been completed to a satisfactory level to be considered production ready, so use at your own risk.'),
  );
  $features = hosting_get_features(TRUE);
  foreach ($features as $feature => $info) {
    $element = array(
      '#type' => 'checkbox',
      '#title' => $info['title'],
      '#description' => $info['description'],
      '#default_value' => hosting_feature($feature),
      '#required' => hosting_feature($feature) == HOSTING_FEATURE_REQUIRED,
      '#disabled' => hosting_feature($feature) == HOSTING_FEATURE_REQUIRED,
    );
    if ($info['group'] == 'experimental') {
      $experimental[$feature] = $element;
    }
    else {
      $form[$feature] = $element;
    }
  }
  $form['experimental'] = $experimental;
  $form['#submit'][] = 'hosting_features_form_submit';
  return system_settings_form($form);
}