You are here

protected static function RulesDateOffsetProcessor::form in Rules 7.2

Overrides RulesDataProcessor::form().

Overrides RulesDataProcessor::form

File

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

Class

RulesDateOffsetProcessor
A data processor for applying date 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 date.'),
  );
  $form['value'] = array(
    '#type' => 'rules_duration',
    '#title' => t('Offset'),
    '#description' => t('Note that you can also specify negative numbers.'),
    '#default_value' => $settings['value'],
    '#weight' => 5,
  );
  return $form;
}