function theme_button

7.x form.inc theme_button($variables)
5.x form.inc theme_button($element)
6.x form.inc theme_button($element)

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

1 theme call to theme_button()
theme_submit in drupal/includes/form.inc
Returns HTML for a submit button form element.
12 string references to the theme hook from theme_button()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

ajax_pre_render_element in drupal/includes/ajax.inc
Adds Ajax information about an element to communicate with JavaScript.
DrupalRenderTestCase::testDrupalRenderFormElements in drupal/modules/simpletest/tests/common.test
Test rendering form elements without passing through form_builder().
drupal_common_theme in drupal/includes/common.inc
Provides theme registration for themes across .inc files.
FormsTestCase::testDisabledMarkup in drupal/modules/simpletest/tests/form.test
Verify markup for disabled form elements.
form_test_clicked_button in drupal/modules/simpletest/tests/form_test.module
Form builder to test button click detection.

... See full list

File

drupal/includes/form.inc, line 3819
Functions for form and batch generation and processing.

Code

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']) . ' />';
}