You are here

function hosting_features_form in Hosting 5

Same name and namespace in other branches
  1. 6.2 hosting.features.inc \hosting_features_form()
  2. 7.4 hosting.features.inc \hosting_features_form()
  3. 7.3 hosting.features.inc \hosting_features_form()
2 string references to 'hosting_features_form'
hosting_menu in ./hosting.module
Implementation of hook_menu()
hosting_wizard_hosting_features in ./hosting.wizard.inc

File

./hosting.features.inc, line 26
Hosting 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,
    );
    if ($info['group'] == 'experimental') {
      $experimental[$feature] = $element;
    }
    else {
      $form[$feature] = $element;
    }
  }
  $form['experimental'] = $experimental;
  return system_settings_form($form);
}