Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. // Override theme_button
  2. function phptemplate_button($element) {
  3. // Make sure not to overwrite classes.
  4. if (isset($element['#attributes']['class'])) {
  5. $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
  6. }
  7. else {
  8. $element['#attributes']['class'] = 'form-'. $element['#button_type'];
  9. }
  10.  
  11. if ($element['#id'] == 'my_id') {
  12. $my_type = 'button';
  13. }
  14. else {
  15. $my_type = 'submit';
  16.  
  17. }
  18.  
  19. // We here wrap the output with a couple span tags
  20. return '<span class="button"><span><input type="'. $my_type .'"'. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'id="'. $element['#id'].'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." /></span></span>\n";
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement