You are here

function editor_textarea in Editor 7

Returns HTML for a textarea form element.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #rows, #cols, #required, #attributes, #resizable.
1 string reference to 'editor_textarea'
editor_theme_registry_alter in ./editor.module
Implements hook_theme_registry_alter().

File

includes/editor.theme.inc, line 55
Theme functions for Editor module.

Code

function editor_textarea($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array(
    'id',
    'name',
    'cols',
    'rows',
  ));
  _form_set_class($element, array(
    'form-textarea',
  ));
  $wrapper_attributes = array(
    'class' => array(
      'form-textarea-wrapper',
    ),
  );

  // Add resizable behavior.
  if (!empty($element['#resizable'])) {
    $element['#attributes']['class'][] = 'resize-' . $element['#resizable'];
  }
  $output = '<div' . drupal_attributes($wrapper_attributes) . '>';
  $output .= '<textarea' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';
  $output .= '</div>';
  return $output;
}