You are here

function hosting_features_form_submit in Hosting 7.4

Same name and namespace in other branches
  1. 5 hosting.features.inc \hosting_features_form_submit()
  2. 6.2 hosting.features.inc \hosting_features_form_submit()
  3. 7.3 hosting.features.inc \hosting_features_form_submit()

Submit callback for the Hosting features form.

We process the submitted values and enable any features that the user has requested. This may involve enabling a module and their dependencies and/or calling a specified callback function.

Parameters

array $form: The built form.

array $form_state: The current form state.

See also

hosting_features_form()

hook_hosting_feature()

1 string reference to 'hosting_features_form_submit'
hosting_features_form in ./hosting.features.inc
The Hosting features form.

File

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

Code

function hosting_features_form_submit($form, &$form_state) {
  variable_set('hosting_features_form_settings', $form_state['values']['settings']);

  // Get form values, filtering out irrelevant entries.
  $values = array_filter($form_state['values'], 'is_int');

  // Figure out which features to enable and/or disable.
  $features = hosting_determine_features_status($values);

  // Enable the feature(s).
  $rebuild_on_enable = count($features['disable']) ? FALSE : TRUE;
  hosting_features_enable($features['enable'], $rebuild_on_enable);

  // Disable the feature(s).
  hosting_features_disable($features['disable']);
}