theme_image_button

Versions
6
theme_image_button($element)
7
theme_image_button($variables)

Theme a image button form element.

ingroup themeable

Parameters

$variables An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #attributes, #button_type, #name, #value, #title, #src.

Return value

A themed HTML string representing the form element.

Related topics

Code

includes/form.inc, line 2617

<?php
function theme_image_button($variables) {
  $element = $variables['element'];
  $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="' . file_create_url($element['#src']) . '" ' .
    (!empty($element['#title']) ? 'alt="' . check_plain($element['#title']) . '" title="' . check_plain($element['#title']) . '" ' : '' ) .
    "/>\n";
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.