summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-03-16 15:32:44 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-03-16 15:32:44 +0000
commitd4db109e421eedb28d0d6145c8487e15c23ae9fd (patch)
tree72f37bbc8a63588f06c934b6c65f8207b9325811 /includes
parent0de876d095a4bd1b05e39e133b55d8f312469194 (diff)
downloadbrdo-d4db109e421eedb28d0d6145c8487e15c23ae9fd.tar.gz
brdo-d4db109e421eedb28d0d6145c8487e15c23ae9fd.tar.bz2
#54019, Can't set classes on submit elements, patch by m3avrck
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index b0345d638..ad67fd824 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -856,7 +856,15 @@ function theme_submit($element) {
}
function theme_button($element) {
- return '<input type="submit" class="form-'. $element['#button_type'] .'" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
+ //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'];
+ }
+
+ return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
}
/**