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

@ -40,7 +40,7 @@
*/
function smarty_function_html_checkboxes($params, &$smarty)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once $smarty->_get_plugin_filepath('shared', 'escape_special_chars');
$name = 'checkbox';
$values = null;
@ -52,8 +52,8 @@ function smarty_function_html_checkboxes($params, &$smarty)
$extra = '';
foreach($params as $_key => $_val) {
switch($_key) {
foreach ($params as $_key => $_val) {
switch ($_key) {
case 'name':
case 'separator':
$$_key = $_val;
@ -86,7 +86,7 @@ function smarty_function_html_checkboxes($params, &$smarty)
break;
default:
if(!is_array($_val)) {
if (!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
@ -95,37 +95,37 @@ function smarty_function_html_checkboxes($params, &$smarty)
}
}
if (!isset($options) && !isset($values))
return ''; /* raise error here? */
if (!isset($options) && !isset($values)) {
return '';
} /* raise error here? */
settype($selected, 'array');
$_html_result = array();
if (isset($options)) {
foreach ($options as $_key=>$_val)
foreach ($options as $_key=>$_val) {
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
}
} else {
foreach ($values as $_i=>$_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
}
}
if(!empty($params['assign'])) {
if (!empty($params['assign'])) {
$smarty->assign($params['assign'], $_html_result);
} else {
return implode("\n",$_html_result);
return implode("\n", $_html_result);
}
}
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels)
{
$_output = '';
if ($labels) $_output .= '<label>';
if ($labels) {
$_output .= '<label>';
}
$_output .= '<input type="checkbox" name="'
. smarty_function_escape_special_chars($name) . '[]" value="'
. smarty_function_escape_special_chars($value) . '"';
@ -134,10 +134,10 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
$_output .= ' checked="checked"';
}
$_output .= $extra . ' />' . $output;
if ($labels) $_output .= '</label>';
if ($labels) {
$_output .= '</label>';
}
$_output .= $separator;
return $_output;
}
?>