theme_textarea

Versions
mediamosa-21
theme_textarea($variables)

Theme a textarea form element.

Parameters

$variables An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #rows, #cols, #required, #attributes

Return value

A themed HTML string representing the textarea.

Related topics

Code

includes/form.inc, line 2809

<?php
function theme_textarea($variables) {
  $element = $variables['element'];
  $wrapper_attributes = array(
    'class' => array('form-textarea-wrapper'),
  );
  $class = array('form-textarea');

  // Add resizable behavior.
  if (!empty($element['#resizable'])) {
    drupal_add_js('misc/textarea.js');
    $wrapper_attributes['class'][] = 'resizable';
  }

  $output = '<div' . drupal_attributes($wrapper_attributes) . '>';

  _form_set_class($element, $class);
  $output .= '<textarea cols="' . $element['#cols'] . '" rows="' . $element['#rows'] . '" name="' . $element['#name'] . '" id="' . $element['#id'] . '" ' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';

  $output .= '</div>';
  return $output;
}
?>