function theme_taxonomy_manager_image_button in Taxonomy Manager 6
Same name and namespace in other branches
- 5 taxonomy_manager.module \theme_taxonomy_manager_image_button()
- 6.2 taxonomy_manager.admin.inc \theme_taxonomy_manager_image_button()
- 7 taxonomy_manager.admin.inc \theme_taxonomy_manager_image_button()
themes a image type button
File
- ./
taxonomy_manager.admin.inc, line 1502
Code
function theme_taxonomy_manager_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'];
}
// here the novelty begins: check if #button_type is normal submit button or image button
$return_string = '<input ';
if ($element['#button_type'] == 'image') {
$return_string .= 'type="image" ';
}
else {
$return_string .= 'type="submit" ';
}
$return_string .= empty($element['#id']) ? '' : 'id="' . $element['#id'] . '" ';
$return_string .= empty($element['#name']) ? '' : 'name="' . $element['#name'] . '" ';
$return_string .= 'value="' . check_plain($element['#value']) . '" ';
$return_string .= drupal_attributes($element['#attributes']) . " />\n";
return $return_string;
}