function RulesDataUIBoolean::inputForm

Implements RulesDataDirectInputFormInterface::inputForm().

Overrides RulesDataDirectInputFormInterface::inputForm

File

ui/ui.data.inc, line 368

Class

RulesDataUIBoolean
UI for boolean data.

Code

public static function inputForm($name, $info, $settings, RulesPlugin $element) {
    $settings += array(
        $name => isset($info['default value']) ? $info['default value'] : NULL,
    );
    // Note: Due to the checkbox even optional parameter always receive a value.
    $form[$name] = array(
        '#type' => 'radios',
        '#default_value' => $settings[$name],
        '#options' => array(
            TRUE => t('@label: True.', array(
                '@label' => $info['label'],
            )),
            FALSE => t('@label: False.', array(
                '@label' => $info['label'],
            )),
        ),
    );
    return $form;
}