You are here

function features_feature_lock_confirm_form_submit in Features 7.2

Submit callback to lock components of a feature.

Parameters

array $form: Form array.

array $form_state: Form state.

File

./features.admin.inc, line 1691
Forms for Features admin screens.

Code

function features_feature_lock_confirm_form_submit($form, &$form_state) {
  $feature = $form['#feature']->name;
  $component = $form['#component'];
  if (features_feature_is_locked($feature, $component, FALSE)) {
    features_feature_unlock($feature, $component);
    drupal_set_message(t('Feature @name (component @component) has been unlocked.', array(
      '@name' => $feature,
      '@component' => $component ? $component : t('all'),
    )));
  }
  else {
    features_feature_lock($feature, $component);
    drupal_set_message(t('Feature @name (component @component) has been locked.', array(
      '@name' => $feature,
      '@component' => $component ? $component : t('all'),
    )));
  }
  $form_state['redirect'] = 'admin/structure/features/' . $feature;
}