fix phpcs

This commit is contained in:
Frédéric FRANCE 2020-12-11 13:43:03 +01:00 committed by GitHub
parent 7ac3bb1b67
commit eb2d7fa657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5930,24 +5930,24 @@ class Form
* *
* @param string $prefix Prefix * @param string $prefix Prefix
* @param string $selected Selected duration type * @param string $selected Selected duration type
* @param array|null $ecludetypes Array of duration types to exclude. Example array('y', 'm') * @param array|null $excludetypes Array of duration types to exclude. Example array('y', 'm')
* @return string HTML select string * @return string HTML select string
*/ */
public function selectTypeDuration($prefix, $selected = 'i', $excludtypes = null) public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = null)
{ {
global $langs; global $langs;
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes')); $TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
// Removed undesired duration types // Removed undesired duration types
if (is_array($excludtypes)) { if (is_array($excludetypes)) {
foreach($excludtypes as $value) { foreach($excludetypes as $value) {
unset($TDurationTypes[$value]); unset($TDurationTypes[$value]);
} }
} }
$retstring = '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; $retstring = '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
foreach ($TDurationTypes as $key=>$typeduration) { foreach ($TDurationTypes as $key => $typeduration) {
$retstring .= '<option value="'.$key.'"'; $retstring .= '<option value="'.$key.'"';
if ($key == $selected) { if ($key == $selected) {
$retstring .= " selected"; $retstring .= " selected";