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