Added more comments, $Id$ keywords etc for the whole core of TYPO3.
[Packages/TYPO3.CMS.git] / typo3 / show_rechis.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 * Shows information about a database or file item
29 *
30 * $Id$
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
32 * XHTML Compliant
33 *
34 * @author Kasper Skaarhoj <kasper@typo3.com>
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 80: class SC_show_rechis
42 * 89: function init()
43 * 104: function main()
44 * 141: function printContent()
45 *
46 * TOTAL FUNCTIONS: 3
47 * (This index is automatically created/updated by the extension "extdeveval")
48 *
49 */
50
51
52
53 $BACK_PATH='';
54 require ($BACK_PATH.'init.php');
55 require ($BACK_PATH.'template.php');
56 require_once (PATH_t3lib.'class.t3lib_diff.php');
57 require_once (PATH_t3lib.'class.t3lib_tcemain.php');
58 require ('sysext/lang/locallang_show_rechis.php');
59 require ('class.show_rechis.inc');
60
61
62
63
64
65
66
67
68
69 /**
70 * Script Class
71 *
72 * HTTP_GET_VARS:
73 * $table : Record table (or filename)
74 * $uid : Record uid (or "" when filename)
75 *
76 * @author Kasper Skaarhoj <kasper@typo3.com>
77 * @package TYPO3
78 * @subpackage core
79 */
80 class SC_show_rechis {
81 var $content;
82 var $doc;
83
84 /**
85 * Initialize the module output
86 *
87 * @return void
88 */
89 function init() {
90 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
91
92 $this->doc = t3lib_div::makeInstance('mediumDoc');
93
94 $this->content.=$this->doc->startPage($LANG->getLL('title'));
95 $this->content.=$this->doc->header($LANG->getLL('title'));
96 $this->content.=$this->doc->spacer(5);
97 }
98
99 /**
100 * Generate module output
101 *
102 * @return void
103 */
104 function main() {
105 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
106
107 $historyObj = t3lib_div::makeInstance('recordHistory');
108
109 // **********************************************************
110 // If link from sys log:
111 // sh_uid is the id-number of the sys_history log item
112 // **********************************************************
113 if (t3lib_div::GPvar('sh_uid')) {
114 $this->content.=$historyObj->displaySysHistoryEntry(t3lib_div::GPvar('sh_uid'));
115 }
116
117 // **********************************************************
118 // If link to element:
119 // **********************************************************
120 if (t3lib_div::GPvar('element')) {
121 if (t3lib_div::GPvar('revert') && t3lib_div::GPvar('sumUp')) {
122 $this->content.=$historyObj->revertToPreviousValues(t3lib_div::GPvar('element'),t3lib_div::GPvar('revert'));
123 }
124 if (t3lib_div::GPvar('saveState')) {
125 $this->content.=$historyObj->saveState(t3lib_div::GPvar('element'),t3lib_div::GPvar('saveState'));
126 }
127 $this->content.=$historyObj->displayHistory(t3lib_div::GPvar('element'));
128 }
129
130 // **********************************************************
131 // Return link:
132 // **********************************************************
133 $this->content.=t3lib_div::GPvar('returnUrl') ? $this->doc->section($LANG->getLL('return'),'<a href="'.htmlspecialchars(t3lib_div::GPvar('returnUrl')).'" class="typo3-goBack"><img src="gfx/goback.gif" width="14" height="14" hspace="2" border="0" align="top" alt="" /><strong>'.$LANG->getLL('returnLink').'</strong></a>',0,1) : '';
134 }
135
136 /**
137 * Print content
138 *
139 * @return void
140 */
141 function printContent() {
142 $this->content.=$this->doc->spacer(8);
143 $this->content.=$this->doc->middle();
144 $this->content.=$this->doc->endPage();
145 echo $this->content;
146 }
147 }
148
149 // Include extension?
150 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/show_rechis.php']) {
151 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/show_rechis.php']);
152 }
153
154
155
156
157
158
159
160
161
162
163
164
165 // Make instance:
166 $SOBE = t3lib_div::makeInstance('SC_show_rechis');
167 $SOBE->init();
168 $SOBE->main();
169 $SOBE->printContent();
170 ?>