/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Theme a form button. * * @ingroup themeable */ function mytheme_button($element) { // Make sure not to overwrite classes. $element['#attributes']['class'] = 'Button form-' . $element['#button_type'] . ' ' . $element['#attributes']['class']; } else { $element['#attributes']['class'] = 'Button form-' . $element['#button_type']; } // Skip admin pages due to some issues with ajax not being able to find buttons. if (arg(0) == 'admin') { return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'id="'. $element['#id'] .'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n"; } . '" ') . 'id="' . $element['#id'] . '" value="' . check_plain($element['#value']) . '" ' . drupal_attributes($element['#attributes']) . '>' . '<span class="btn">' . '<span class="l"></span>' . '<span class="r"></span>' . '<span class="t">' . check_plain($element['#value']) . '</span>' . '</span></button>'; }