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