Guest User

Untitled

a guest
Apr 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. function phptemplate_button($element) {
  4.  
  5. if (isset($element['#attributes']['class'])) {
  6. $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
  7. }
  8. else {
  9. $element['#attributes']['class'] = 'form-'. $element['#button_type'];
  10. }
  11.  
  12. $return_string = '<input ';
  13. if ($element['#button_type'] == 'image') {
  14. $return_string .= 'type="image" ';
  15. }
  16. else {
  17. $return_string .= 'type="submit" ';
  18. }
  19. $return_string .= (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";;
  20. return $return_string;
  21. }
  22.  
  23. ?>
Add Comment
Please, Sign In to add comment