[BUGFIX] sys_action: Fix Record List page switching
[Packages/TYPO3.CMS.git] / typo3 / sysext / sys_action / task / class.tx_sysaction_list.php
1 <?php
2 /*************************************************************
3 * Copyright notice
4 *
5 * (c) 2011 Thomas Maroschik <tmaroschik@dfau.de>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Class for the list rendering of Web>Task Center module
29 *
30 * @author Thomas Maroschik <tmaroschik@dfau.de>
31 * @package TYPO3
32 * @subpackage core
33 */
34 class tx_sysaction_list extends localRecordList {
35
36 /**
37 * Creates the URL to this script, including all relevant GPvars
38 * Fixed GPvars are id, table, imagemode, returnUrl, search_field, search_levels and showLimit
39 * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $exclList variable.
40 *
41 * @param string $altId Alternative id value. Enter blank string for the current id ($this->id)
42 * @param string $table Table name to display. Enter "-1" for the current table.
43 * @param string $exclList Comma separated list of fields NOT to include ("sortField" or "sortRev")
44 * @return string
45 */
46 function listURL($altId = '', $table = -1, $exclList = '') {
47 $urlParameters = array();
48 if (strcmp($altId, '')) {
49 $urlParameters['id'] = $altId;
50 } else {
51 $urlParameters['id'] = $this->id;
52 }
53 if ($table === -1) {
54 $urlParameters['table'] = $this->table;
55 } else {
56 $urlParameters['table'] = $table;
57 }
58 if ($this->thumbs) {
59 $urlParameters['imagemode'] = $this->thumbs;
60 }
61 if ($this->returnUrl) {
62 $urlParameters['returnUrl'] = $this->returnUrl;
63 }
64 if ($this->searchString) {
65 $urlParameters['search_field'] = $this->searchString;
66 }
67 if ($this->searchLevels) {
68 $urlParameters['search_levels'] = $this->searchLevels;
69 }
70 if ($this->showLimit) {
71 $urlParameters['showLimit'] = $this->showLimit;
72 }
73 if ($this->firstElementNumber) {
74 $urlParameters['pointer'] = $this->firstElementNumber;
75 }
76 if ((!$exclList || !t3lib_div::inList($exclList, 'sortField')) && $this->sortField) {
77 $urlParameters['sortField'] = $this->sortField;
78 }
79 if ((!$exclList || !t3lib_div::inList($exclList, 'sortRev')) && $this->sortRev) {
80 $urlParameters['sortRev'] = $this->sortRev;
81 }
82 if (t3lib_div::_GP('SET')) {
83 $urlParameters['SET'] = t3lib_div::_GP('SET');
84 }
85 if (t3lib_div::_GP('show')) {
86 $urlParameters['show'] = intval(t3lib_div::_GP('show'));
87 }
88
89 return t3lib_BEfunc::getModuleUrl('user_task', $urlParameters);
90 }
91 }
92
93 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_list.php'])) {
94 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_list.php']);
95 }
96
97 ?>