function rules_forms_activate_confirm_form in Rules Forms Support 7
Same name and namespace in other branches
- 7.2 includes/rules_forms.admin.inc \rules_forms_activate_confirm_form()
Confirmation form to activate events on a form.
1 string reference to 'rules_forms_activate_confirm_form'
- rules_forms_activate in includes/
rules_forms.admin.inc - Activation page for a form ID.
File
- includes/
rules_forms.admin.inc, line 138 - Administrative forms for Rules Forms module.
Code
function rules_forms_activate_confirm_form($form, &$form_state, $form_id_activate, $form_page) {
$default_form_label = drupal_ucfirst(str_replace('_', ' ', $form_id_activate));
$form = array();
$form['form_id_label'] = array(
'#type' => 'textfield',
'#title' => t('Custom form label'),
'#default_value' => $default_form_label,
'#required' => TRUE,
'#description' => t('Enter a custom label for use in the administration user interface.'),
);
$form['button_validate_submit'] = array(
'#type' => 'checkbox',
'#title' => t('Enable button level validate/submit events'),
'#default_value' => FALSE,
'#description' => t('Select this option to activate validate and submit events for cases where general form validate and submit events are not properly invoked.'),
);
$form_state['form_id_activate'] = $form_id_activate;
$form_state['form_page'] = $form_page;
$path = array();
$path['path'] = isset($_GET['destination']) ? $_GET['destination'] : RULES_FORMS_ADMIN_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'));
}