diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-12 15:31:53 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-12 15:31:53 +0100 |
commit | e044d6c586728a28b291880dd37562f4a7551d36 (patch) | |
tree | cd309d72b20f6dbe11ae0d5ce0c7cf2168812ee7 /system/helpers | |
parent | 4c4740ec492b30aeb47cb1829525247053e4adfe (diff) | |
parent | 802953234f0b7669333807aaa3f2318778cde187 (diff) |
Merge upstream branch
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/form_helper.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 4da07f283..37337d975 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -314,6 +314,28 @@ if ( ! function_exists('form_dropdown')) { function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '') { + // If name is really an array then we'll call the function again using the array + if (is_array($name) && isset($name['name'])) + { + + if ( ! isset($name['options'])) + { + $name['options'] = array(); + } + + if ( ! isset($name['selected'])) + { + $name['selected'] = array(); + } + + if ( ! isset($name['extra'])) + { + $name['extra'] = ''; + } + + return form_dropdown($name['name'], $name['options'], $name['selected'], $name['extra']); + } + if ( ! is_array($selected)) { $selected = array($selected); |