theme_button

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 6 theme_button($element)
8 – 7 theme_button($variables)

Returns HTML for a button form element.

Parameters

$variables An associative array containing:

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

Related topics

Code

includes/form.inc, line 3613

<?php
function theme_button($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'submit';
  element_set_attributes($element, array('id', 'name', 'value'));

  $element['#attributes']['class'][] = 'form-' . $element['#button_type'];
  if (!empty($element['#attributes']['disabled'])) {
    $element['#attributes']['class'][] = 'form-button-disabled';
  }

  return '<input' . drupal_attributes($element['#attributes']) . ' />';
}
?>