[BUGFIX] Show correct record title
[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 * [CLASS/FUNCTION INDEX of SCRIPT]
37 *
38 *
39 *
40 * 76: class SC_show_rechis
41 * 87: function init()
42 * 105: function main()
43 * 131: function printContent()
44 *
45 * TOTAL FUNCTIONS: 3
46 * (This index is automatically created/updated by the extension "extdeveval")
47 *
48 */
49
50
51 $BACK_PATH='';
52 require ($BACK_PATH.'init.php');
53 require ($BACK_PATH.'template.php');
54 $LANG->includeLLFile('EXT:lang/locallang_show_rechis.xml');
55 require_once ('class.show_rechis.inc');
56
57
58
59
60
61
62
63
64
65 /**
66 * Script Class for showing the history module of TYPO3s backend
67 *
68 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
69 * @package TYPO3
70 * @subpackage core
71 * @see class.show_rechis.inc
72 */
73 class SC_show_rechis {
74
75 // Internal:
76 var $content;
77
78 /**
79 * Document template object
80 *
81 * @var mediumDoc
82 */
83 var $doc;
84
85 /**
86 * Initialize the module output
87 *
88 * @return void
89 */
90 function init() {
91
92 // Create internal template object:
93 $this->doc = t3lib_div::makeInstance('template');
94 $this->doc->backPath = $GLOBALS['BACK_PATH'];
95 $this->doc->setModuleTemplate('templates/show_rechis.html');
96
97 // Start the page header:
98 $this->content.=$this->doc->header($GLOBALS['LANG']->getLL('title'));
99 $this->content.=$this->doc->spacer(5);
100 }
101
102 /**
103 * Generate module output
104 *
105 * @return void
106 */
107 function main() {
108
109 // Start history object
110 $historyObj = t3lib_div::makeInstance('recordHistory');
111
112 // Get content:
113 $this->content .= $historyObj->main();
114
115 // Setting up the buttons and markers for docheader
116 $docHeaderButtons = $this->getButtons();
117 $markers['CONTENT'] = $this->content;
118 $markers['CSH'] = $docHeaderButtons['csh'];
119
120 // Build the <body> for the module
121 $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
122 $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
123 }
124
125 /**
126 * Outputting the accumulated content to screen
127 *
128 * @return void
129 */
130 function printContent() {
131 $this->content.=$this->doc->spacer(8);
132 $this->content.= $this->doc->endPage();
133 $this->content = $this->doc->insertStylesAndJS($this->content);
134 echo $this->content;
135 }
136
137 /**
138 * Create the panel of buttons for submitting the form or otherwise perform operations.
139 *
140 * @return array all available buttons as an assoc. array
141 */
142 protected function getButtons() {
143 $buttons = array(
144 'csh' => '',
145 'back' => ''
146 );
147
148 // CSH
149 $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
150
151 // Start history object
152 $historyObj = t3lib_div::makeInstance('recordHistory');
153
154 if ($historyObj->returnUrl) {
155 $buttons['back']= '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>';
156 }
157
158 return $buttons;
159 }
160 }
161
162
163 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/show_rechis.php'])) {
164 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/show_rechis.php']);
165 }
166
167
168
169 // Make instance:
170 $SOBE = t3lib_div::makeInstance('SC_show_rechis');
171 $SOBE->init();
172 $SOBE->main();
173 $SOBE->printContent();
174
175 ?>