function RulesPHPDataProcessor::form

Overrides RulesDataProcessor::form().

Overrides RulesDataProcessor::form

File

modules/php.eval.inc, line 92

Class

RulesPHPDataProcessor
A data processor using PHP.

Code

protected static function form($settings, $var_info) {
    $settings += array(
        'code' => '',
    );
    $form = array(
        '#type' => 'fieldset',
        '#title' => t('PHP evaluation'),
        '#collapsible' => TRUE,
        '#collapsed' => empty($settings['code']),
        '#description' => t('Enter PHP code to process the selected argument value.'),
    );
    $form['code'] = array(
        '#type' => 'textarea',
        '#title' => t('Code'),
        '#description' => t('Enter PHP code without <?php ?> delimiters that returns the processed value. The selected value is available in the variable $value. Example: %code', array(
            '%code' => 'return $value + 1;',
        )),
        '#default_value' => $settings['code'],
        '#weight' => 5,
    );
    return $form;
}