You are here

protected static function RulesNumericOffsetProcessor::form in Rules 7.2

Overrides RulesDataProcessor::form().

Overrides RulesDataProcessor::form

File

modules/rules_core.eval.inc, line 216
Contains rules core integration needed during evaluation.

Class

RulesNumericOffsetProcessor
A data processor for applying numerical offsets.

Code

protected static function form($settings, $var_info) {
  $settings += array(
    'value' => '',
  );
  $form = array(
    '#type' => 'fieldset',
    '#title' => t('Add offset'),
    '#collapsible' => TRUE,
    '#collapsed' => empty($settings['value']),
    '#description' => t('Add an offset to the selected number. E.g. an offset of "1" adds 1 to the number before it is passed on as argument.'),
  );
  $form['value'] = array(
    '#type' => 'textfield',
    '#title' => t('Offset'),
    '#description' => t('Note that you can also specify negative numbers.'),
    '#default_value' => $settings['value'],
    '#element_validate' => array(
      'rules_ui_element_integer_validate',
    ),
    '#weight' => 5,
  );
  return $form;
}