Fixed a few XHTML bugS
[Packages/TYPO3.CMS.git] / typo3 / mod / web / info / index.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2004 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 * 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 <kasper@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 * 169: 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 include (PATH_typo3.'sysext/lang/locallang_mod_web_info.php');
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 <kasper@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 * Initialize module header etc and call extObjContent function
79 *
80 * @return void
81 */
82 function main() {
83 global $BE_USER,$LANG,$BACK_PATH;
84
85 // Access check...
86 // The page will show only if there is a valid page and if this page may be viewed by the user
87 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
88 $access = is_array($this->pageinfo) ? 1 : 0;
89
90 if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {
91 $this->CALC_PERMS = $BE_USER->calcPerms($this->pageinfo);
92 if ($BE_USER->user['admin'] && !$this->id) {
93 $this->pageinfo=array('title' => '[root-level]','uid'=>0,'pid'=>0);
94 }
95
96 $this->doc = t3lib_div::makeInstance('mediumDoc');
97 $this->doc->backPath = $BACK_PATH;
98 $this->doc->docType = 'xhtml_trans';
99 $this->doc->tableLayout = Array (
100 '0' => Array (
101 '0' => Array('<td valign="top"><b>','</b></td>'),
102 "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><b>','</b></td>')
103 ),
104 "defRow" => Array (
105 "0" => Array('<td valign="top">','</td>'),
106 "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top">','</td>')
107 )
108 );
109
110 // JavaScript
111 $this->doc->JScode = $this->doc->wrapScriptTags('
112 script_ended = 0;
113 function jumpToUrl(URL) { //
114 document.location = URL;
115 }
116 ');
117 $this->doc->postCode=$this->doc->wrapScriptTags('
118 script_ended = 1;
119 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
120 ');
121
122
123 // Setting up the context sensitive menu:
124 $CMparts=$this->doc->getContextMenuCode();
125 $this->doc->bodyTagAdditions = $CMparts[1];
126 $this->doc->JScode.=$CMparts[0];
127 $this->doc->postCode.= $CMparts[2];
128
129 $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
130 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.
131 '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50)).'</span>';
132
133 // Draw the header.
134 $this->doc->form='<form action="" method="post">';
135 $this->content.=$this->doc->startPage($LANG->getLL('title'));
136 $this->content.=$this->doc->header($LANG->getLL('title'));
137 $this->content.=$this->doc->spacer(5);
138 $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
139 $this->content.=$this->doc->divider(5);
140
141
142
143
144 $this->extObjContent();
145
146
147
148
149 // ShortCut
150 if ($BE_USER->mayMakeShortcut()) {
151 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));
152 }
153
154 $this->content.=$this->doc->spacer(10);
155 } else {
156 // If no access or if ID == zero
157 $this->doc = t3lib_div::makeInstance('mediumDoc');
158 $this->doc->backPath = $BACK_PATH;
159
160 $this->content.=$this->doc->startPage($LANG->getLL('title'));
161 $this->content.=$this->doc->header($LANG->getLL('title'));
162 $this->content.=$this->doc->spacer(5);
163 $this->content.=$this->doc->spacer(10);
164 }
165 }
166
167 /**
168 * Print module content (from $this->content)
169 *
170 * @return void
171 */
172 function printContent() {
173
174 $this->content.=$this->doc->endPage();
175 echo $this->content;
176 }
177 }
178
179 // Include extension?
180 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/info/index.php']) {
181 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/info/index.php']);
182 }
183
184
185
186
187
188
189
190
191
192
193
194
195 // Make instance:
196 $SOBE = t3lib_div::makeInstance('SC_mod_web_info_index');
197 $SOBE->init();
198
199 // Include files?
200 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
201 $SOBE->checkExtObj(); // Checking for first level external objects
202
203 // Repeat Include files! - if any files has been added by second-level extensions
204 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
205 $SOBE->checkSubExtObj(); // Checking second level external objects
206
207 $SOBE->main();
208 $SOBE->printContent();
209 ?>