2 /***************************************************************
5 * (c) 1999-2005 Kasper Skaarhoj (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.
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
34 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
37 * [CLASS/FUNCTION INDEX of SCRIPT]
41 * 74: class SC_wizard_list
43 * 105: function main()
46 * (This index is automatically created/updated by the extension "extdeveval")
54 require ('template.php');
55 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
68 * Script Class for redirecting the user to the Web > List module if a wizard-link has been clicked in TCEforms
70 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
74 class SC_wizard_list
{
79 // Internal, static: GPvars
80 var $P; // Wizard parameters, coming from TCEforms linking to the wizard.
81 var $table; // Table to show, if none, then all tables are listed in list module.
82 var $id; // Page id to list.
89 * Initialization of the class, setting GPvars.
94 $this->P
= t3lib_div
::_GP('P');
95 $this->table
= t3lib_div
::_GP('table');
96 $this->id
= t3lib_div
::_GP('id');
101 * Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
108 $origRow = t3lib_BEfunc
::getRecord($this->P
['table'],$this->P
['uid']);
110 // Get TSconfig for it.
111 $TSconfig = t3lib_BEfunc
::getTCEFORM_TSconfig($this->table
,is_array($origRow)?
$origRow:array('pid'=>$this->P
['pid']));
114 if (substr($this->P
['params']['pid'],0,3)=='###' && substr($this->P
['params']['pid'],-3)=='###') {
115 $this->pid
= intval($TSconfig['_'.substr($this->P
['params']['pid'],3,-3)]);
116 } else $this->pid
= intval($this->P
['params']['pid']);
119 if (!strcmp($this->pid
,'') ||
strcmp($this->id
,'')) { // If pid is blank OR if id is set, then return...
120 header('Location: '.t3lib_div
::locationHeaderUrl($this->P
['returnUrl']));
121 } else { // Otherwise, show the list:
122 header('Location: '.t3lib_div
::locationHeaderUrl('db_list.php?id='.$this->pid
.'&table='.$this->P
['params']['table'].'&returnUrl='.rawurlencode(t3lib_div
::getIndpEnv('REQUEST_URI'))));
127 // Include extension?
128 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/wizard_list.php']) {
129 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/wizard_list.php']);
144 $SOBE = t3lib_div
::makeInstance('SC_wizard_list');
147 $SOBE->printContent();