Only changes to function indexes, comments and stripping of trailing whitespace in...
[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
100 // JavaScript
101 $this->doc->JScode = $this->doc->wrapScriptTags('
102 script_ended = 0;
103 function jumpToUrl(URL) { //
104 document.location = URL;
105 }
106 ');
107 $this->doc->postCode=$this->doc->wrapScriptTags('
108 script_ended = 1;
109 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
110 ');
111
112
113 // Setting up the context sensitive menu:
114 $CMparts=$this->doc->getContextMenuCode();
115 $this->doc->bodyTagAdditions = $CMparts[1];
116 $this->doc->JScode.=$CMparts[0];
117 $this->doc->postCode.= $CMparts[2];
118
119 $this->doc->form='<form action="index.php" method="post"><input type="hidden" name="id" value="'.$this->id.'">';
120
121 $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
122 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.
123 '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>';
124
125 // Draw the header.
126 $this->content.=$this->doc->startPage($LANG->getLL('title'));
127 $this->content.=$this->doc->header($LANG->getLL('title'));
128 $this->content.=$this->doc->spacer(5);
129 $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
130 $this->content.=$this->doc->divider(5);
131
132
133
134
135
136 $this->extObjContent();
137
138
139
140
141 // ShortCut
142 if ($BE_USER->mayMakeShortcut()) {
143 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id','function,wiz,import_function,export_function',$this->MCONF['name']));
144 }
145
146 $this->content.=$this->doc->spacer(10);
147 } else {
148 // If no access or if ID == zero
149
150 $this->doc = t3lib_div::makeInstance('mediumDoc');
151 $this->doc->backPath = $BACK_PATH;
152
153 $this->content.=$this->doc->startPage($LANG->getLL('title'));
154 $this->content.=$this->doc->header($LANG->getLL('title'));
155 $this->content.=$this->doc->section('','<br />'.$LANG->getLL('clickAPage_content'),0,1);
156 $this->content.=$this->doc->spacer(5);
157 $this->content.=$this->doc->spacer(10);
158 }
159 }
160
161 /**
162 * Print module content (from $this->content)
163 *
164 * @return void
165 */
166 function printContent() {
167
168 $this->content.=$this->doc->endPage();
169 echo $this->content;
170 }
171 }
172
173 // Include extension?
174 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']) {
175 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']);
176 }
177
178
179
180
181
182
183
184
185
186
187
188
189 // Make instance:
190 $SOBE = t3lib_div::makeInstance('SC_mod_web_func_index');
191 $SOBE->init();
192
193 // Include files?
194 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
195 $SOBE->checkExtObj(); // Checking for first level external objects
196
197 // Repeat Include files! - if any files has been added by second-level extensions
198 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
199 $SOBE->checkSubExtObj(); // Checking second level external objects
200
201 $SOBE->main();
202 $SOBE->printContent();
203 ?>