Tons of changes made to the CORE. All scripts has more a less been modified. Primaril...
[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.='<?xml version="1.0" encoding="'.$theCharset.'"?>
325 <!DOCTYPE html
326 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
327 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
328 break;
329 default:
330 $GLOBALS['TSFE']->content.='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
331 break;
332 }
333
334 $GLOBALS['TSFE']->content.='
335 <html>
336 <head>
337 <!-- '.($customContent?$customContent.chr(10):'').'
338 This website is brought to you by TYPO3 - get.content.right
339 TYPO3 is a free open source Content Management Framework
340 created by Kasper Skaarhoej and licensed under GNU/GPL.
341 Information and contribution at http://www.typo3.com
342 -->
343 ';
344
345
346 if ($GLOBALS['TSFE']->pSetup['shortcutIcon']) {
347 $ss=$path.$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']);
348 $GLOBALS['TSFE']->content.='
349 <link rel="SHORTCUT ICON" href="'.$ss.'" />';
350 }
351
352
353
354
355
356
357 /** CSS STYLESHEET handling: */
358 if (is_array($GLOBALS['TSFE']->tmpl->setup['plugin.'])) {
359 $temp_styleLines=array();
360 reset($GLOBALS['TSFE']->tmpl->setup['plugin.']);
361 while(list($k2,$iCSScode)=each($GLOBALS['TSFE']->tmpl->setup['plugin.'])) {
362 if (is_array($iCSScode) && $iCSScode['_CSS_DEFAULT_STYLE']) {
363 $temp_styleLines[]='/* default styles for extension "'.substr($k2,0,-1).'" */'.chr(10).$iCSScode['_CSS_DEFAULT_STYLE'];
364 }
365 }
366 if (count($temp_styleLines)) {
367 $GLOBALS['TSFE']->content.='
368 <style type="text/css">
369 /*<![CDATA[*/
370 <!--
371 '.implode(chr(10),$temp_styleLines).'
372 -->
373 /*]]>*/
374 </style>';
375 }
376 }
377
378 if ($GLOBALS['TSFE']->pSetup['stylesheet']) {
379 $ss=$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['stylesheet']);
380 if ($ss) {
381 $GLOBALS['TSFE']->content.='
382 <link rel="stylesheet" href="'.htmlspecialchars($ss).'" />';
383 }
384 }
385 if (is_array($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
386 reset($GLOBALS['TSFE']->pSetup['includeCSS.']);
387 while(list($k2,$iCSSfile)=each($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
388 if (!is_array($iCSSfile)) {
389 $ss=$GLOBALS['TSFE']->tmpl->getFileName($iCSSfile);
390 if ($ss) {
391 $GLOBALS['TSFE']->content.='
392 <link rel="stylesheet" href="'.htmlspecialchars($ss).'"'.
393 ($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['title'] ? ' title="'.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['title']).'"' : '').
394 ($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['media'] ? ' media="'.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['media']).'"' : '').
395 ' />';
396 }
397 }
398 }
399 }
400
401 // Stylesheets
402 $style='';
403 $style.=trim($GLOBALS['TSFE']->pSetup['CSS_inlineStyle']).chr(10);
404
405 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE']) {
406 $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
407 $RTEclasses = $pageTSConfig['RTE.']['classes.'];
408 if (is_array($RTEclasses)) {
409 reset($RTEclasses);
410 while(list($RTEclassName,$RTEvalueArray)=each($RTEclasses)) {
411 if ($RTEvalueArray['value']) {
412 $style.='
413 .'.substr($RTEclassName,0,-1).' {'.$RTEvalueArray['value'].'}';
414 }
415 }
416 }
417
418 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs'] && is_array($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) {
419 $mSOa_tList = t3lib_div::trimExplode(',',strtoupper($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs']),1);
420 reset($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.']);
421 while(list($mSOa_key,$mSOa_value)=each($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) {
422 if (!is_array($mSOa_value) && (in_array('*',$mSOa_tList)||in_array($mSOa_key,$mSOa_tList))) {
423 $style.='
424 '.$mSOa_key.' {'.$mSOa_value.'}';
425 }
426 }
427 }
428 }
429
430 if ($GLOBALS['TSFE']->pSetup['noLinkUnderline']) {
431 $style.='
432 A:link {text-decoration: none}
433 A:visited {text-decoration: none}
434 A:active {text-decoration: none}';
435 }
436 if (trim($GLOBALS['TSFE']->pSetup['hover'])) {
437 $style.='
438 A:hover {color: '.trim($GLOBALS['TSFE']->pSetup['hover']).';}';
439 }
440 if (trim($GLOBALS['TSFE']->pSetup['hoverStyle'])) {
441 $style.='
442 A:hover {'.trim($GLOBALS['TSFE']->pSetup['hoverStyle']).'}';
443 }
444 if ($GLOBALS['TSFE']->pSetup['smallFormFields']) {
445 $style.='
446 SELECT { font-family: Verdana, Arial, Helvetica; font-size: 10px }
447 TEXTAREA { font-family: Verdana, Arial, Helvetica; font-size: 10px}
448 INPUT { font-family: Verdana, Arial, Helvetica; font-size: 10px }';
449 }
450
451 if (trim($style)) {
452 $GLOBALS['TSFE']->content.='
453 <style type="text/css">
454 /*<![CDATA[*/
455 <!--'.$style.'
456 -->
457 /*]]>*/
458 </style>';
459 }
460
461
462
463
464
465 // Headerdata
466 if (is_array($GLOBALS['TSFE']->pSetup['headerData.'])) {
467 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'],'headerData.');
468 }
469
470 // <title></title> :
471 $titleTagContent = $GLOBALS['TSFE']->tmpl->printTitle(
472 $GLOBALS['TSFE']->altPageTitle?$GLOBALS['TSFE']->altPageTitle:$GLOBALS['TSFE']->page['title'],
473 $GLOBALS['TSFE']->config['config']['noPageTitle'],
474 $GLOBALS['TSFE']->config['config']['pageTitleFirst']
475 );
476 if ($GLOBALS['TSFE']->config['config']['titleTagFunction']) {
477 $titleTagContent = $GLOBALS['TSFE']->cObj->callUserFunction($GLOBALS['TSFE']->config['config']['titleTagFunction'], array(), $titleTagContent);
478 }
479
480 $GLOBALS['TSFE']->content.='
481 <title>'.htmlspecialchars($titleTagContent).'</title>';
482 $GLOBALS['TSFE']->content.='
483 <meta http-equiv="Content-Type" content="text/html; charset='.$theCharset.'" />';
484 $GLOBALS['TSFE']->content.='
485 <meta name="generator" content="TYPO3 3.6 CMS" />';
486
487 $conf=$GLOBALS['TSFE']->pSetup['meta.'];
488 if (is_array($conf)) {
489 reset($conf);
490 while(list($theKey,$theValue)=each($conf)) {
491 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
492 if (strstr($theKey,'.')) {
493 $theKey = substr($theKey,0,-1);
494 }
495 $val = $GLOBALS['TSFE']->cObj->stdWrap($conf[$theKey],$conf[$theKey.'.']);
496 $key = $theKey;
497 if (trim($val)) {
498 $a='name';
499 if (strtolower($key)=='refresh') {$a='http-equiv';}
500 $GLOBALS['TSFE']->content.= '
501 <meta '.$a.'="'.$key.'" content="'.htmlspecialchars(trim($val)).'" />';
502 }
503 }
504 }
505 }
506
507 unset($GLOBALS['TSFE']->additionalHeaderData['JSCode']);
508 unset($GLOBALS['TSFE']->additionalHeaderData['JSImgCode']);
509
510 if (is_array($GLOBALS['TSFE']->config['INTincScript'])) {
511 // Storing the JSCode and JSImgCode vars...
512 $GLOBALS['TSFE']->additionalHeaderData['JSCode'] = $GLOBALS['TSFE']->JSCode;
513 $GLOBALS['TSFE']->additionalHeaderData['JSImgCode'] = $GLOBALS['TSFE']->JSImgCode;
514 $GLOBALS['TSFE']->config['INTincScript_ext']['divKey']= $GLOBALS['TSFE']->uniqueHash();
515 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalHeaderData'] = $GLOBALS['TSFE']->additionalHeaderData; // Storing the header-data array
516 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalJavaScript'] = $GLOBALS['TSFE']->additionalJavaScript; // Storing the JS-data array
517 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalCSS'] = $GLOBALS['TSFE']->additionalCSS; // Storing the Style-data array
518
519 $GLOBALS['TSFE']->additionalHeaderData=array('<!--HD_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'); // Clearing the array
520 $GLOBALS['TSFE']->divSection.='<!--TDS_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->';
521 } else {
522 $GLOBALS['TSFE']->INTincScript_loadJSCode();
523 }
524 $JSef = TSpagegen::JSeventFunctions();
525
526 $GLOBALS['TSFE']->content.='
527 <script type="text/javascript">
528 /*<![CDATA[*/
529 <!--
530 browserName = navigator.appName;
531 browserVer = parseInt(navigator.appVersion);
532 var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
533 if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror") {version = "n3";} else {version = "n2";}
534 // Blurring links:
535 function blurLink(theObject) { //
536 if (msie4) {theObject.blur();}
537 }
538 // -->
539 /*]]>*/
540 </script>
541 '.implode($GLOBALS['TSFE']->additionalHeaderData,chr(10)).'
542 '.$JSef[0].'
543 </head>';
544 if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
545 $fs = t3lib_div::makeInstance('tslib_frameset');
546 $GLOBALS['TSFE']->content.=$fs->make($GLOBALS['TSFE']->pSetup['frameSet.']);
547 $GLOBALS['TSFE']->content.= chr(10).'<noframes>'.chr(10);
548 }
549
550 // Bodytag:
551 $defBT = $GLOBALS['TSFE']->pSetup['bodyTagCObject'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($GLOBALS['TSFE']->pSetup['bodyTagCObject'],$GLOBALS['TSFE']->pSetup['bodyTagCObject.'],'bodyTagCObject') : '';
552 if (!$defBT) $defBT = '<body bgcolor="#FFFFFF">';
553 $bodyTag = $GLOBALS['TSFE']->pSetup['bodyTag'] ? $GLOBALS['TSFE']->pSetup['bodyTag'] : $defBT;
554 if ($bgImg=$GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'],$GLOBALS['TSFE']->pSetup['bgImg.'])) {
555 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' background="'.$GLOBALS["TSFE"]->absRefPrefix.$bgImg[3].'">';
556 }
557 if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins'])) {
558 $margins = $GLOBALS['TSFE']->pSetup['bodyTagMargins'];
559 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' leftmargin="'.$margins.'" topmargin="'.$margins.'" marginwidth="'.$margins.'" marginheight="'.$margins.'">';
560 }
561 if (trim($GLOBALS['TSFE']->pSetup['bodyTagAdd'])) {
562 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']).'>';
563 }
564 if (count($JSef[1])) { // Event functions:
565 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim(implode(' ',$JSef[1])).'>';
566 }
567
568
569 // Div-sections
570 $GLOBALS['TSFE']->content.= chr(10).$bodyTag;
571 if ($GLOBALS['TSFE']->divSection) {
572 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->divSection;
573 }
574
575 // Page content
576 $GLOBALS['TSFE']->content.=chr(10).$pageContent;
577
578 // Ending page
579 $GLOBALS['TSFE']->content.= chr(10).'</body>';
580 if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
581 $GLOBALS['TSFE']->content.= chr(10).'</noframes>';
582 }
583 $GLOBALS['TSFE']->content.=chr(10).'</html>';
584 }
585 }
586
587 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']) {
588 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']);
589 }
590
591
592
593 // ********************************************************
594 // Includes the search-class if $sword and $scols are set.
595 // ********************************************************
596 if (t3lib_div::GPvar('sword') && t3lib_div::GPvar('scols')) {
597 require_once(PATH_tslib.'class.tslib_search.php');
598 }
599
600 // ************
601 // LoadDBGroup
602 // ************
603 require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
604
605 /**
606 * Class for fetching record relations for the frontend.
607 *
608 * @author Kasper Skaarhoj <kasper@typo3.com>
609 * @package TYPO3
610 * @subpackage tslib
611 * @see tslib_cObj::RECORDS()
612 */
613 class FE_loadDBGroup extends t3lib_loadDBGroup {
614 var $fromTC = 0; // Means the not only uid and label-field is returned, but everything
615 }
616
617 // **********************************
618 // includes stuff for graphical work
619 // **********************************
620 require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');
621 require_once(PATH_tslib.'class.tslib_gifbuilder.php');
622
623 // *************************
624 // includes menu-management
625 // *************************
626 require_once(PATH_tslib.'class.tslib_menu.php');
627
628 // *************************
629 // Global content object...
630 // *************************
631 require_once(PATH_tslib.'class.tslib_content.php');
632
633 ?>