function RulesDataUIListInteger::inputForm

Implements RulesDataDirectInputFormInterface::inputForm().

Overrides RulesDataUIListText::inputForm

2 calls to RulesDataUIListInteger::inputForm()
RulesDataUIListEntity::inputForm in ui/ui.data.inc
Implements RulesDataDirectInputFormInterface::inputForm().
RulesDataUIListToken::inputForm in ui/ui.data.inc
Implements RulesDataDirectInputFormInterface::inputForm().
2 methods override RulesDataUIListInteger::inputForm()
RulesDataUIListEntity::inputForm in ui/ui.data.inc
Implements RulesDataDirectInputFormInterface::inputForm().
RulesDataUIListToken::inputForm in ui/ui.data.inc
Implements RulesDataDirectInputFormInterface::inputForm().

File

ui/ui.data.inc, line 536

Class

RulesDataUIListInteger
UI for lists of integers.

Code

public static function inputForm($name, $info, $settings, RulesPlugin $element) {
    $settings += array(
        $name => isset($info['default value']) ? $info['default value'] : NULL,
    );
    $form = parent::inputForm($name, $info, $settings, $element);
    if ($form[$name]['#type'] == 'textarea') {
        $form[$name]['#description'] = t('A list of integers, separated by commas. E.g. enter "1, 2, 3".');
        $form[$name]['#delimiter'] = ',';
        $form[$name]['#default_value'] = !empty($settings[$name]) ? implode(", ", $settings[$name]) : NULL;
        $form[$name]['#element_validate'][] = 'rules_ui_element_integer_list_validate';
        $form[$name]['#rows'] = 1;
    }
    return $form;
}