Initial revision
[Packages/TYPO3.CMS.git] / typo3 / wizard_list.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skårhøj (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 * @author Kasper Skårhøj <kasper@typo3.com>
31 * @package TYPO3
32 * @subpackage core
33 *
34 */
35
36
37
38 $BACK_PATH="";
39 require ("init.php");
40 require ("template.php");
41 include ("sysext/lang/locallang_wizards.php");
42
43
44 // ***************************
45 // Script Classes
46 // ***************************
47 class SC_wizard_list {
48 var $P;
49 var $pid;
50 var $table;
51
52 function init() {
53 $this->P = t3lib_div::GPvar("P",1);
54 }
55 function main() {
56 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
57
58 $this->table = t3lib_div::GPvar("table");
59
60 // Get this record
61 $origRow = t3lib_BEfunc::getRecord($this->P["table"],$this->P["uid"]);
62
63 // Get TSconfig for it.
64 $TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->table,is_array($origRow)?$origRow:array("pid"=>$this->P["pid"]));
65 // Set [params][pid]
66 if (substr($this->P["params"]["pid"],0,3)=="###" && substr($this->P["params"]["pid"],-3)=="###") {
67 $this->pid = intval($TSconfig["_".substr($this->P["params"]["pid"],3,-3)]);
68 } else $this->pid = intval($this->P["params"]["pid"]);
69
70 if (!strcmp($this->pid,"") || strcmp(t3lib_div::GPvar("id"),"")) {
71 header("Location: ".t3lib_div::locationHeaderUrl($this->P["returnUrl"]));
72 } else {
73 header("Location: ".t3lib_div::locationHeaderUrl("db_list.php?id=".$this->pid."&table=".$this->P["params"]["table"]."&returnUrl=".rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI"))));
74 }
75 }
76 }
77
78 // Include extension?
79 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/wizard_list.php"]) {
80 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/wizard_list.php"]);
81 }
82
83
84
85
86
87
88
89
90
91
92
93
94 // Make instance:
95 $SOBE = t3lib_div::makeInstance("SC_wizard_list");
96 $SOBE->init();
97 $SOBE->main();
98 $SOBE->printContent();
99 ?>