You are here

function theme_button in Drupal 6

Same name and namespace in other branches
  1. 4 includes/form.inc \theme_button()
  2. 5 includes/form.inc \theme_button()
  3. 7 includes/form.inc \theme_button()

Theme a form button.

Related topics

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

File

includes/form.inc, line 2061

Code

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";
}