(bugfix) Fixed Image Generation bug. Call in t3lib_div now uses the IM wrapper to...
[Packages/TYPO3.CMS.git] / typo3 / mod / web / info / index.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2005 Kasper Skaarhoj (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 * Module: Web>Info
29 * Presents various page related information from extensions
30 *
31 * $Id$
32 * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
33 * XHTML compliant
34 *
35 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
36 */
37 /**
38 * [CLASS/FUNCTION INDEX of SCRIPT]
39 *
40 *
41 *
42 * 70: class SC_mod_web_info_index extends t3lib_SCbase
43 * 82: function main()
44 * 178: function printContent()
45 *
46 * TOTAL FUNCTIONS: 2
47 * (This index is automatically created/updated by the extension "extdeveval")
48 *
49 */
50
51 unset($MCONF);
52 require('conf.php');
53 require($BACK_PATH.'init.php');
54 require($BACK_PATH.'template.php');
55 $LANG->includeLLFile('EXT:lang/locallang_mod_web_info.xml');
56 require_once (PATH_t3lib.'class.t3lib_scbase.php');
57
58 $BE_USER->modAccess($MCONF,1);
59
60
61
62 /**
63 * Script Class for the Web > Info module
64 * This class creates the framework to which other extensions can connect their sub-modules
65 *
66 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
67 * @package TYPO3
68 * @subpackage core
69 */
70 class SC_mod_web_info_index extends t3lib_SCbase {
71
72 // Internal, dynamic:
73 var $be_user_Array;
74 var $CALC_PERMS;
75 var $pageinfo;
76
77 /**
78 * Document Template Object
79 *
80 * @var mediumDoc
81 */
82 var $doc;
83
84 /**
85 * Initialize module header etc and call extObjContent function
86 *
87 * @return void
88 */
89 function main() {
90 global $BE_USER,$LANG,$BACK_PATH;
91
92 // Access check...
93 // The page will show only if there is a valid page and if this page may be viewed by the user
94 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
95 $access = is_array($this->pageinfo) ? 1 : 0;
96
97 if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {
98 $this->CALC_PERMS = $BE_USER->calcPerms($this->pageinfo);
99 if ($BE_USER->user['admin'] && !$this->id) {
100 $this->pageinfo=array('title' => '[root-level]','uid'=>0,'pid'=>0);
101 }
102
103 $this->doc = t3lib_div::makeInstance('mediumDoc');
104 $this->doc->backPath = $BACK_PATH;
105 $this->doc->docType = 'xhtml_trans';
106 $this->doc->tableLayout = Array (
107 '0' => Array (
108 '0' => Array('<td valign="top"><b>','</b></td>'),
109 "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><b>','</b></td>')
110 ),
111 "defRow" => Array (
112 "0" => Array('<td valign="top">','</td>'),
113 "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top">','</td>')
114 )
115 );
116
117 // JavaScript
118 $this->doc->JScode = $this->doc->wrapScriptTags('
119 script_ended = 0;
120 function jumpToUrl(URL) { //
121 window.location.href = URL;
122 }
123 ');
124 $this->doc->postCode=$this->doc->wrapScriptTags('
125 script_ended = 1;
126 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
127 ');
128
129
130 // Setting up the context sensitive menu:
131 $CMparts=$this->doc->getContextMenuCode();
132 $this->doc->bodyTagAdditions = $CMparts[1];
133 $this->doc->JScode.=$CMparts[0];
134 $this->doc->postCode.= $CMparts[2];
135
136 $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
137 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.
138 '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50)).'</span>';
139
140 // Draw the header.
141 $this->doc->form = '<form action="index.php" method="post" name="webinfoForm">';
142 $this->content.=$this->doc->startPage($LANG->getLL('title'));
143 $this->content.=$this->doc->header($LANG->getLL('title'));
144 $this->content.=$this->doc->spacer(5);
145 $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
146 $this->content.=$this->doc->divider(5);
147
148
149 $vContent = $this->doc->getVersionSelector($this->id,1);
150 if ($vContent) {
151 $this->content.=$this->doc->section('',$vContent);
152 }
153
154 $this->extObjContent();
155
156
157
158
159 // Info Module CSH:
160 $this->content.= t3lib_BEfunc::cshItem('_MOD_web_info', '', $GLOBALS['BACK_PATH'], '<br/>|', FALSE, 'margin-top: 30px;');
161
162 // ShortCut
163 if ($BE_USER->mayMakeShortcut()) {
164 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));
165 }
166
167 $this->content.=$this->doc->spacer(10);
168 } else {
169 // If no access or if ID == zero
170 $this->doc = t3lib_div::makeInstance('mediumDoc');
171 $this->doc->backPath = $BACK_PATH;
172
173 $this->content.=$this->doc->startPage($LANG->getLL('title'));
174 $this->content.=$this->doc->header($LANG->getLL('title'));
175 $this->content.=$this->doc->spacer(5);
176 $this->content.=$this->doc->spacer(10);
177 }
178 }
179
180 /**
181 * Print module content (from $this->content)
182 *
183 * @return void
184 */
185 function printContent() {
186 $this->content.= $this->doc->endPage();
187 $this->content = $this->doc->insertStylesAndJS($this->content);
188 echo $this->content;
189 }
190 }
191
192 // Include extension?
193 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/info/index.php']) {
194 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/info/index.php']);
195 }
196
197
198
199
200
201
202
203
204
205
206
207
208 // Make instance:
209 $SOBE = t3lib_div::makeInstance('SC_mod_web_info_index');
210 $SOBE->init();
211
212 // Include files?
213 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
214 $SOBE->checkExtObj(); // Checking for first level external objects
215
216 // Repeat Include files! - if any files has been added by second-level extensions
217 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
218 $SOBE->checkSubExtObj(); // Checking second level external objects
219
220 $SOBE->main();
221 $SOBE->printContent();
222 ?>