[TASK] Clean up phpDoc comments in typo3/
[Packages/TYPO3.CMS.git] / typo3 / wizard_list.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
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 /**
29 * Wizard to list records from a page id.
30 *
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
32 * XHTML compliant
33 *
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
35 */
36
37 $BACK_PATH = '';
38 require('init.php');
39 require('template.php');
40 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
41
42 /**
43 * Script Class for redirecting the user to the Web > List module if a wizard-link has been clicked in TCEforms
44 *
45 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
46 * @package TYPO3
47 * @subpackage core
48 */
49 class SC_wizard_list {
50
51 // Internal, static:
52 // PID
53 var $pid;
54
55 // Internal, static: GPvars
56 // Wizard parameters, coming from TCEforms linking to the wizard.
57 var $P;
58 // Table to show, if none, then all tables are listed in list module.
59 var $table;
60 // Page id to list.
61 var $id;
62
63 /**
64 * Initialization of the class, setting GPvars.
65 *
66 * @return void
67 */
68 function init() {
69 $this->P = t3lib_div::_GP('P');
70 $this->table = t3lib_div::_GP('table');
71 $this->id = t3lib_div::_GP('id');
72 }
73
74 /**
75 * Main function
76 * Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
77 *
78 * @return void
79 */
80 function main() {
81
82 // Get this record
83 $origRow = t3lib_BEfunc::getRecord($this->P['table'], $this->P['uid']);
84
85 // Get TSconfig for it.
86 $TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->table, is_array($origRow)?$origRow:array('pid'=>$this->P['pid']));
87
88 // Set [params][pid]
89 if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') {
90 $this->pid = intval($TSconfig['_'.substr($this->P['params']['pid'], 3, -3)]);
91 } else $this->pid = intval($this->P['params']['pid']);
92
93 // Make redirect:
94 // If pid is blank OR if id is set, then return...
95 if (!strcmp($this->pid, '') || strcmp($this->id, '')) {
96 $redirectUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']);
97 } else { // Otherwise, show the list:
98 $urlParameters = array();
99 $urlParameters['id'] = $this->pid;
100 $urlParameters['table'] = $this->P['params']['table'];
101 $urlParameters['returnUrl'] = t3lib_div::getIndpEnv('REQUEST_URI');
102 $redirectUrl = t3lib_BEfunc::getModuleUrl('web_list', $urlParameters);
103 }
104 t3lib_utility_Http::redirect($redirectUrl);
105 }
106 }
107
108 // Make instance:
109 $SOBE = t3lib_div::makeInstance('SC_wizard_list');
110 $SOBE->init();
111 $SOBE->main();
112
113 ?>