Added $Id$ keywords, cleaned up comment tags
[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 * HTTP_GET_VARS:
31 * $table : Record table (or filename)
32 * $uid : Record uid (or "" when filename)
33 *
34 * @author Kasper Skaarhoj <kasper@typo3.com>
35 * @package TYPO3
36 * @subpackage core
37 *
38 */
39
40
41
42
43 $BACK_PATH="";
44 require ($BACK_PATH."init.php");
45 require ($BACK_PATH."template.php");
46 require_once (PATH_t3lib."class.t3lib_diff.php");
47 require_once (PATH_t3lib."class.t3lib_tcemain.php");
48 require ("sysext/lang/locallang_show_rechis.php");
49 require ("class.show_rechis.inc");
50
51
52 // ***************************
53 // Script Classes
54 // ***************************
55 class SC_show_rechis {
56 var $content;
57 var $doc;
58
59 function init() {
60 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
61
62 $this->doc = t3lib_div::makeInstance("mediumDoc");
63
64 $this->content.=$this->doc->startPage($LANG->getLL("title"));
65 $this->content.=$this->doc->header($LANG->getLL("title"));
66 $this->content.=$this->doc->spacer(5);
67 }
68 function main() {
69 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
70
71 $historyObj = t3lib_div::makeInstance("recordHistory");
72
73 // **********************************************************
74 // If link from sys log:
75 // sh_uid is the id-number of the sys_history log item
76 // **********************************************************
77 if (t3lib_div::GPvar("sh_uid")) {
78 $this->content.=$historyObj->displaySysHistoryEntry(t3lib_div::GPvar("sh_uid"));
79 }
80
81 // **********************************************************
82 // If link to element:
83 // **********************************************************
84 if (t3lib_div::GPvar("element")) {
85 if (t3lib_div::GPvar("revert") && t3lib_div::GPvar("sumUp")) {
86 $this->content.=$historyObj->revertToPreviousValues(t3lib_div::GPvar("element"),t3lib_div::GPvar("revert"));
87 }
88 if (t3lib_div::GPvar("saveState")) {
89 $this->content.=$historyObj->saveState(t3lib_div::GPvar("element"),t3lib_div::GPvar("saveState"));
90 }
91 $this->content.=$historyObj->displayHistory(t3lib_div::GPvar("element"));
92 }
93
94 // **********************************************************
95 // Return link:
96 // **********************************************************
97 $this->content.=t3lib_div::GPvar("returnUrl") ? $this->doc->section($LANG->getLL("return"),'<a href="'.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) : "";
98 }
99 function printContent() {
100 global $SOBE;
101
102 $this->content.=$this->doc->spacer(8);
103 $this->content.=$this->doc->middle();
104 $this->content.=$this->doc->endPage();
105 echo $this->content;
106 }
107
108 // ***************************
109 // OTHER FUNCTIONS:
110 // ***************************
111 }
112
113 // Include extension?
114 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/show_rechis.php"]) {
115 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/show_rechis.php"]);
116 }
117
118
119
120
121
122
123
124
125
126
127
128
129 // Make instance:
130 $SOBE = t3lib_div::makeInstance("SC_show_rechis");
131 $SOBE->init();
132 $SOBE->main();
133 $SOBE->printContent();
134 ?>