Ajout d'une étape de linting dans DroneCi (#3)

Corrige un doublons laissé par le rebase semi-manuel

Ajout d'une étape de linting dans DroneCi

Fix linting

Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr>
Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
This commit is contained in:
Nigel 2020-11-21 18:54:32 +00:00
commit dd61d3b66b
263 changed files with 45327 additions and 42695 deletions

View file

@ -23,8 +23,8 @@
*/
function smarty_function_html_select_time($params, &$smarty)
{
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
require_once $smarty->_get_plugin_filepath('function','html_options');
require_once $smarty->_get_plugin_filepath('shared', 'make_timestamp');
require_once $smarty->_get_plugin_filepath('function', 'html_options');
/* Default values. */
$prefix = "Time_";
$time = time();
@ -84,33 +84,37 @@ function smarty_function_html_select_time($params, &$smarty)
if ($display_hours) {
$hours = $use_24_hours ? range(0, 23) : range(1, 12);
$hour_fmt = $use_24_hours ? '%H' : '%I';
for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
for ($i = 0, $for_max = count($hours); $i < $for_max; $i++) {
$hours[$i] = sprintf('%02d', $hours[$i]);
}
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"';
} else {
$html_result .= '"' . $prefix . 'Hour"';
}
if (null !== $hour_extra){
if (null !== $hour_extra) {
$html_result .= ' ' . $hour_extra;
}
if (null !== $all_extra){
if (null !== $all_extra) {
$html_result .= ' ' . $all_extra;
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $hours,
$html_result .= smarty_function_html_options(
array('output' => $hours,
'values' => $hours,
'selected' => strftime($hour_fmt, $time),
'print_result' => false),
$smarty);
$smarty
);
$html_result .= "</select>\n";
}
if ($display_minutes) {
$all_minutes = range(0, 59);
for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval) {
$minutes[] = sprintf('%02d', $all_minutes[$i]);
}
$selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
@ -118,26 +122,29 @@ function smarty_function_html_select_time($params, &$smarty)
} else {
$html_result .= '"' . $prefix . 'Minute"';
}
if (null !== $minute_extra){
if (null !== $minute_extra) {
$html_result .= ' ' . $minute_extra;
}
if (null !== $all_extra){
if (null !== $all_extra) {
$html_result .= ' ' . $all_extra;
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $minutes,
$html_result .= smarty_function_html_options(
array('output' => $minutes,
'values' => $minutes,
'selected' => $selected,
'print_result' => false),
$smarty);
$smarty
);
$html_result .= "</select>\n";
}
if ($display_seconds) {
$all_seconds = range(0, 59);
for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval) {
$seconds[] = sprintf('%02d', $all_seconds[$i]);
}
$selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
@ -146,19 +153,21 @@ function smarty_function_html_select_time($params, &$smarty)
$html_result .= '"' . $prefix . 'Second"';
}
if (null !== $second_extra){
if (null !== $second_extra) {
$html_result .= ' ' . $second_extra;
}
if (null !== $all_extra){
if (null !== $all_extra) {
$html_result .= ' ' . $all_extra;
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $seconds,
$html_result .= smarty_function_html_options(
array('output' => $seconds,
'values' => $seconds,
'selected' => $selected,
'print_result' => false),
$smarty);
$smarty
);
$html_result .= "</select>\n";
}
@ -170,19 +179,21 @@ function smarty_function_html_select_time($params, &$smarty)
$html_result .= '"' . $prefix . 'Meridian"';
}
if (null !== $meridian_extra){
if (null !== $meridian_extra) {
$html_result .= ' ' . $meridian_extra;
}
if (null !== $all_extra){
if (null !== $all_extra) {
$html_result .= ' ' . $all_extra;
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'),
$html_result .= smarty_function_html_options(
array('output' => array('AM', 'PM'),
'values' => array('am', 'pm'),
'selected' => strtolower(strftime('%p', $time)),
'print_result' => false),
$smarty);
$smarty
);
$html_result .= "</select>\n";
}
@ -190,5 +201,3 @@ function smarty_function_html_select_time($params, &$smarty)
}
/* vim: set expandtab: */
?>