You are here

function features_form_submit in Features 6

Same name and namespace in other branches
  1. 7.2 features.admin.inc \features_form_submit()
  2. 7 features.admin.inc \features_form_submit()

Submit handler for the 'manage features' form

1 string reference to 'features_form_submit'
features_admin_form in ./features.admin.inc
admin/build/features page callback.

File

./features.admin.inc, line 600

Code

function features_form_submit(&$form, &$form_state) {

  // Clear drupal caches after enabling a feature. We do this in a separate
  // page callback rather than as part of the submit handler as some modules
  // have includes/other directives of importance in hooks that have already
  // been called in this page load.
  $form_state['redirect'] = 'admin/build/features/cleanup/clear';
  $features = $form['#features'];
  if (!empty($features)) {
    $status = $form_state['values']['status'];
    $install = array_keys(array_filter($status));
    $disable = array_diff(array_keys($status), $install);

    // Disable first. If there are any features that are disabled that are
    // dependencies of features that have been queued for install, they will
    // be re-enabled.
    module_disable($disable);
    features_install_modules($install);
  }
}