function theme_button

Same name and namespace in other branches
  1. 7.x drupal-7.x/includes/form.inc \theme_button()

Theme a form button.

Related topics

1 theme call to theme_button()
theme_submit in drupal-6.x/includes/form.inc
Theme a form submit button.

Archivo

drupal-6.x/includes/form.inc, line 1976

Código

function theme_button($element) {
  // Make sure not to overwrite classes.
  if (isset($element['#attributes']['class'])) {
    $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class'];
  }
  else {
    $element['#attributes']['class'] = 'form-' . $element['#button_type'];
  }

  return '<input type="submit" ' . (empty($element['#name']) ? '' : 'name="' . $element['#name'] . '" ') . 'id="' . $element['#id'] . '" value="' . check_plain($element['#value']) . '" ' . drupal_attributes($element['#attributes']) . " />\n";
}