You are here

function rules_data_type_boolean::get_default_input_form in Rules 6

Gets the input form for the data Implement it, if your data is not identifiable.

Overrides rules_data_type_string::get_default_input_form

File

rules/modules/rules.rules.inc, line 123
rules integration for the rules module

Class

rules_data_type_boolean
Rules boolean data type

Code

function get_default_input_form($info, $value, &$form_state) {
  $info += array(
    'long' => FALSE,
    'required' => TRUE,
    'description' => '',
  );
  $info['description'] = $info['description'] . ' ' . t('Just enter 1 for TRUE, 0 for FALSE or make use of an input evaluator.');
  return array(
    '#type' => $info['long'] ? 'textarea' : 'textfield',
    '#title' => $info['label'],
    '#description' => $info['description'],
    '#required' => $info['required'],
    '#default_value' => $value,
  );
}