[BUGFIX] t3lib_http_Request can not be loaded in frontend
[Packages/TYPO3.CMS.git] / typo3 / show_rechis.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 * Shows information about a database or file item
29 *
30 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
31 * XHTML Compliant
32 *
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
34 */
35
36 $BACK_PATH='';
37 require ($BACK_PATH.'init.php');
38 require ($BACK_PATH.'template.php');
39 $LANG->includeLLFile('EXT:lang/locallang_show_rechis.xml');
40 require_once ('class.show_rechis.inc');
41
42 /**
43 * Script Class for showing the history module of TYPO3s backend
44 *
45 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
46 * @package TYPO3
47 * @subpackage core
48 * @see class.show_rechis.inc
49 */
50 class SC_show_rechis {
51
52 // Internal:
53 var $content;
54
55 /**
56 * Document template object
57 *
58 * @var mediumDoc
59 */
60 var $doc;
61
62 /**
63 * Initialize the module output
64 *
65 * @return void
66 */
67 function init() {
68
69 // Create internal template object:
70 $this->doc = t3lib_div::makeInstance('template');
71 $this->doc->backPath = $GLOBALS['BACK_PATH'];
72 $this->doc->setModuleTemplate('templates/show_rechis.html');
73
74 // Start the page header:
75 $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
76 }
77
78 /**
79 * Generate module output
80 *
81 * @return void
82 */
83 function main() {
84
85 // Start history object
86 $historyObj = t3lib_div::makeInstance('recordHistory');
87
88 // Get content:
89 $this->content .= $historyObj->main();
90
91 // Setting up the buttons and markers for docheader
92 $docHeaderButtons = $this->getButtons();
93 $markers['CONTENT'] = $this->content;
94 $markers['CSH'] = $docHeaderButtons['csh'];
95
96 // Build the <body> for the module
97 $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
98 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
99 }
100
101 /**
102 * Outputting the accumulated content to screen
103 *
104 * @return void
105 */
106 function printContent() {
107 $this->content .= $this->doc->endPage();
108 $this->content = $this->doc->insertStylesAndJS($this->content);
109 echo $this->content;
110 }
111
112 /**
113 * Create the panel of buttons for submitting the form or otherwise perform operations.
114 *
115 * @return array all available buttons as an assoc. array
116 */
117 protected function getButtons() {
118 $buttons = array(
119 'csh' => '',
120 'back' => ''
121 );
122
123 // CSH
124 $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
125
126 // Start history object
127 $historyObj = t3lib_div::makeInstance('recordHistory');
128
129 if ($historyObj->returnUrl) {
130 $buttons['back'] = '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>';
131 }
132
133 return $buttons;
134 }
135 }
136
137 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/show_rechis.php'])) {
138 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/show_rechis.php']);
139 }
140
141 // Make instance:
142 $SOBE = t3lib_div::makeInstance('SC_show_rechis');
143 $SOBE->init();
144 $SOBE->main();
145 $SOBE->printContent();
146
147 ?>