function theme_image_button
theme_image_button($variables)
Returns HTML for an image 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, #title, #src.
Related topics
File
- includes/form.inc, line 3934
- Functions for form and batch generation and processing.
Code
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'][] = 'form-' . $element['#button_type']; if (!empty($element['#attributes']['disabled'])) { $element['#attributes']['class'][] = 'form-button-disabled'; } return '<input' . drupal_attributes($element['#attributes']) . ' />'; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!form.inc/function/theme_image_button/7.x