Updated copyright notices to show "2004"
[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 * 158: 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 />'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50);
122
123 // Draw the header.
124 $this->content.=$this->doc->startPage($LANG->getLL('title'));
125 $this->content.=$this->doc->header($LANG->getLL('title'));
126 $this->content.=$this->doc->spacer(5);
127 $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
128 $this->content.=$this->doc->divider(5);
129
130
131
132
133
134 $this->extObjContent();
135
136
137
138
139 // ShortCut
140 if ($BE_USER->mayMakeShortcut()) {
141 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id','function,wiz,import_function,export_function',$this->MCONF['name']));
142 }
143
144 $this->content.=$this->doc->spacer(10);
145 } else {
146 // If no access or if ID == zero
147
148 $this->doc = t3lib_div::makeInstance('mediumDoc');
149 $this->doc->backPath = $BACK_PATH;
150
151 $this->content.=$this->doc->startPage($LANG->getLL('title'));
152 $this->content.=$this->doc->header($LANG->getLL('title'));
153 $this->content.=$this->doc->section('','<br />'.$LANG->getLL('clickAPage_content'),0,1);
154 $this->content.=$this->doc->spacer(5);
155 $this->content.=$this->doc->spacer(10);
156 }
157 }
158
159 /**
160 * Print module content (from $this->content)
161 *
162 * @return void
163 */
164 function printContent() {
165
166 $this->content.=$this->doc->endPage();
167 echo $this->content;
168 }
169 }
170
171 // Include extension?
172 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']) {
173 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']);
174 }
175
176
177
178
179
180
181
182
183
184
185
186
187 // Make instance:
188 $SOBE = t3lib_div::makeInstance('SC_mod_web_func_index');
189 $SOBE->init();
190
191 // Include files?
192 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
193 $SOBE->checkExtObj(); // Checking for first level external objects
194
195 // Repeat Include files! - if any files has been added by second-level extensions
196 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
197 $SOBE->checkSubExtObj(); // Checking second level external objects
198
199 $SOBE->main();
200 $SOBE->printContent();
201 ?>