summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
authorBrennan Thompson <brenjt@gmail.com>2014-02-16 19:01:03 +0100
committerBrennan Thompson <brenjt@gmail.com>2014-02-16 19:01:03 +0100
commit21ef97ecfaef8392ded81606ada2e4bbdc7e064c (patch)
treef6818282a7b4efd65396b6417db25c2dd8785412 /system/helpers/form_helper.php
parent87f6000df9b54c7b624a213eddd629ab0121963a (diff)
Dropdown should match style guide now.
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php10
1 files changed, 8 insertions, 2 deletions
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 = '<select '.rtrim(_parse_form_attributes($data, $defaults).$extra.$multiple).">\n";
+ $form = '<select '.trim(_parse_form_attributes($data, $defaults)).$extra.$multiple.">\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;