theme_button

Definition

theme_button($element)
includes/form.inc, line 1924

Description

Theme a form button.

Related topics

Namesort iconDescription
Default theme implementationsFunctions and templates that present output to the user, and can be implemented by themes.
Form generationFunctions to enable the processing and display of HTML forms.

Code

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

Drupal is a registered trademark of Dries Buytaert.