From 21ef97ecfaef8392ded81606ada2e4bbdc7e064c Mon Sep 17 00:00:00 2001 From: Brennan Thompson Date: Sun, 16 Feb 2014 11:01:03 -0700 Subject: Dropdown should match style guide now. --- system/helpers/form_helper.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'system/helpers/form_helper.php') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 0f85fdedd..9fd5d1e61 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -287,6 +287,8 @@ if ( ! function_exists('form_multiselect')) */ function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') { + $extra = _attributes_to_string($extra); + if ( ! strpos($extra, 'multiple')) { $extra .= ' multiple="multiple"'; @@ -333,10 +335,14 @@ if ( ! function_exists('form_dropdown')) $options = $data['options']; unset($data['options']); // selects don't use an options attribute } + + is_array($options) OR $options = array($options); + + $extra = _attributes_to_string($extra); $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; - $form = '\n"; foreach ($options as $key => $val) { @@ -925,7 +931,7 @@ if ( ! function_exists('_attributes_to_string')) if (is_string($attributes)) { - return ' '.$attributes; + return $attributes; } return FALSE; -- cgit v1.2.3-24-g4f1b