diff options
author | Alex Bilbie <alex.bilbie@gmail.com> | 2012-06-24 13:05:22 +0200 |
---|---|---|
committer | Alex Bilbie <alex.bilbie@gmail.com> | 2012-06-24 13:05:22 +0200 |
commit | aedf1815bdf1fb9182c276bcd3ec9fe425c3a647 (patch) | |
tree | c3d415546d724fd0ed6cb2d178a7c7db2648c302 /system | |
parent | 2c35b64fc2b072ce873c56dde0f4bb1e5f404450 (diff) | |
parent | 7540dede0f01acd7aa1ffd224defc5189305a815 (diff) |
Merge pull request #1519 from mwhitneysdsu/develop
Added optional fourth parameter to timezone_menu
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/date_helper.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index cafb6ba95..fc790c585 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -547,9 +547,10 @@ if ( ! function_exists('timezone_menu')) * @param string timezone * @param string classname * @param string menu name + * @param mixed attributes * @return string */ - function timezone_menu($default = 'UTC', $class = '', $name = 'timezones') + function timezone_menu($default = 'UTC', $class = '', $name = 'timezones', $attributes = '') { $CI =& get_instance(); $CI->lang->load('date'); @@ -563,7 +564,22 @@ if ( ! function_exists('timezone_menu')) $menu .= ' class="'.$class.'"'; } - $menu .= ">\n"; + // Generate a string from the attributes submitted, if any + if (is_array($attributes)) + { + $atts = ''; + foreach ($attributes as $key => $val) + { + $atts .= ' '.$key.'="'.$val.'"'; + } + $attributes = $atts; + } + elseif (is_string($attributes) && strlen($attributes) > 0) + { + $attributes = ' '.$attributes; + } + + $menu .= $attributes.">\n"; foreach (timezones() as $key => $val) { |