You are here

function node_field_text_long_widget in Node Field 7.2

Widget for long text field.

1 string reference to 'node_field_text_long_widget'
node_field_types_info in includes/node_field.field.inc
Node field types info.

File

includes/node_field.field.inc, line 201
Field types, settings, widget and formatters.

Code

function node_field_text_long_widget($node_field) {
  $form = [
    '#type' => 'textarea',
    '#title' => $node_field['title'],
    '#default_value' => $node_field['value'],
  ];
  if (!empty($node_field['settings']['use_text_format'])) {
    $form['#type'] = 'text_format';
    if (!empty($node_field['settings']['text_format'])) {
      $form['#format'] = $node_field['settings']['text_format'];
    }
  }
  return $form;
}