You are here

function theme_subform in Subform 7

Same name and namespace in other branches
  1. 5 subform.module \theme_subform()

Returns HTML for a subform.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #attributes, #subform

File

./subform.module, line 1015
Defines a subform element type.

Code

function theme_subform($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array(
    'id',
  ));
  $element['#attributes']['class'][] = 'subform';
  if (!isset($element['#subform_has_errors'])) {
    $element['#subform_errors'] = array();
  }
  subform_buffer_errors('start', $element);
  $element['#children'] = drupal_render($element['#subform']);
  subform_buffer_errors('end', $element);
  return '<div' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</div>';
}