You are here

function rules_forms_activate_confirm_form_submit in Rules Forms Support 7.2

Same name and namespace in other branches
  1. 7 includes/rules_forms.admin.inc \rules_forms_activate_confirm_form_submit()

Submit handler for activation of a form.

File

includes/rules_forms.admin.inc, line 124
Administrative forms for Rules Forms module.

Code

function rules_forms_activate_confirm_form_submit($form, &$form_state) {
  $path = urldecode($form_state['form_page']);
  $form_info = array(
    'form_id' => $form_state['form_id_activate'],
    'label' => $form_state['values']['form_id_label'],
  );

  // Save the form information but prevent cache from being rebuilt until the
  // form is visited.
  rules_forms_activate_form($form_info);
  rules_forms_clear_cache();
  drupal_set_message(t("%form has been activated.", array(
    '%form' => $form_state['form_id_activate'],
  )));

  // Redirect the user back to the form that was activated.
  $form_state['redirect'] = $path;
}