From 967ab871b836f618107fe144978bd1453c3c6634 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 11 Dec 2014 20:15:27 +0000 Subject: Update Smarty --- .../libs/plugins/function.html_select_time.php | 72 +++++++++++----------- 1 file changed, 35 insertions(+), 37 deletions(-) (limited to 'library/Smarty/libs/plugins/function.html_select_time.php') diff --git a/library/Smarty/libs/plugins/function.html_select_time.php b/library/Smarty/libs/plugins/function.html_select_time.php index 9fb8038e4..9af6aad5b 100644 --- a/library/Smarty/libs/plugins/function.html_select_time.php +++ b/library/Smarty/libs/plugins/function.html_select_time.php @@ -2,7 +2,7 @@ /** * Smarty plugin * - * @package Smarty + * @package Smarty * @subpackage PluginsFunction */ @@ -17,21 +17,21 @@ require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); /** * Smarty {html_select_time} function plugin - * * Type: function
* Name: html_select_time
* Purpose: Prints the dropdowns for time selection * - * @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time} - * (Smarty online manual) - * @author Roberto Berto - * @author Monte Ohrt - * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time} + * (Smarty online manual) + * @author Roberto Berto + * @author Monte Ohrt + * + * @param array $params parameters + * * @return string - * @uses smarty_make_timestamp() + * @uses smarty_make_timestamp() */ -function smarty_function_html_select_time($params, $template) +function smarty_function_html_select_time($params) { $prefix = "Time_"; $field_array = null; @@ -117,7 +117,7 @@ function smarty_function_html_select_time($params, $template) case 'minute_value_format': case 'second_format': case 'second_value_format': - $$_key = (string)$_value; + $$_key = (string) $_value; break; case 'display_hours': @@ -125,7 +125,7 @@ function smarty_function_html_select_time($params, $template) case 'display_seconds': case 'display_meridian': case 'use_24_hours': - $$_key = (bool)$_value; + $$_key = (bool) $_value; break; case 'minute_interval': @@ -135,7 +135,7 @@ function smarty_function_html_select_time($params, $template) case 'minute_size': case 'second_size': case 'meridian_size': - $$_key = (int)$_value; + $$_key = (int) $_value; break; default: @@ -151,7 +151,7 @@ function smarty_function_html_select_time($params, $template) if (isset($params['time']) && is_array($params['time'])) { if (isset($params['time'][$prefix . 'Hour'])) { // $_REQUEST[$field_array] given - foreach (array('H' => 'Hour', 'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) { + foreach (array('H' => 'Hour', 'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = isset($params['time'][$prefix . $_elementName]) ? $params['time'][$prefix . $_elementName] @@ -160,11 +160,11 @@ function smarty_function_html_select_time($params, $template) $_meridian = isset($params['time'][$prefix . 'Meridian']) ? (' ' . $params['time'][$prefix . 'Meridian']) : ''; - $time = strtotime( $_hour . ':' . $_minute . ':' . $_second . $_meridian ); + $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian); list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); } elseif (isset($params['time'][$field_array][$prefix . 'Hour'])) { // $_REQUEST given - foreach (array('H' => 'Hour', 'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) { + foreach (array('H' => 'Hour', 'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = isset($params['time'][$field_array][$prefix . $_elementName]) ? $params['time'][$field_array][$prefix . $_elementName] @@ -173,7 +173,7 @@ function smarty_function_html_select_time($params, $template) $_meridian = isset($params['time'][$field_array][$prefix . 'Meridian']) ? (' ' . $params['time'][$field_array][$prefix . 'Meridian']) : ''; - $time = strtotime( $_hour . ':' . $_minute . ':' . $_second . $_meridian ); + $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian); list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); } else { // no date found, use NOW @@ -204,8 +204,8 @@ function smarty_function_html_select_time($params, $template) $_html_hours = '' . $option_separator; if (isset($minute_empty) || isset($all_empty)) { - $_html_minutes .= '' . $option_separator; + $_html_minutes .= '' . $option_separator; } $selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null; - for ($i=0; $i <= 59; $i += $minute_interval) { + for ($i = 0; $i <= 59; $i += $minute_interval) { $_val = sprintf('%02d', $i); $_text = $minute_format == '%02d' ? $_val : sprintf($minute_format, $i); $_value = $minute_value_format == '%02d' ? $_val : sprintf($minute_value_format, $i); @@ -293,8 +293,8 @@ function smarty_function_html_select_time($params, $template) $_html_seconds = '' . $option_separator; if (isset($meridian_empty) || isset($all_empty)) { - $_html_meridian .= '' . $option_separator; + $_html_meridian .= '' . $option_separator; } - $_html_meridian .= '' . $option_separator - . '' . $option_separator + $_html_meridian .= '' . $option_separator + . '' . $option_separator . ''; } @@ -362,5 +362,3 @@ function smarty_function_html_select_time($params, $template) return $_html; } - -?> \ No newline at end of file -- cgit v1.2.3