Commit fdcb412a authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Benjamin Franzke
Browse files

[BUGFIX] Use `form-select` class for <select> fields

With Bootstrap 5, <select> fields make use of the class `form-select`.
This patch aims to replace every occurrence of `form-control` used with
select fields. Since Bootstrap finally brings proper styling for select
boxes, the custom implementation rendering chevrons can be removed.

In the same run, the `input-$size` classes are migrated to its new class
names and some obsolete classes have been removed.

Resolves: #93135
Releases: master
Change-Id: I0044127cc380bddfbaec0b9f730123959f7288bd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67247

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarMartin Kutschker <mkutschker-typo3@yahoo.com>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: default avatarMartin Kutschker <mkutschker-typo3@yahoo.com>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
parent 6ed3053c
...@@ -70,7 +70,7 @@ class FileStorageIndexingAdditionalFieldProvider implements AdditionalFieldProvi ...@@ -70,7 +70,7 @@ class FileStorageIndexingAdditionalFieldProvider implements AdditionalFieldProvi
$fieldName = 'tx_scheduler[scheduler_fileStorageIndexing_storage]'; $fieldName = 'tx_scheduler[scheduler_fileStorageIndexing_storage]';
$fieldId = 'scheduler_fileStorageIndexing_storage'; $fieldId = 'scheduler_fileStorageIndexing_storage';
$fieldHtml = '<select class="form-control" name="' . $fieldName . '" id="' . $fieldId . '">' . implode("\n", $options) . '</select>'; $fieldHtml = '<select class="form-select" name="' . $fieldName . '" id="' . $fieldId . '">' . implode("\n", $options) . '</select>';
$fieldConfiguration = [ $fieldConfiguration = [
'code' => $fieldHtml, 'code' => $fieldHtml,
......
...@@ -77,7 +77,7 @@ class IpAnonymizationAdditionalFieldProvider extends AbstractAdditionalFieldProv ...@@ -77,7 +77,7 @@ class IpAnonymizationAdditionalFieldProvider extends AbstractAdditionalFieldProv
$fieldId = 'task_ipAnonymization_table'; $fieldId = 'task_ipAnonymization_table';
$fieldHtml = []; $fieldHtml = [];
// Add table drop down html // Add table drop down html
$fieldHtml[] = '<select class="form-control" name="' . $fieldName . '" id="' . $fieldId . '">' . implode(LF, $options) . '</select>'; $fieldHtml[] = '<select class="form-select" name="' . $fieldName . '" id="' . $fieldId . '">' . implode(LF, $options) . '</select>';
$fieldConfiguration = [ $fieldConfiguration = [
'code' => implode(LF, $fieldHtml), 'code' => implode(LF, $fieldHtml),
'label' => 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.ipAnonymization.table', 'label' => 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.ipAnonymization.table',
...@@ -136,7 +136,7 @@ class IpAnonymizationAdditionalFieldProvider extends AbstractAdditionalFieldProv ...@@ -136,7 +136,7 @@ class IpAnonymizationAdditionalFieldProvider extends AbstractAdditionalFieldProv
. '</option>'; . '</option>';
} }
$fieldHtml = '<select class="form-control" name="' . $fieldName . '" id="' . $fieldId . '">' . $fieldHtml . '</select>'; $fieldHtml = '<select class="form-select" name="' . $fieldName . '" id="' . $fieldId . '">' . $fieldHtml . '</select>';
$fieldConfiguration = [ $fieldConfiguration = [
'code' => $fieldHtml, 'code' => $fieldHtml,
......
...@@ -61,7 +61,7 @@ class OptimizeDatabaseTableAdditionalFieldProvider extends AbstractAdditionalFie ...@@ -61,7 +61,7 @@ class OptimizeDatabaseTableAdditionalFieldProvider extends AbstractAdditionalFie
$fieldName = 'tx_scheduler[scheduler_optimizeDatabaseTables_selectedTables][]'; $fieldName = 'tx_scheduler[scheduler_optimizeDatabaseTables_selectedTables][]';
$fieldId = 'scheduler_optimizeDatabaseTables_selectedTables'; $fieldId = 'scheduler_optimizeDatabaseTables_selectedTables';
$fieldOptions = $this->getDatabaseTableOptions($taskInfo['scheduler_optimizeDatabaseTables_selectedTables']); $fieldOptions = $this->getDatabaseTableOptions($taskInfo['scheduler_optimizeDatabaseTables_selectedTables']);
$fieldHtml = '<select class="form-control" name="' . $fieldName $fieldHtml = '<select class="form-select" name="' . $fieldName
. '" id="' . $fieldId . '" id="' . $fieldId
. '" class="from-control" size="10" multiple="multiple">' . '" class="from-control" size="10" multiple="multiple">'
. $fieldOptions . $fieldOptions
......
...@@ -128,7 +128,7 @@ class TableGarbageCollectionAdditionalFieldProvider extends AbstractAdditionalFi ...@@ -128,7 +128,7 @@ class TableGarbageCollectionAdditionalFieldProvider extends AbstractAdditionalFi
$fieldId = 'task_tableGarbageCollection_table'; $fieldId = 'task_tableGarbageCollection_table';
$fieldHtml = []; $fieldHtml = [];
// Add table drop down html // Add table drop down html
$fieldHtml[] = '<select class="form-control" name="' . $fieldName . '"' . $disabled . ' id="' . $fieldId . '">' . implode(LF, $options) . '</select>'; $fieldHtml[] = '<select class="form-select" name="' . $fieldName . '"' . $disabled . ' id="' . $fieldId . '">' . implode(LF, $options) . '</select>';
// Add js array for default 'number of days' values // Add js array for default 'number of days' values
$fieldHtml[] = '<script>/*<![CDATA[*/<!--'; $fieldHtml[] = '<script>/*<![CDATA[*/<!--';
$fieldHtml[] = 'var defaultNumberOfDays = ' . json_encode($this->defaultNumberOfDays) . ';'; $fieldHtml[] = 'var defaultNumberOfDays = ' . json_encode($this->defaultNumberOfDays) . ';';
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<input type="hidden" name="tx_scheduler[class]" id="task_class" value="{task_class}"> <input type="hidden" name="tx_scheduler[class]" id="task_class" value="{task_class}">
</f:then> </f:then>
<f:else> <f:else>
<select name="tx_scheduler[class]" id="task_class" class="form-control"> <select name="tx_scheduler[class]" id="task_class" class="form-select">
<f:for each="{groupedClasses}" as="classGroup" key="extension"> <f:for each="{groupedClasses}" as="classGroup" key="extension">
<optgroup label="{extension}"> <optgroup label="{extension}">
<f:for each="{classGroup}" as="classInfo" key="class"> <f:for each="{classGroup}" as="classInfo" key="class">
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div class="form-group"> <div class="form-group">
<f:be.labels.csh table="{csh}" field="task_type" label="{lang}label.type"/> <f:be.labels.csh table="{csh}" field="task_type" label="{lang}label.type"/>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select name="tx_scheduler[type]" id="task_type" class="form-control"> <select name="tx_scheduler[type]" id="task_type" class="form-select">
<option value="1" {task_type_selected_1}><f:translate key="{lang}label.type.single" /></option> <option value="1" {task_type_selected_1}><f:translate key="{lang}label.type.single" /></option>
<option value="2" {task_type_selected_2}><f:translate key="{lang}label.type.recurring" /></option> <option value="2" {task_type_selected_2}><f:translate key="{lang}label.type.recurring" /></option>
</select> </select>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<f:be.labels.csh table="{csh}" field="task_group" label="{lang}label.group"/> <f:be.labels.csh table="{csh}" field="task_group" label="{lang}label.group"/>
<div class="form-control-wrap"> <div class="form-control-wrap">
<div class="input-group"> <div class="input-group">
<select name="tx_scheduler[task_group]" id="task_class" class="form-control"> <select name="tx_scheduler[task_group]" id="task_class" class="form-select">
<option value="0" title=""></option> <option value="0" title=""></option>
<f:for each="{registeredTaskGroups}" as="registeredTaskGroup"> <f:for each="{registeredTaskGroups}" as="registeredTaskGroup">
<option value="{registeredTaskGroup.uid}" title="{registeredTaskGroup.groupName}" {registeredTaskGroup.selected}> <option value="{registeredTaskGroup.uid}" title="{registeredTaskGroup.groupName}" {registeredTaskGroup.selected}>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<div class="btn-group"> <div class="btn-group">
<select <select
data-update-task-frequency data-update-task-frequency
class="form-control tceforms-select tceforms-wizardselect"> class="form-select">
<option></option> <option></option>
<f:for each="{frequencyOptions}" as="label" key="command"> <f:for each="{frequencyOptions}" as="label" key="command">
<option value="{command}">{f:translate(key:label,default:label)} ({command})</option> <option value="{command}">{f:translate(key:label,default:label)} ({command})</option>
......
...@@ -485,9 +485,12 @@ class SetupModuleController ...@@ -485,9 +485,12 @@ class SetupModuleController
$label = $this->getCSH($config['csh'] ?: $fieldName, $label, $fieldName); $label = $this->getCSH($config['csh'] ?: $fieldName, $label, $fieldName);
$type = $config['type']; $type = $config['type'];
$class = $config['class']; $class = $config['class'];
if ($type !== 'check') { if ($type !== 'check' && $type !== 'select') {
$class .= ' form-control'; $class .= ' form-control';
} }
if ($type === 'select') {
$class .= ' form-select';
}
$more = ''; $more = '';
if ($class) { if ($class) {
$more .= ' class="' . htmlspecialchars($class) . '"'; $more .= ' class="' . htmlspecialchars($class) . '"';
...@@ -711,7 +714,7 @@ class SetupModuleController ...@@ -711,7 +714,7 @@ class SetupModuleController
} }
ksort($languageOptions); ksort($languageOptions);
$languageCode = ' $languageCode = '
<select aria-labelledby="label_lang" id="field_lang" name="data[lang]" class="form-control">' . implode('', $languageOptions) . ' <select aria-labelledby="label_lang" id="field_lang" name="data[lang]" class="form-select">' . implode('', $languageOptions) . '
</select>'; </select>';
if ($backendUser->uc['lang'] && !@is_dir(Environment::getLabelsPath() . '/' . $backendUser->uc['lang'])) { if ($backendUser->uc['lang'] && !@is_dir(Environment::getLabelsPath() . '/' . $backendUser->uc['lang'])) {
$languageUnavailableWarning = htmlspecialchars(sprintf($language->getLL('languageUnavailable'), $language->getLL('lang_' . $backendUser->uc['lang']))) . '&nbsp;&nbsp;<br />&nbsp;&nbsp;' . htmlspecialchars($language->getLL('languageUnavailable.' . ($backendUser->isAdmin() ? 'admin' : 'user'))); $languageUnavailableWarning = htmlspecialchars(sprintf($language->getLL('languageUnavailable'), $language->getLL('lang_' . $backendUser->uc['lang']))) . '&nbsp;&nbsp;<br />&nbsp;&nbsp;' . htmlspecialchars($language->getLL('languageUnavailable.' . ($backendUser->isAdmin() ? 'admin' : 'user')));
...@@ -755,7 +758,7 @@ class SetupModuleController ...@@ -755,7 +758,7 @@ class SetupModuleController
$startModuleSelect .= '<optgroup label="' . htmlspecialchars($groupLabel) . '">' . $modules . '</optgroup>'; $startModuleSelect .= '<optgroup label="' . htmlspecialchars($groupLabel) . '">' . $modules . '</optgroup>';
} }
} }
return '<select id="field_startModule" aria-labelledby="label_startModule" name="data[startModule]" class="form-control">' . $startModuleSelect . '</select>'; return '<select id="field_startModule" aria-labelledby="label_startModule" name="data[startModule]" class="form-select">' . $startModuleSelect . '</select>';
} }
/** /**
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="form-section workspace-panel" id="workspace-panel" data-page-uid="{pageUid}"> <div class="form-section workspace-panel" id="workspace-panel" data-page-uid="{pageUid}">
<form id="workspace-settings-form" class="form-inline form-inline-spaced"> <form id="workspace-settings-form" class="form-inline form-inline-spaced">
<div class="form-group"> <div class="form-group">
<select name="depth" class="form-control" disabled> <select name="depth" class="form-select" disabled>
<option value="0"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_0" /></option> <option value="0"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_0" /></option>
<option value="1"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_1" /></option> <option value="1"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_1" /></option>
<option value="2"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_2" /></option> <option value="2"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_2" /></option>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon input-group-icon"></span> <span class="input-group-addon input-group-icon"></span>
<select name="languages" class="form-control" disabled></select> <select name="languages" class="form-select" disabled></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -70,17 +70,17 @@ ...@@ -70,17 +70,17 @@
</div> </div>
<form id="workspace-actions-form" class="form-inline form-inline-spaced"> <form id="workspace-actions-form" class="form-inline form-inline-spaced">
<div class="form-group"> <div class="form-group">
<select name="stage-action" class="form-control" disabled> <select name="stage-action" class="form-select" disabled>
<option value=""><f:translate key="chooseAction" /></option> <option value=""><f:translate key="chooseAction" /></option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<select name="selection-action" class="form-control" disabled> <select name="selection-action" class="form-select" disabled>
<option value=""><f:translate key="chooseSelectionAction" /></option> <option value=""><f:translate key="chooseSelectionAction" /></option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<select name="mass-action" class="form-control" disabled> <select name="mass-action" class="form-select" disabled>
<option value=""><f:translate key="chooseMassAction" /></option> <option value=""><f:translate key="chooseMassAction" /></option>
</select> </select>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment