Added more comments, $Id$ keywords etc for the whole core of TYPO3.
[Packages/TYPO3.CMS.git] / typo3 / wizard_list.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skaarhoj (kasper@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 * Wizard to list records
29 *
30 * $Id$
31 *
32 * @author Kasper Skaarhoj <kasper@typo3.com>
33 */
34 /**
35 * [CLASS/FUNCTION INDEX of SCRIPT]
36 *
37 *
38 *
39 * 72: class SC_wizard_list
40 * 80: function init()
41 * 89: function main()
42 *
43 * TOTAL FUNCTIONS: 2
44 * (This index is automatically created/updated by the extension "extdeveval")
45 *
46 */
47
48
49
50 $BACK_PATH='';
51 require ('init.php');
52 require ('template.php');
53 include ('sysext/lang/locallang_wizards.php');
54
55
56
57
58
59
60
61
62
63
64
65 /**
66 * Script Class
67 *
68 * @author Kasper Skaarhoj <kasper@typo3.com>
69 * @package TYPO3
70 * @subpackage core
71 */
72 class SC_wizard_list {
73 var $P;
74 var $pid;
75 var $table;
76
77 /**
78 * @return [type] ...
79 */
80 function init() {
81 $this->P = t3lib_div::GPvar('P',1);
82 }
83
84 /**
85 * [Describe function...]
86 *
87 * @return [type] ...
88 */
89 function main() {
90 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
91
92 $this->table = t3lib_div::GPvar("table");
93
94 // Get this record
95 $origRow = t3lib_BEfunc::getRecord($this->P["table"],$this->P["uid"]);
96
97 // Get TSconfig for it.
98 $TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->table,is_array($origRow)?$origRow:array("pid"=>$this->P["pid"]));
99 // Set [params][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"]);
103
104 if (!strcmp($this->pid,"") || strcmp(t3lib_div::GPvar("id"),"")) {
105 header("Location: ".t3lib_div::locationHeaderUrl($this->P["returnUrl"]));
106 } else {
107 header("Location: ".t3lib_div::locationHeaderUrl("db_list.php?id=".$this->pid."&table=".$this->P["params"]["table"]."&returnUrl=".rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI"))));
108 }
109 }
110 }
111
112 // Include extension?
113 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_list.php']) {
114 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_list.php']);
115 }
116
117
118
119
120
121
122
123
124
125
126
127
128 // Make instance:
129 $SOBE = t3lib_div::makeInstance('SC_wizard_list');
130 $SOBE->init();
131 $SOBE->main();
132 $SOBE->printContent();
133 ?>