[TASK] Add more fixers for php-cs-fixer
[Packages/TYPO3.CMS.git] / typo3 / sysext / sys_action / Classes / ActionList.php
1 <?php
2 namespace TYPO3\CMS\SysAction;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Class for the list rendering of Web>Task Center module
19 */
20 class ActionList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
21 {
22 /**
23 * Creates the URL to this script, including all relevant GPvars
24 * Fixed GPvars are id, table, imagemode, returnUrl, search_field, search_levels and showLimit
25 * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $excludeList variable.
26 *
27 * @param string $alternativeId Alternative id value. Enter blank string for the current id ($this->id)
28 * @param string $table Table name to display. Enter "-1" for the current table.
29 * @param string $excludeList Comma separated list of fields NOT to include ("sortField" or "sortRev")
30 * @return string
31 */
32 public function listURL($alternativeId = '', $table = '-1', $excludeList = '')
33 {
34 $urlParameters = [];
35 if ((string)$alternativeId !== '') {
36 $urlParameters['id'] = $alternativeId;
37 } else {
38 $urlParameters['id'] = $this->id;
39 }
40 if ($table === '-1') {
41 $urlParameters['table'] = $this->table;
42 } else {
43 $urlParameters['table'] = $table;
44 }
45 if ($this->thumbs) {
46 $urlParameters['imagemode'] = $this->thumbs;
47 }
48 if ($this->returnUrl) {
49 $urlParameters['returnUrl'] = $this->returnUrl;
50 }
51 if ($this->searchString) {
52 $urlParameters['search_field'] = $this->searchString;
53 }
54 if ($this->searchLevels) {
55 $urlParameters['search_levels'] = $this->searchLevels;
56 }
57 if ($this->showLimit) {
58 $urlParameters['showLimit'] = $this->showLimit;
59 }
60 if ($this->firstElementNumber) {
61 $urlParameters['pointer'] = $this->firstElementNumber;
62 }
63 if ((!$excludeList || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($excludeList, 'sortField')) && $this->sortField) {
64 $urlParameters['sortField'] = $this->sortField;
65 }
66 if ((!$excludeList || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($excludeList, 'sortRev')) && $this->sortRev) {
67 $urlParameters['sortRev'] = $this->sortRev;
68 }
69 if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET')) {
70 $urlParameters['SET'] = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET');
71 }
72 if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('show')) {
73 $urlParameters['show'] = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('show');
74 }
75 return \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('user_task', $urlParameters);
76 }
77 }