Permalink
Browse files

fix(views): do not drop elgg-button-submit class when using input/submit

Also the input/button and input/submit views can now handle
$vars['class'] to be an array.
  • Loading branch information...
jdalsem committed Feb 13, 2015
1 parent 4dbc5b5 commit 1e8e3e6f318fa29d7586f33feb5258e92a15ea16
Showing with 10 additions and 13 deletions.
  1. +5 −10 views/default/input/button.php
  2. +5 −3 views/default/input/submit.php
@@ -9,15 +9,10 @@
* @uses $vars['class'] Additional CSS class
*/
if (isset($vars['class'])) {
$vars['class'] = "elgg-button {$vars['class']}";
} else {
$vars['class'] = "elgg-button";
}
$vars['class'] = (array) elgg_extract('class', $vars, []);
$vars['class'][] = "elgg-button";
$defaults = array(
'type' => 'button',
);
$defaults = ['type' => 'button'];
$vars = array_merge($defaults, $vars);
@@ -36,5 +31,5 @@
if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) {
$vars['src'] = "";
}
?>
<input <?php echo elgg_format_attributes($vars); ?> />
echo elgg_format_element('input', $vars);
@@ -5,10 +5,12 @@
* @package Elgg
* @subpackage Core
*
* @uses $vars['class'] CSS class that replaces elgg-button-submit
* @uses $vars['class'] Additional CSS class
*/
$vars['type'] = 'submit';
$vars['class'] = elgg_extract('class', $vars, 'elgg-button-submit');
echo elgg_view('input/button', $vars);
$vars['class'] = (array) elgg_extract('class', $vars, []);
$vars['class'][] = "elgg-button-submit";
echo elgg_view('input/button', $vars);

0 comments on commit 1e8e3e6

Please sign in to comment.