You are here

function theme_taxonomy_manager_image_button in Taxonomy Manager 5

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.admin.inc \theme_taxonomy_manager_image_button()
  2. 6 taxonomy_manager.admin.inc \theme_taxonomy_manager_image_button()
  3. 7 taxonomy_manager.admin.inc \theme_taxonomy_manager_image_button()

themes a image type button

File

./taxonomy_manager.module, line 1551
Taxonomy Manager

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;
}