Permalink
Browse files

fix(views): elgg_view_form now accepts class to be an array in form_vars

  • Loading branch information...
jdalsem committed Mar 21, 2016
1 parent b96c736 commit 4133b51657971a22af6a29f32adfdd69fd533dc5
Showing with 3 additions and 8 deletions.
  1. +3 −8 engine/lib/views.php
View
@@ -1269,15 +1269,10 @@ function elgg_view_form($action, $form_vars = array(), $body_vars = array()) {
'body' => elgg_view("forms/$action", $body_vars)
);
- $form_class = 'elgg-form-' . preg_replace('/[^a-z0-9]/i', '-', $action);
-
// append elgg-form class to any class options set
- if (isset($form_vars['class'])) {
- $form_vars['class'] = $form_vars['class'] . " $form_class";
- } else {
- $form_vars['class'] = $form_class;
- }
-
+ $form_vars['class'] = (array) elgg_extract('class', $form_vars, []);
+ $form_vars['class'][] = 'elgg-form-' . preg_replace('/[^a-z0-9]/i', '-', $action);
+
$form_vars = array_merge($defaults, $form_vars);
$form_vars['action_name'] = $action;

0 comments on commit 4133b51

Please sign in to comment.