function entityform_form_entityform_add_validation_rule_form_alter in Entityform 7
Implements hook_form_FORM_ID_alter().
This form is defined in entityform_forms. It alters the Rules add form
File
- ./
entityform.module, line 1746 - Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface
Code
function entityform_form_entityform_add_validation_rule_form_alter(&$form, $form_state, $form_id) {
_entityform_add_rules_component_alter($form, 'entityform validation', array(
'rule',
'rule set',
));
if (!empty($form['plugin_name']['#default_value'])) {
if (in_array($form['plugin_name']['#default_value'], array(
'rule',
'rule set',
))) {
//If this is rule or rule set we need another vars for return value.
$form['settings']['vars']['#value']['items'][] = array(
'type' => 'boolean',
'label' => 'Form Validates',
'name' => 'validate_form',
'usage' => '01',
// Provide var. Why is this not defined as constant in Rules
'weight' => 3,
);
}
}
}