You are here

public static function RulesDataUITextFormatted::inputForm in Rules 7.2

Implements RulesDataDirectInputFormInterface::inputForm().

Overrides RulesDataUIText::inputForm

File

ui/ui.data.inc, line 270
Contains data type related forms.

Class

RulesDataUITextFormatted
UI for formatted text.

Code

public static function inputForm($name, $info, $settings, RulesPlugin $element) {
  $form = parent::inputForm($name, $info, $settings, $element);
  $settings += array(
    $name => isset($info['default value']) ? $info['default value'] : array(
      'value' => NULL,
      'format' => NULL,
    ),
  );
  $form[$name]['#type'] = 'text_format';
  $form[$name]['#base_type'] = 'textarea';
  $form[$name]['#default_value'] = $settings[$name]['value'];
  $form[$name]['#format'] = $settings[$name]['format'];
  return $form;
}