Returns HTML for an image button form element.
$variables: An associative array containing:
The #button_type property accepts any value, though core themes have css that styles the following button_types appropriately: 'primary', 'danger'.
function theme_image_button($variables) {
$element = $variables['element'];
$element['#attributes']['type'] = 'image';
element_set_attributes($element, array(
'id',
'name',
'value',
));
$element['#attributes']['src'] = file_create_url($element['#src']);
if (!empty($element['#title'])) {
$element['#attributes']['alt'] = $element['#title'];
$element['#attributes']['title'] = $element['#title'];
}
$element['#attributes']['class'][] = 'image-button';
if (!empty($element['#button_type'])) {
$element['#attributes']['class'][] = 'image-button-' . $element['#button_type'];
}
// @todo Various JavaScript depends on this button class.
$element['#attributes']['class'][] = 'form-submit';
if (!empty($element['#attributes']['disabled'])) {
$element['#attributes']['class'][] = 'image-button-disabled';
}
return '<input' . new Attribute($element['#attributes']) . ' />';
}