theme_image_button

Definition

theme_image_button($element)
drupal/includes/form.inc, line 2066

Description

Theme a form image 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

function theme_image_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="image" name="' . $element['#name'] . '" ' .
    (!empty($element['#value']) ? ('value="' . check_plain($element['#value']) . '" ') : '') .
    'id="' . $element['#id'] . '" ' .
    drupal_attributes($element['#attributes']) .
    ' src="' . base_path() . $element['#src'] . '" ' .
    (!empty($element['#title']) ? 'alt="' . check_plain($element['#title']) . '" title="' . check_plain($element['#title']) . '" ' : '' ) .
    "/>\n";
}