From 728dd5418d42aef6ff76996ff262f133fa1c7a2f Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 1 Mar 2011 20:56:41 +0000 Subject: added better support for classes to buttons git-svn-id: http://code.elgg.org/elgg/trunk@8539 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/input/button.php | 9 ++++++--- views/default/input/submit.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'views') diff --git a/views/default/input/button.php b/views/default/input/button.php index b1a884c77..3122068ca 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -5,18 +5,21 @@ * @package Elgg * @subpackage Core * - * @uses $vars['src'] Src of an image - * + * @uses $vars['src'] Src of an image + * @uses $vars['class'] Class to add to elgg-button + * * @todo Handle classes better */ $defaults = array( 'type' => 'button', - 'class' => 'elgg-button elgg-button-action', + 'class' => '', ); $vars = array_merge($defaults, $vars); +$vars['class'] = trim("elgg-button {$vars['class']}"); + switch ($vars['type']) { case 'button': case 'reset': diff --git a/views/default/input/submit.php b/views/default/input/submit.php index d0c0c6355..31efa5cbf 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -7,6 +7,6 @@ */ $vars['type'] = 'submit'; -$vars['class'] = 'elgg-button elgg-button-submit'; +$vars['class'] = 'elgg-button-submit'; echo elgg_view('input/button', $vars); \ No newline at end of file -- cgit v1.2.3