Initial revision
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_pagegen.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skårhøj (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 * Libraries for pagegen.php
29 * The script "pagegen.php" is included by "index_ts.php" when a page is not cached but needs to be rendered.
30 *
31 * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
32 * XHTML compliant
33 *
34 * @author Kasper Skårhøj <kasper@typo3.com>
35 * @package TYPO3
36 * @subpackage tslib
37 */
38 /**
39 * [CLASS/FUNCTION INDEX of SCRIPT]
40 *
41 *
42 *
43 * 87: class TSpagegen
44 * 94: function pagegenInit()
45 * 133: function UnCryptMailto(s)
46 * 144: function linkTo_UnCryptMailto(s)
47 * 217: function getIncFiles()
48 * 250: function JSeventFunctions()
49 * 284: function renderContent()
50 * 311: function renderContentWithHeader($pageContent)
51 * 534: function blurLink(theObject)
52 *
53 *
54 * 603: class FE_loadDBGroup extends t3lib_loadDBGroup
55 *
56 * TOTAL FUNCTIONS: 8
57 * (This index is automatically created/updated by the extension "extdeveval")
58 *
59 */
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79 /**
80 * Class for starting TypoScript page generation
81 *
82 * The class is not instantiated as an objects but called directly with the "::" operator.
83 * eg: TSpagegen::pagegenInit()
84 *
85 * @author Kasper Skårhøj <kasper@typo3.com>
86 */
87 class TSpagegen {
88
89 /**
90 * Setting some vars in TSFE, primarily based on TypoScript config settings.
91 *
92 * @return void
93 */
94 function pagegenInit() {
95 if ($GLOBALS['TSFE']->page['content_from_pid']>0) {
96 $temp_copy_TSFE = $GLOBALS['TSFE']; // make REAL copy of TSFE object - not reference!
97 $temp_copy_TSFE->id = $GLOBALS['TSFE']->page['content_from_pid']; // Set ->id to the content_from_pid value - we are going to evaluate this pid as was it a given id for a page-display!
98 $temp_copy_TSFE->getPageAndRootlineWithDomain($GLOBALS['TSFE']->config['config']['content_from_pid_allowOutsideDomain']?0:$GLOBALS['TSFE']->domainStartPage);
99 $GLOBALS['TSFE']->contentPid = intval($temp_copy_TSFE->id);
100 unset($temp_copy_TSFE);
101 }
102 if ($GLOBALS['TSFE']->config['config']['MP_defaults']) {
103 $temp_parts = t3lib_div::trimExplode('|',$GLOBALS['TSFE']->config['config']['MP_defaults'],1);
104 reset($temp_parts);
105 while(list(,$temp_p)=each($temp_parts)) {
106 list($temp_idP,$temp_MPp) = explode(':',$temp_p,2);
107 $temp_ids=t3lib_div::intExplode(',',$temp_idP);
108 reset($temp_ids);
109 while(list(,$temp_id)=each($temp_ids)) {
110 $GLOBALS['TSFE']->MP_defaults[$temp_id]=$temp_MPp;
111 }
112 }
113 }
114 if ($GLOBALS['TSFE']->config['config']['simulateStaticDocuments_pEnc_onlyP']) {
115 $temp_parts = t3lib_div::trimExplode(',',$GLOBALS['TSFE']->config['config']['simulateStaticDocuments_pEnc_onlyP'],1);
116 foreach ($temp_parts as $temp_p) {
117 $GLOBALS['TSFE']->pEncAllowedParamNames[$temp_p]=1;
118 }
119 }
120
121
122 // Global vars...
123 $GLOBALS['TSFE']->indexedDocTitle = $GLOBALS['TSFE']->page['title'];
124 $GLOBALS['TSFE']->debug = ''.$GLOBALS['TSFE']->config['config']['debug'];
125
126 // Internal and External target defaults
127 $GLOBALS['TSFE']->intTarget = ''.$GLOBALS['TSFE']->config['config']['intTarget'];
128 $GLOBALS['TSFE']->extTarget = ''.$GLOBALS['TSFE']->config['config']['extTarget'];
129 $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_div::intInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'],-5,5,0);
130 if ($GLOBALS['TSFE']->spamProtectEmailAddresses) {
131 $GLOBALS['TSFE']->additionalJavaScript['UnCryptMailto()']='
132 // JS function for uncrypting spam-protected emails:
133 function UnCryptMailto(s) {
134 var n=0;
135 var r="";
136 for(var i=0; i < s.length; i++) {
137 n=s.charCodeAt(i);
138 if (n>=8364) {n = 128;}
139 r += String.fromCharCode(n-('.$GLOBALS['TSFE']->spamProtectEmailAddresses.'));
140 }
141 return r;
142 }
143 // JS function for uncrypting spam-protected emails:
144 function linkTo_UnCryptMailto(s) {
145 location.href=UnCryptMailto(s);
146 }
147 ';
148 }
149
150
151 $GLOBALS['TSFE']->absRefPrefix = trim(''.$GLOBALS['TSFE']->config['config']['absRefPrefix']);
152 if ((!strcmp($GLOBALS['TSFE']->config['config']['simulateStaticDocuments'],'PATH_INFO') || $GLOBALS['TSFE']->absRefPrefix_force)
153 && !$GLOBALS['TSFE']->absRefPrefix) {
154 $GLOBALS['TSFE']->absRefPrefix=t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')).'/';
155 } // Force absRefPrefix to this value is PATH_INFO is used.
156
157 if ($GLOBALS['TSFE']->type && $GLOBALS['TSFE']->config['config']['frameReloadIfNotInFrameset']) {
158 $tdlLD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page,'_top',$GLOBALS['TSFE']->no_cache,'');
159 $GLOBALS['TSFE']->JSCode = 'if(!parent.'.trim($GLOBALS['TSFE']->sPre).' && !parent.view_frame) top.document.location="'.$tdlLD['totalURL'].'"';
160 }
161 $GLOBALS['TSFE']->compensateFieldWidth = ''.$GLOBALS['TSFE']->config['config']['compensateFieldWidth'];
162 $GLOBALS['TSFE']->lockFilePath = ''.$GLOBALS['TSFE']->config['config']['lockFilePath'];
163 $GLOBALS['TSFE']->lockFilePath = $GLOBALS['TSFE']->lockFilePath ? $GLOBALS['TSFE']->lockFilePath : 'fileadmin/';
164 $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'] = isset($GLOBALS['TSFE']->config['config']['noScaleUp']) ? ''.$GLOBALS['TSFE']->config['config']['noScaleUp'] : $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'];
165 $GLOBALS['TSFE']->TYPO3_CONF_VARS['GFX']['im_noScaleUp'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'];
166
167 $GLOBALS['TSFE']->ATagParams = trim($GLOBALS['TSFE']->config['config']['ATagParams']) ? ' '.trim($GLOBALS['TSFE']->config['config']['ATagParams']) : '';
168 if ($GLOBALS['TSFE']->config['config']['setJS_mouseOver']) $GLOBALS['TSFE']->setJS('mouseOver');
169 if ($GLOBALS['TSFE']->config['config']['setJS_openPic']) $GLOBALS['TSFE']->setJS('openPic');
170
171 $GLOBALS['TSFE']->sWordRegEx='';
172 $GLOBALS['TSFE']->sWordList = t3lib_div::GPvar('sword_list');
173 if (is_array($GLOBALS['TSFE']->sWordList)) {
174 $standAlone = trim(''.$GLOBALS['TSFE']->config['config']['sword_standAlone']);
175 $noMixedCase = trim(''.$GLOBALS['TSFE']->config['config']['sword_noMixedCase']);
176
177 $space = ($standAlone) ? '[[:space:]]' : '';
178 reset($GLOBALS['TSFE']->sWordList);
179 while (list($key,$val) = each($GLOBALS['TSFE']->sWordList)) {
180 if (trim($val)) {
181 if (!$noMixedCase) {
182 $GLOBALS['TSFE']->sWordRegEx.= $space.sql_regcase(quotemeta($val)).$space.'|';
183 } else {
184 $GLOBALS['TSFE']->sWordRegEx.= $space.quotemeta($val).$space.'|';
185 }
186 }
187 }
188 $GLOBALS['TSFE']->sWordRegEx = ereg_replace('\|$','',$GLOBALS['TSFE']->sWordRegEx);
189 }
190
191 // linkVars
192 $GLOBALS['TSFE']->linkVars = ''.$GLOBALS['TSFE']->config['config']['linkVars'];
193 if ($GLOBALS['TSFE']->linkVars) {
194 $linkVarArr = explode(',',$GLOBALS['TSFE']->linkVars);
195 reset($linkVarArr);
196 $GLOBALS['TSFE']->linkVars='';
197 while(list(,$val)=each($linkVarArr)) {
198 $val=trim($val);
199 if ($val && isset($GLOBALS['HTTP_GET_VARS'][$val])) {
200 if (!is_array($GLOBALS['HTTP_GET_VARS'][$val])) {
201 $GLOBALS['TSFE']->linkVars.='&'.$val.'='.rawurlencode($GLOBALS['HTTP_GET_VARS'][$val]);
202 } else {
203 $GLOBALS['TSFE']->linkVars.=t3lib_div::implodeArrayForUrl($val,$GLOBALS['HTTP_GET_VARS'][$val]);
204 }
205 }
206 }
207 } else {
208 $GLOBALS['TSFE']->linkVars='';
209 }
210 }
211
212 /**
213 * Returns an array with files to include. These files are the ones set up in TypoScript config.
214 *
215 * @return array Files to include. Paths are relative to PATH_site.
216 */
217 function getIncFiles() {
218 $incFilesArray = array();
219 // Get files from config.includeLibrary
220 $includeLibrary = trim(''.$GLOBALS['TSFE']->config['config']['includeLibrary']);
221 if ($includeLibrary) {
222 $incFile=$GLOBALS['TSFE']->tmpl->getFileName($includeLibrary);
223 if ($incFile) {
224 $incFilesArray[] = $incFile;
225 }
226 }
227
228 if (is_array($GLOBALS['TSFE']->pSetup['includeLibs.'])) {$incLibs=$GLOBALS['TSFE']->pSetup['includeLibs.'];} else {$incLibs=array();}
229 if (is_array($GLOBALS['TSFE']->tmpl->setup['includeLibs.'])) {$incLibs+=$GLOBALS['TSFE']->tmpl->setup['includeLibs.'];} // toplevel 'includeLibs' is added to the PAGE.includeLibs. In that way, PAGE-libs get first priority, because if the key already exist, it's not altered. (Due to investigation by me)
230 if (count($incLibs)) {
231 reset($incLibs);
232 while(list(,$theLib)=each($incLibs)) {
233 if (!is_array($theLib) && $incFile=$GLOBALS['TSFE']->tmpl->getFileName($theLib)) {
234 $incFilesArray[] = $incFile;
235 }
236 }
237 }
238 // Include HTML mail library?
239 if ($GLOBALS['TSFE']->config['config']['incT3Lib_htmlmail']) {
240 $incFilesArray[] = 't3lib/class.t3lib_htmlmail.php';
241 }
242 return $incFilesArray;
243 }
244
245 /**
246 * Processing JavaScript handlers
247 *
248 * @return array Array with a) a JavaScript section with event handlers and variables set and b) an array with attributes for the body tag.
249 */
250 function JSeventFunctions() {
251 $functions=array();
252 $setEvents=array();
253 $setBody=array();
254
255 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'])) {
256 $functions[]=' function T3_onmousemoveWrapper(e) { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']).' }';
257 $setEvents[]=' document.onmousemove=T3_onmousemoveWrapper;';
258 }
259 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'])) {
260 $functions[]=' function T3_onmouseupWrapper(e) { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']).' }';
261 $setEvents[]=' document.onmouseup=T3_onmouseupWrapper;';
262 }
263 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onload']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onload'])) {
264 $functions[]=' function T3_onloadWrapper() { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onload']).' }';
265 $setEvents[]=' document.onload=T3_onloadWrapper;';
266 $setBody[]='onload="T3_onloadWrapper();"';
267 }
268
269 return Array(count($functions)?'
270 <script type="text/javascript">
271 /*<![CDATA[*/
272 '.implode(chr(10),$functions).'
273 '.implode(chr(10),$setEvents).'
274 /*]]>*/
275 </script>
276 ':'',$setBody);
277 }
278
279 /**
280 * Rendering the page content
281 *
282 * @return void
283 */
284 function renderContent() {
285 // PAGE CONTENT
286 $GLOBALS['TT']->incStackPointer();
287 $GLOBALS['TT']->push($GLOBALS['TSFE']->sPre, 'PAGE');
288 $pageContent = $GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup);
289
290 if ($GLOBALS['TSFE']->pSetup['wrap']) {$pageContent = $GLOBALS['TSFE']->cObj->wrap($pageContent, $GLOBALS['TSFE']->pSetup['wrap']);}
291 if ($GLOBALS['TSFE']->pSetup['stdWrap.']) {$pageContent = $GLOBALS['TSFE']->cObj->stdWrap($pageContent, $GLOBALS['TSFE']->pSetup['stdWrap.']);}
292
293 // PAGE HEADER (after content - maybe JS is inserted!
294
295 // if 'disableAllHeaderCode' is set, all the header-code is discarded!
296 if ($GLOBALS['TSFE']->config['config']['disableAllHeaderCode']) {
297 $GLOBALS['TSFE']->content=$pageContent;
298 } else {
299 TSpagegen::renderContentWithHeader($pageContent);
300 }
301 $GLOBALS['TT']->pull($GLOBALS['TT']->LR?$GLOBALS['TSFE']->content:'');
302 $GLOBALS['TT']->decStackPointer();
303 }
304
305 /**
306 * Rendering normal HTML-page with header by wrapping the generated content ($pageContent) in body-tags and setting the header accordingly.
307 *
308 * @param string The page content which TypoScript objects has generated
309 * @return void
310 */
311 function renderContentWithHeader($pageContent) {
312 $customContent = $GLOBALS['TSFE']->config['config']['headerComment'];
313 if (trim($customContent)) {
314 $customContent = chr(10).$customContent;
315 } else $customContent='';
316
317 // Setting charset:
318 $theCharset = ($GLOBALS['TSFE']->config['config']['metaCharset'] ? $GLOBALS['TSFE']->config['config']['metaCharset'] : 'iso-8859-1');
319
320 // Reset the content variables:
321 $GLOBALS['TSFE']->content='';
322
323 // Setting document type:
324 switch((string)$GLOBALS['TSFE']->config['config']['doctype']) {
325 case 'xhtml_trans':
326 $GLOBALS['TSFE']->content.='<?xml version="1.0" encoding="'.$theCharset.'"?>
327 <!DOCTYPE html
328 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
329 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
330 break;
331 default:
332 $GLOBALS['TSFE']->content.='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
333 break;
334 }
335
336 $GLOBALS['TSFE']->content.='
337 <html>
338 <head>
339 <!-- '.($customContent?$customContent.chr(10):'').'
340 This website is brought to you by TYPO3 - get.content.right
341 TYPO3 is a free open source Content Management Framework
342 created by Kasper Skaarhoej and licensed under GNU/GPL.
343 Information and contribution at http://www.typo3.com
344 -->
345 ';
346
347
348 if ($GLOBALS['TSFE']->pSetup['shortcutIcon']) {
349 $ss=$path.$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']);
350 $GLOBALS['TSFE']->content.='
351 <link rel="SHORTCUT ICON" href="'.$ss.'" />';
352 }
353
354
355
356
357
358
359 /** CSS STYLESHEET handling: */
360 if (is_array($GLOBALS['TSFE']->tmpl->setup['plugin.'])) {
361 $temp_styleLines=array();
362 reset($GLOBALS['TSFE']->tmpl->setup['plugin.']);
363 while(list($k2,$iCSScode)=each($GLOBALS['TSFE']->tmpl->setup['plugin.'])) {
364 if (is_array($iCSScode) && $iCSScode['_CSS_DEFAULT_STYLE']) {
365 $temp_styleLines[]='/* default styles for extension "'.substr($k2,0,-1).'" */'.chr(10).$iCSScode['_CSS_DEFAULT_STYLE'];
366 }
367 }
368 if (count($temp_styleLines)) {
369 $GLOBALS['TSFE']->content.='
370 <style type="text/css">
371 /*<![CDATA[*/
372 <!--
373 '.implode(chr(10),$temp_styleLines).'
374 -->
375 /*]]>*/
376 </style>';
377 }
378 }
379
380 if ($GLOBALS['TSFE']->pSetup['stylesheet']) {
381 $ss=$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['stylesheet']);
382 if ($ss) {
383 $GLOBALS['TSFE']->content.='
384 <link rel="stylesheet" href="'.$ss.'" />';
385 }
386 }
387 if (is_array($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
388 reset($GLOBALS['TSFE']->pSetup['includeCSS.']);
389 while(list($k2,$iCSSfile)=each($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
390 if (!is_array($iCSSfile)) {
391 $ss=$GLOBALS['TSFE']->tmpl->getFileName($iCSSfile);
392 if ($ss) {
393 $GLOBALS['TSFE']->content.='
394 <link rel="stylesheet" href="'.$ss.'" />';
395 }
396 }
397 }
398 }
399
400 // Stylesheets
401 $style='';
402 $style.=trim($GLOBALS['TSFE']->pSetup['CSS_inlineStyle']).chr(10);
403
404 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE']) {
405 $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
406 $RTEclasses = $pageTSConfig['RTE.']['classes.'];
407 if (is_array($RTEclasses)) {
408 reset($RTEclasses);
409 while(list($RTEclassName,$RTEvalueArray)=each($RTEclasses)) {
410 if ($RTEvalueArray['value']) {
411 $style.='
412 .'.substr($RTEclassName,0,-1).' {'.$RTEvalueArray['value'].'}';
413 }
414 }
415 }
416
417 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs'] && is_array($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) {
418 $mSOa_tList = t3lib_div::trimExplode(',',strtoupper($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs']),1);
419 reset($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.']);
420 while(list($mSOa_key,$mSOa_value)=each($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) {
421 if (!is_array($mSOa_value) && (in_array('*',$mSOa_tList)||in_array($mSOa_key,$mSOa_tList))) {
422 $style.='
423 '.$mSOa_key.' {'.$mSOa_value.'}';
424 }
425 }
426 }
427 }
428
429 if ($GLOBALS['TSFE']->pSetup['noLinkUnderline']) {
430 $style.='
431 A:link {text-decoration: none}
432 A:visited {text-decoration: none}
433 A:active {text-decoration: none}';
434 }
435 if (trim($GLOBALS['TSFE']->pSetup['hover'])) {
436 $style.='
437 A:hover {color: '.trim($GLOBALS['TSFE']->pSetup['hover']).';}';
438 }
439 if (trim($GLOBALS['TSFE']->pSetup['hoverStyle'])) {
440 $style.='
441 A:hover {'.trim($GLOBALS['TSFE']->pSetup['hoverStyle']).'}';
442 }
443 if ($GLOBALS['TSFE']->pSetup['smallFormFields']) {
444 $style.='
445 SELECT { font-family: Verdana, Arial, Helvetica; font-size: 10px }
446 TEXTAREA { font-family: Verdana, Arial, Helvetica; font-size: 10px}
447 INPUT { font-family: Verdana, Arial, Helvetica; font-size: 10px }';
448 }
449
450 if (trim($style)) {
451 $GLOBALS['TSFE']->content.='
452 <style type="text/css">
453 /*<![CDATA[*/
454 <!--'.$style.'
455 -->
456 /*]]>*/
457 </style>';
458 }
459
460
461
462
463
464 // Headerdata
465 if (is_array($GLOBALS['TSFE']->pSetup['headerData.'])) {
466 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'],'headerData.');
467 }
468
469 // <title></title> :
470 $titleTagContent = $GLOBALS['TSFE']->tmpl->printTitle(
471 $GLOBALS['TSFE']->altPageTitle?$GLOBALS['TSFE']->altPageTitle:$GLOBALS['TSFE']->page['title'],
472 $GLOBALS['TSFE']->config['config']['noPageTitle'],
473 $GLOBALS['TSFE']->config['config']['pageTitleFirst']
474 );
475 if ($GLOBALS['TSFE']->config['config']['titleTagFunction']) {
476 $titleTagContent = $GLOBALS['TSFE']->cObj->callUserFunction($GLOBALS['TSFE']->config['config']['titleTagFunction'], array(), $titleTagContent);
477 }
478
479 $GLOBALS['TSFE']->content.='
480 <title>'.htmlspecialchars($titleTagContent).'</title>';
481 $GLOBALS['TSFE']->content.='
482 <meta http-equiv="Content-Type" content="text/html; charset='.$theCharset.'" />';
483 $GLOBALS['TSFE']->content.='
484 <meta name="generator" content="TYPO3 3.6 CMS" />';
485
486 $conf=$GLOBALS['TSFE']->pSetup['meta.'];
487 if (is_array($conf)) {
488 reset($conf);
489 while(list($theKey,$theValue)=each($conf)) {
490 if (!strstr($theKey,'.') || !isset($conf[substr($theKey,0,-1)])) { // Only if 1) the property is set but not the value itself, 2) the value and/or any property
491 if (strstr($theKey,'.')) {
492 $theKey = substr($theKey,0,-1);
493 }
494 $val = $GLOBALS['TSFE']->cObj->stdWrap($conf[$theKey],$conf[$theKey.'.']);
495 $key = $theKey;
496 if (trim($val)) {
497 $a='name';
498 if (strtolower($key)=='refresh') {$a='http-equiv';}
499 $GLOBALS['TSFE']->content.= '
500 <meta '.$a.'="'.$key.'" content="'.htmlspecialchars(trim($val)).'" />';
501 }
502 }
503 }
504 }
505
506 unset($GLOBALS['TSFE']->additionalHeaderData['JSCode']);
507 unset($GLOBALS['TSFE']->additionalHeaderData['JSImgCode']);
508
509 if (is_array($GLOBALS['TSFE']->config['INTincScript'])) {
510 // Storing the JSCode and JSImgCode vars...
511 $GLOBALS['TSFE']->additionalHeaderData['JSCode'] = $GLOBALS['TSFE']->JSCode;
512 $GLOBALS['TSFE']->additionalHeaderData['JSImgCode'] = $GLOBALS['TSFE']->JSImgCode;
513 $GLOBALS['TSFE']->config['INTincScript_ext']['divKey']= $GLOBALS['TSFE']->uniqueHash();
514 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalHeaderData'] = $GLOBALS['TSFE']->additionalHeaderData; // Storing the header-data array
515 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalJavaScript'] = $GLOBALS['TSFE']->additionalJavaScript; // Storing the JS-data array
516 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalCSS'] = $GLOBALS['TSFE']->additionalCSS; // Storing the Style-data array
517
518 $GLOBALS['TSFE']->additionalHeaderData=array('<!--HD_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'); // Clearing the array
519 $GLOBALS['TSFE']->divSection.='<!--TDS_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->';
520 } else {
521 $GLOBALS['TSFE']->INTincScript_loadJSCode();
522 }
523 $JSef = TSpagegen::JSeventFunctions();
524
525 $GLOBALS['TSFE']->content.='
526 <script type="text/javascript">
527 /*<![CDATA[*/
528 <!--
529 browserName = navigator.appName;
530 browserVer = parseInt(navigator.appVersion);
531 var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
532 if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror") {version = "n3";} else {version = "n2";}
533 // Blurring links:
534 function blurLink(theObject) {
535 if (msie4) {theObject.blur();}
536 }
537 // -->
538 /*]]>*/
539 </script>
540 '.implode($GLOBALS['TSFE']->additionalHeaderData,chr(10)).'
541 '.$JSef[0].'
542 </head>';
543 if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
544 $fs = t3lib_div::makeInstance('tslib_frameset');
545 $GLOBALS['TSFE']->content.=$fs->make($GLOBALS['TSFE']->pSetup['frameSet.']);
546 $GLOBALS['TSFE']->content.= chr(10).'<noframes>'.chr(10);
547 }
548
549 // Bodytag:
550 $defBT = $GLOBALS['TSFE']->pSetup['bodyTagCObject'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($GLOBALS['TSFE']->pSetup['bodyTagCObject'],$GLOBALS['TSFE']->pSetup['bodyTagCObject.'],'bodyTagCObject') : '';
551 if (!$defBT) $defBT = '<body bgcolor="#FFFFFF">';
552 $bodyTag = $GLOBALS['TSFE']->pSetup['bodyTag'] ? $GLOBALS['TSFE']->pSetup['bodyTag'] : $defBT;
553 if ($bgImg=$GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'],$GLOBALS['TSFE']->pSetup['bgImg.'])) {
554 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' background="'.$GLOBALS["TSFE"]->absRefPrefix.$bgImg[3].'">';
555 }
556 if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins'])) {
557 $margins = $GLOBALS['TSFE']->pSetup['bodyTagMargins'];
558 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' leftmargin="'.$margins.'" topmargin="'.$margins.'" marginwidth="'.$margins.'" marginheight="'.$margins.'">';
559 }
560 if (trim($GLOBALS['TSFE']->pSetup['bodyTagAdd'])) {
561 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']).'>';
562 }
563 if (count($JSef[1])) { // Event functions:
564 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim(implode(' ',$JSef[1])).'>';
565 }
566
567
568 // Div-sections
569 $GLOBALS['TSFE']->content.= chr(10).$bodyTag;
570 if ($GLOBALS['TSFE']->divSection) {
571 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->divSection;
572 }
573
574 // Page content
575 $GLOBALS['TSFE']->content.=chr(10).$pageContent;
576
577 // Ending page
578 $GLOBALS['TSFE']->content.= chr(10).'</body>';
579 if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
580 $GLOBALS['TSFE']->content.= chr(10).'</noframes>';
581 }
582 $GLOBALS['TSFE']->content.=chr(10).'</html>';
583 }
584 }
585
586 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']) {
587 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']);
588 }
589
590
591
592 // ********************************************************
593 // Includes the search-class if $sword and $scols are set.
594 // ********************************************************
595 if (t3lib_div::GPvar('sword') && t3lib_div::GPvar('scols')) {
596 require_once(PATH_tslib.'class.tslib_search.php');
597 }
598
599 // ************
600 // LoadDBGroup
601 // ************
602 require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
603 class FE_loadDBGroup extends t3lib_loadDBGroup {
604 var $fromTC = 0; // Means the not only uid and label-field is returned, but everything
605 }
606
607 // **********************************
608 // includes stuff for graphical work
609 // **********************************
610 require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');
611 require_once(PATH_tslib.'class.tslib_gifbuilder.php');
612
613 // *************************
614 // includes menu-management
615 // *************************
616 require_once(PATH_tslib.'class.tslib_menu.php');
617
618 // *************************
619 // Global content object...
620 // *************************
621 require_once(PATH_tslib.'class.tslib_content.php');
622
623 ?>