2 /***************************************************************
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
28 * Wizard to list records from a page id.
30 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
40 require ('template.php');
41 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
54 * Script Class for redirecting the user to the Web > List module if a wizard-link has been clicked in TCEforms
56 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
60 class SC_wizard_list
{
65 // Internal, static: GPvars
66 var $P; // Wizard parameters, coming from TCEforms linking to the wizard.
67 var $table; // Table to show, if none, then all tables are listed in list module.
68 var $id; // Page id to list.
75 * Initialization of the class, setting GPvars.
80 $this->P
= t3lib_div
::_GP('P');
81 $this->table
= t3lib_div
::_GP('table');
82 $this->id
= t3lib_div
::_GP('id');
87 * Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
94 $origRow = t3lib_BEfunc
::getRecord($this->P
['table'],$this->P
['uid']);
96 // Get TSconfig for it.
97 $TSconfig = t3lib_BEfunc
::getTCEFORM_TSconfig($this->table
,is_array($origRow)?
$origRow:array('pid'=>$this->P
['pid']));
100 if (substr($this->P
['params']['pid'],0,3)=='###' && substr($this->P
['params']['pid'],-3)=='###') {
101 $this->pid
= intval($TSconfig['_'.substr($this->P
['params']['pid'],3,-3)]);
102 } else $this->pid
= intval($this->P
['params']['pid']);
105 if (!strcmp($this->pid
,'') ||
strcmp($this->id
,'')) { // If pid is blank OR if id is set, then return...
106 $redirectUrl = t3lib_div
::sanitizeLocalUrl($this->P
['returnUrl']);
107 } else { // Otherwise, show the list:
108 $urlParameters = array();
109 $urlParameters['id'] = $this->pid
;
110 $urlParameters['table'] = $this->P
['params']['table'];
111 $urlParameters['returnUrl'] = t3lib_div
::getIndpEnv('REQUEST_URI');
112 $redirectUrl = t3lib_BEfunc
::getModuleUrl('web_list', $urlParameters);
114 t3lib_utility_Http
::redirect($redirectUrl);
119 $SOBE = t3lib_div
::makeInstance('SC_wizard_list');