Commit f229a8c0 authored by Dries's avatar Dries

- Patch 161 by Gordon: adds new form_button() function with a more generic version
  of form_submit() which allows the creation of HTML buttons.
parent cc80cdf2
......@@ -759,8 +759,12 @@ function form_hidden($name, $value) {
return "<input type=\"hidden\" name=\"edit[$name]\" value=\"". check_form($value) ."\" />\n";
}
function form_button($value, $name = "op", $type = "submit", $attributes = 0) {
return "<input type=\"$type\" class=\"form-$type\" name=\"$name\" value=\"". check_form($value) ."\" ". drupal_attributes($attributes) ." />\n";
}
function form_submit($value, $name = "op", $attributes = 0) {
return "<input type=\"submit\" class=\"form-submit\" name=\"$name\" value=\"". check_form($value) ."\" />\n";
return form_button($value, $name, "submit", $attributes);
}
function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $description = 0, $extra = 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment