summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorBrennan Thompson <brenjt@gmail.com>2014-02-17 18:02:19 +0100
committerBrennan Thompson <brenjt@gmail.com>2014-02-17 18:02:19 +0100
commit82c78a9c70e65793b7590ebe049e5d2632d04504 (patch)
treef03b3a6c052cfb6fee57cf8f6fcbde143978db10 /system/helpers
parentc8ba6630167df5682fc0be2ae2d1352554374d1f (diff)
Removed extra spaces and irrelevant condition
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/form_helper.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 03839e0ed..da4646dd1 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -313,8 +313,8 @@ if ( ! function_exists('form_dropdown'))
{
$name = ! is_array($data) ? $data : '';
$defaults = array('name' => $name);
-
- if (is_array($data) && isset($data['selected']) && $data['selected'] !== NULL)
+
+ if (is_array($data) && isset($data['selected']))
{
$selected = $data['selected'];
unset($data['selected']); // selects don't have a selected attribute
@@ -327,7 +327,7 @@ if ( ! function_exists('form_dropdown'))
{
$selected = array($_POST[$name]);
}
-
+
if (is_array($data) && isset($data['options']))
{
$options = $data['options'];
@@ -335,13 +335,13 @@ if ( ! function_exists('form_dropdown'))
}
is_array($options) OR $options = array($options);
-
+
$extra = _attributes_to_string($extra);
-
+
$multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
-
+
$form = '<select '.trim(_parse_form_attributes($data, $defaults)).$extra.$multiple.">\n";
-
+
foreach ($options as $key => $val)
{
$key = (string) $key;
@@ -359,7 +359,7 @@ if ( ! function_exists('form_dropdown'))
{
$sel = in_array($optgroup_key, $selected) ? ' selected="selected"' : '';
$form .= '<option value="'.form_prep($optgroup_key).'"'.$sel.'>'
- .(string) $optgroup_val."</option>\n";
+ .(string) $optgroup_val."</option>\n";
}
$form .= "</optgroup>\n";
@@ -367,11 +367,11 @@ if ( ! function_exists('form_dropdown'))
else
{
$form .= '<option value="'.form_prep($key).'"'
- .(in_array($key, $selected) ? ' selected="selected"' : '').'>'
- .(string) $val."</option>\n";
+ .(in_array($key, $selected) ? ' selected="selected"' : '').'>'
+ .(string) $val."</option>\n";
}
}
-
+
return $form."</select>\n";
}
}