Fixed a few XHTML bugS
[Packages/TYPO3.CMS.git] / typo3 / mod / web / func / 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: Advanced functions
29 * Advanced Functions related to pages
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 * 71: class SC_mod_web_func_index extends t3lib_SCbase
43 * 84: function main()
44 * 164: function printContent()
45 *
46 * TOTAL FUNCTIONS: 2
47 * (This index is automatically created/updated by the extension "extdeveval")
48 *
49 */
50
51
52 unset($MCONF);
53 require ('conf.php');
54 require ($BACK_PATH.'init.php');
55 require ($BACK_PATH.'template.php');
56 include (PATH_typo3.'sysext/lang/locallang_mod_web_func.php');
57 require_once (PATH_t3lib.'class.t3lib_scbase.php');
58
59 $BE_USER->modAccess($MCONF,1);
60
61
62
63 /**
64 * Script Class for the Web > Functions module
65 * This class creates the framework to which other extensions can connect their sub-modules
66 *
67 * @author Kasper Skaarhoj <kasper@typo3.com>
68 * @package TYPO3
69 * @subpackage core
70 */
71 class SC_mod_web_func_index extends t3lib_SCbase {
72
73 // Internal, dynamic:
74 var $pageinfo;
75 var $fileProcessor;
76
77
78
79 /**
80 * Initialize module header etc and call extObjContent function
81 *
82 * @return void
83 */
84 function main() {
85 global $BE_USER,$LANG,$BACK_PATH;
86
87 // Access check...
88 // The page will show only if there is a valid page and if this page may be viewed by the user
89 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
90 $access = is_array($this->pageinfo) ? 1 : 0;
91
92
93 // **************************
94 // Main
95 // **************************
96 if ($this->id && $access) {
97 $this->doc = t3lib_div::makeInstance('mediumDoc');
98 $this->doc->backPath = $BACK_PATH;
99 $this->doc->docType = 'xhtml_trans';
100
101 // JavaScript
102 $this->doc->JScode = $this->doc->wrapScriptTags('
103 script_ended = 0;
104 function jumpToUrl(URL) { //
105 document.location = URL;
106 }
107 ');
108 $this->doc->postCode=$this->doc->wrapScriptTags('
109 script_ended = 1;
110 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
111 ');
112
113
114 // Setting up the context sensitive menu:
115 $CMparts=$this->doc->getContextMenuCode();
116 $this->doc->bodyTagAdditions = $CMparts[1];
117 $this->doc->JScode.=$CMparts[0];
118 $this->doc->postCode.= $CMparts[2];
119
120 $this->doc->form='<form action="index.php" method="post"><input type="hidden" name="id" value="'.$this->id.'" />';
121
122 $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
123 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.
124 '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50)).'</span>';
125
126 // Draw the header.
127 $this->content.=$this->doc->startPage($LANG->getLL('title'));
128 $this->content.=$this->doc->header($LANG->getLL('title'));
129 $this->content.=$this->doc->spacer(5);
130 $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
131 $this->content.=$this->doc->divider(5);
132
133
134
135
136
137 $this->extObjContent();
138
139
140
141
142 // ShortCut
143 if ($BE_USER->mayMakeShortcut()) {
144 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id','function,wiz,import_function,export_function',$this->MCONF['name']));
145 }
146
147 $this->content.=$this->doc->spacer(10);
148 } else {
149 // If no access or if ID == zero
150
151 $this->doc = t3lib_div::makeInstance('mediumDoc');
152 $this->doc->backPath = $BACK_PATH;
153
154 $this->content.=$this->doc->startPage($LANG->getLL('title'));
155 $this->content.=$this->doc->header($LANG->getLL('title'));
156 $this->content.=$this->doc->section('','<br />'.$LANG->getLL('clickAPage_content'),0,1);
157 $this->content.=$this->doc->spacer(5);
158 $this->content.=$this->doc->spacer(10);
159 }
160 }
161
162 /**
163 * Print module content (from $this->content)
164 *
165 * @return void
166 */
167 function printContent() {
168
169 $this->content.=$this->doc->endPage();
170 echo $this->content;
171 }
172 }
173
174 // Include extension?
175 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']) {
176 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']);
177 }
178
179
180
181
182
183
184
185
186
187
188
189
190 // Make instance:
191 $SOBE = t3lib_div::makeInstance('SC_mod_web_func_index');
192 $SOBE->init();
193
194 // Include files?
195 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
196 $SOBE->checkExtObj(); // Checking for first level external objects
197
198 // Repeat Include files! - if any files has been added by second-level extensions
199 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
200 $SOBE->checkSubExtObj(); // Checking second level external objects
201
202 $SOBE->main();
203 $SOBE->printContent();
204 ?>