You are here

function rules_forms_activate_form in Rules 6

Confirmation form to activate events on a form.

1 string reference to 'rules_forms_activate_form'
rules_forms_activate in rules_forms/rules_forms.admin.inc
Activation page for a form ID.

File

rules_forms/rules_forms.admin.inc, line 87
Implements forms events management screen.

Code

function rules_forms_activate_form(&$form_state, $form_id_activate) {
  $default_form_label = drupal_ucfirst(str_replace('_', ' ', $form_id_activate));
  $form = array(
    'form_id_label' => array(
      '#type' => 'textfield',
      '#title' => t('Custom form label'),
      '#default_value' => $default_form_label,
      '#required' => TRUE,
      '#description' => t('Enter a custom label to better recognize the form in the administration user interface.'),
    ),
  );
  $form_state['form_id_activate'] = $form_id_activate;
  $path = array();
  $path['path'] = isset($_GET['destination']) ? $_GET['destination'] : RULES_ADMIN_FORMS_PATH;
  $title = t('Are you sure you want to activate events for %form?', array(
    '%form' => $form_id_activate,
  ));
  $msg = t('Once the activation is confirmed, events on this form can be used to trigger rules.');
  return confirm_form($form, $title, $path, $msg, t('Activate'), t('Cancel'));
}