diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js b/typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js index 67212c4f6d77ed1fec440b2f39e71213f3c70b88..b6ca661c7162b5ae4a509e0347a24f7671c6b6bb 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js @@ -91,7 +91,7 @@ define(['jquery', 'jquery/autocomplete', 'TYPO3/CMS/Backend/jquery.clearable'], // set up the events $(containerSelector).on('click', '.t3js-live-search-show-all', function(evt) { evt.preventDefault(); - TYPO3.ModuleMenu.App.showModule('web_list', 'id=0&search_levels=4&search_field=' + encodeURIComponent($(searchFieldSelector).val())); + TYPO3.ModuleMenu.App.showModule('web_list', 'id=0&search_levels=-1&search_field=' + encodeURIComponent($(searchFieldSelector).val())); }); $(containerSelector).on('click', '.dropdown-list-link', function(evt) { evt.preventDefault(); diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index 57ba8b6e3c25a63edff59caa95515ba064d47140..8f65d06d77ecf1cdc7b6dd110edf360b89a1d9a3 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -1022,6 +1022,14 @@ return array( tt_content.after = pages,backend_layout,sys_template sys_category.after = tt_content } + mod.web_list.searchLevel.items { + -1 = EXT:lang/locallang_core.xlf:labels.searchLevel.infinite + 0 = EXT:lang/locallang_core.xlf:labels.searchLevel.0 + 1 = EXT:lang/locallang_core.xlf:labels.searchLevel.1 + 2 = EXT:lang/locallang_core.xlf:labels.searchLevel.2 + 3 = EXT:lang/locallang_core.xlf:labels.searchLevel.3 + 4 = EXT:lang/locallang_core.xlf:labels.searchLevel.4 + } mod.wizards.newRecord.pages.show.pageInside=1 mod.wizards.newRecord.pages.show.pageAfter=1 mod.wizards.newRecord.pages.show.pageSelectPosition=1 diff --git a/typo3/sysext/core/Documentation/Changelog/master/Important-70849-MakeSearchLevelsConsistent.rst b/typo3/sysext/core/Documentation/Changelog/master/Important-70849-MakeSearchLevelsConsistent.rst new file mode 100644 index 0000000000000000000000000000000000000000..aebec6f6c1250898b94f52efa4bf8cb29c4baaca --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Important-70849-MakeSearchLevelsConsistent.rst @@ -0,0 +1,22 @@ +================================================================================ +Important: #70849 - Make search levels in live search and list search consistent +================================================================================ + +Description +=========== + +In order to make the searchlevel handling consistent between live and list search a new PageTS option has been added. + +.. code-block:: typoscript + + mod.web_list.searchLevel.items { + -1 = EXT:lang/locallang_core.xlf:labels.searchLevel.infinite + 0 = EXT:lang/locallang_core.xlf:labels.searchLevel.0 + 1 = EXT:lang/locallang_core.xlf:labels.searchLevel.1 + 2 = EXT:lang/locallang_core.xlf:labels.searchLevel.2 + 3 = EXT:lang/locallang_core.xlf:labels.searchLevel.3 + 4 = EXT:lang/locallang_core.xlf:labels.searchLevel.4 + } + +This makes it possible to add custom search level entries. + diff --git a/typo3/sysext/lang/locallang_core.xlf b/typo3/sysext/lang/locallang_core.xlf index e5c7791fbc2dc1688164452dd6009be6c24285af..bbf0a4027db703bae1e15675ed2f2835791dc4a4 100644 --- a/typo3/sysext/lang/locallang_core.xlf +++ b/typo3/sysext/lang/locallang_core.xlf @@ -66,6 +66,24 @@ <trans-unit id="labels.enterSearchLevels"> <source>This page|1 level down|2 levels down|3 levels down|4 levels down</source> </trans-unit> + <trans-unit id="labels.searchLevel.0"> + <source>This page</source> + </trans-unit> + <trans-unit id="labels.searchLevel.1"> + <source>1 level down</source> + </trans-unit> + <trans-unit id="labels.searchLevel.2"> + <source>2 levels down</source> + </trans-unit> + <trans-unit id="labels.searchLevel.3"> + <source>3 levels down</source> + </trans-unit> + <trans-unit id="labels.searchLevel.4"> + <source>4 levels down</source> + </trans-unit> + <trans-unit id="labels.searchLevel.infinite"> + <source>Infinite levels</source> + </trans-unit> <trans-unit id="labels.noEditPermission"> <source>Sorry, you didn't have proper permissions to perform this change.</source> </trans-unit> diff --git a/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php index a5076b4db062691a6f406177a766abd0e89c9c20..05b71fc857b19caf5b394cc18da044da1ad3a4e8 100644 --- a/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php +++ b/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php @@ -29,6 +29,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\HttpUtility; use TYPO3\CMS\Core\Utility\MathUtility; +use TYPO3\CMS\Core\Utility\ArrayUtility; /** * Child class for rendering of Web > List (not the final class) @@ -549,8 +550,22 @@ class AbstractDatabaseRecordList extends AbstractRecordList } // Make level selector: $opt = array(); - $parts = explode('|', $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.enterSearchLevels')); - foreach ($parts as $kv => $label) { + + // "New" generation of search levels ... based on TS config + $config = BackendUtility::getPagesTSconfig($this->id); + $searchLevelsFromTSconfig = $config['mod.']['web_list.']['searchLevel.']['items.']; + $searchLevelItems = array(); + + // get translated labels for search levels from pagets + foreach ($searchLevelsFromTSconfig as $keySearchLevel => $labelConfigured ) { + $label = $lang->sL('LLL:' . $labelConfigured, false); + if ($label === '') { + $label = $labelConfigured; + } + $searchLevelItems[$keySearchLevel] = $label; + } + + foreach ($searchLevelItems as $kv => $label) { $opt[] = '<option value="' . $kv . '"' . ($kv === $this->searchLevels ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>'; } $lMenu = '<select class="form-control" name="search_levels" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.search_levels', true) . '" id="search_levels">' . implode('', $opt) . '</select>';