* Added "config.doctype = none" support - omits any doctype in the frontend.
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_pagegen.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 * 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 * 216: function getIncFiles()
45 * 249: function JSeventFunctions()
46 * 283: function renderContent()
47 * 310: function renderContentWithHeader($pageContent)
48 *
49 *
50 * 672: 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::_GP('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 $GLOBALS['TSFE']->linkVars='';
194 reset($linkVarArr);
195 while(list(,$val)=each($linkVarArr)) {
196 $val=trim($val);
197 $GET = t3lib_div::_GET();
198 if ($val && isset($GET[$val])) {
199 if (!is_array($GET[$val])) {
200 $GLOBALS['TSFE']->linkVars.='&'.$val.'='.rawurlencode($GET[$val]);
201 } else {
202 $GLOBALS['TSFE']->linkVars.=t3lib_div::implodeArrayForUrl($val,$GET[$val]);
203 }
204 }
205 }
206 } else {
207 $GLOBALS['TSFE']->linkVars='';
208 }
209 }
210
211 /**
212 * Returns an array with files to include. These files are the ones set up in TypoScript config.
213 *
214 * @return array Files to include. Paths are relative to PATH_site.
215 */
216 function getIncFiles() {
217 $incFilesArray = array();
218 // Get files from config.includeLibrary
219 $includeLibrary = trim(''.$GLOBALS['TSFE']->config['config']['includeLibrary']);
220 if ($includeLibrary) {
221 $incFile=$GLOBALS['TSFE']->tmpl->getFileName($includeLibrary);
222 if ($incFile) {
223 $incFilesArray[] = $incFile;
224 }
225 }
226
227 if (is_array($GLOBALS['TSFE']->pSetup['includeLibs.'])) {$incLibs=$GLOBALS['TSFE']->pSetup['includeLibs.'];} else {$incLibs=array();}
228 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)
229 if (count($incLibs)) {
230 reset($incLibs);
231 while(list(,$theLib)=each($incLibs)) {
232 if (!is_array($theLib) && $incFile=$GLOBALS['TSFE']->tmpl->getFileName($theLib)) {
233 $incFilesArray[] = $incFile;
234 }
235 }
236 }
237 // Include HTML mail library?
238 if ($GLOBALS['TSFE']->config['config']['incT3Lib_htmlmail']) {
239 $incFilesArray[] = 't3lib/class.t3lib_htmlmail.php';
240 }
241 return $incFilesArray;
242 }
243
244 /**
245 * Processing JavaScript handlers
246 *
247 * @return array Array with a) a JavaScript section with event handlers and variables set and b) an array with attributes for the body tag.
248 */
249 function JSeventFunctions() {
250 $functions=array();
251 $setEvents=array();
252 $setBody=array();
253
254 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'])) {
255 $functions[]=' function T3_onmousemoveWrapper(e) { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']).' }';
256 $setEvents[]=' document.onmousemove=T3_onmousemoveWrapper;';
257 }
258 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'])) {
259 $functions[]=' function T3_onmouseupWrapper(e) { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']).' }';
260 $setEvents[]=' document.onmouseup=T3_onmouseupWrapper;';
261 }
262 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onload']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onload'])) {
263 $functions[]=' function T3_onloadWrapper() { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onload']).' }';
264 $setEvents[]=' document.onload=T3_onloadWrapper;';
265 $setBody[]='onload="T3_onloadWrapper();"';
266 }
267
268 return Array(count($functions)?'
269 <script type="text/javascript">
270 /*<![CDATA[*/
271 '.implode(chr(10),$functions).'
272 '.implode(chr(10),$setEvents).'
273 /*]]>*/
274 </script>
275 ':'',$setBody);
276 }
277
278 /**
279 * Rendering the page content
280 *
281 * @return void
282 */
283 function renderContent() {
284 // PAGE CONTENT
285 $GLOBALS['TT']->incStackPointer();
286 $GLOBALS['TT']->push($GLOBALS['TSFE']->sPre, 'PAGE');
287 $pageContent = $GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup);
288
289 if ($GLOBALS['TSFE']->pSetup['wrap']) {$pageContent = $GLOBALS['TSFE']->cObj->wrap($pageContent, $GLOBALS['TSFE']->pSetup['wrap']);}
290 if ($GLOBALS['TSFE']->pSetup['stdWrap.']) {$pageContent = $GLOBALS['TSFE']->cObj->stdWrap($pageContent, $GLOBALS['TSFE']->pSetup['stdWrap.']);}
291
292 // PAGE HEADER (after content - maybe JS is inserted!
293
294 // if 'disableAllHeaderCode' is set, all the header-code is discarded!
295 if ($GLOBALS['TSFE']->config['config']['disableAllHeaderCode']) {
296 $GLOBALS['TSFE']->content=$pageContent;
297 } else {
298 TSpagegen::renderContentWithHeader($pageContent);
299 }
300 $GLOBALS['TT']->pull($GLOBALS['TT']->LR?$GLOBALS['TSFE']->content:'');
301 $GLOBALS['TT']->decStackPointer();
302 }
303
304 /**
305 * Rendering normal HTML-page with header by wrapping the generated content ($pageContent) in body-tags and setting the header accordingly.
306 *
307 * @param string The page content which TypoScript objects has generated
308 * @return void
309 */
310 function renderContentWithHeader($pageContent) {
311 $customContent = $GLOBALS['TSFE']->config['config']['headerComment'];
312 if (trim($customContent)) {
313 $customContent = chr(10).$customContent;
314 } else $customContent='';
315
316 // Setting charset:
317 $theCharset = ($GLOBALS['TSFE']->config['config']['metaCharset'] ? $GLOBALS['TSFE']->config['config']['metaCharset'] : $GLOBALS['TSFE']->defaultCharSet);
318
319 // Reset the content variables:
320 $GLOBALS['TSFE']->content='';
321
322 // Setting document type:
323 $docTypeParts=array();
324 if ($GLOBALS['TSFE']->config['config']['doctype']) {
325 switch((string)$GLOBALS['TSFE']->config['config']['doctype']) {
326 case 'xhtml_trans':
327 $docTypeParts[]='<?xml version="1.0" encoding="'.$theCharset.'"?>';
328 $docTypeParts[]='<!DOCTYPE html
329 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
330 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
331 break;
332 case 'xhtml_strict':
333 $docTypeParts[]='<?xml version="1.0" encoding="'.$theCharset.'"?>';
334 $docTypeParts[]='<!DOCTYPE html
335 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
336 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
337 break;
338 case 'xhtml_frames':
339 $docTypeParts[]='<?xml version="1.0" encoding="'.$theCharset.'"?>';
340 $docTypeParts[]='<!DOCTYPE html
341 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
342 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';
343 break;
344 case 'none':
345 break;
346 default:
347 $docTypeParts[]=$GLOBALS['TSFE']->config['config']['doctype'];
348 break;
349 }
350 } else {
351 $docTypeParts[]='<!DOCTYPE html
352 PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
353 }
354
355 // Swap XML and doctype order around (for MSIE / Opera standards compliance)
356 if ($GLOBALS['TSFE']->config['config']['doctypeSwitch']) {
357 $docTypeParts = array_reverse($docTypeParts);
358 }
359
360 // Adding doctype parts:
361 $GLOBALS['TSFE']->content.= count($docTypeParts) ? implode(chr(10),$docTypeParts).chr(10) : '';
362
363 $GLOBALS['TSFE']->content.='<html>
364 <head>
365 <!-- '.($customContent?$customContent.chr(10):'').'
366 This website is brought to you by TYPO3 - get.content.right
367 TYPO3 is a free open source Content Management Framework created by Kasper Skaarhoj and licensed under GNU/GPL.
368 TYPO3 is copyright 1998-2004 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
369 Information and contribution at http://www.typo3.com
370 -->
371 ';
372
373
374 if ($GLOBALS['TSFE']->config['config']['baseURL']) {
375 $ss = intval($GLOBALS['TSFE']->config['config']['baseURL']) ? t3lib_div::getIndpEnv('TYPO3_SITE_URL') : $GLOBALS['TSFE']->config['config']['baseURL'];
376 $GLOBALS['TSFE']->content.='
377 <base href="'.htmlspecialchars($ss).'" />';
378 }
379
380 if ($GLOBALS['TSFE']->pSetup['shortcutIcon']) {
381 $ss=$path.$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']);
382 $GLOBALS['TSFE']->content.='
383 <link rel="SHORTCUT ICON" href="'.htmlspecialchars($ss).'" />';
384 }
385
386 /** CSS STYLESHEET handling: */
387 if (is_array($GLOBALS['TSFE']->tmpl->setup['plugin.'])) {
388 $temp_styleLines=array();
389 reset($GLOBALS['TSFE']->tmpl->setup['plugin.']);
390 while(list($k2,$iCSScode)=each($GLOBALS['TSFE']->tmpl->setup['plugin.'])) {
391 if (is_array($iCSScode) && $iCSScode['_CSS_DEFAULT_STYLE']) {
392 $temp_styleLines[]='/* default styles for extension "'.substr($k2,0,-1).'" */'.chr(10).$iCSScode['_CSS_DEFAULT_STYLE'];
393 }
394 }
395 if (count($temp_styleLines)) {
396 $GLOBALS['TSFE']->content.='
397 <style type="text/css">
398 /*<![CDATA[*/
399 <!--
400 '.implode(chr(10),$temp_styleLines).'
401 -->
402 /*]]>*/
403 </style>';
404 }
405 }
406
407 if ($GLOBALS['TSFE']->pSetup['stylesheet']) {
408 $ss=$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['stylesheet']);
409 if ($ss) {
410 $GLOBALS['TSFE']->content.='
411 <link rel="stylesheet" href="'.htmlspecialchars($ss).'" />';
412 }
413 }
414 if (is_array($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
415 reset($GLOBALS['TSFE']->pSetup['includeCSS.']);
416 while(list($k2,$iCSSfile)=each($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
417 if (!is_array($iCSSfile)) {
418 $ss=$GLOBALS['TSFE']->tmpl->getFileName($iCSSfile);
419 if ($ss) {
420 $GLOBALS['TSFE']->content.='
421 <link rel="stylesheet" href="'.htmlspecialchars($ss).'"'.
422 ($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['title'] ? ' title="'.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['title']).'"' : '').
423 ($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['media'] ? ' media="'.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$k2.'.']['media']).'"' : '').
424 ' />';
425 }
426 }
427 }
428 }
429
430 // Stylesheets
431 $style='';
432 $style.=trim($GLOBALS['TSFE']->pSetup['CSS_inlineStyle']).chr(10);
433
434 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE']) {
435 $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
436 $RTEclasses = $pageTSConfig['RTE.']['classes.'];
437 if (is_array($RTEclasses)) {
438 reset($RTEclasses);
439 while(list($RTEclassName,$RTEvalueArray)=each($RTEclasses)) {
440 if ($RTEvalueArray['value']) {
441 $style.='
442 .'.substr($RTEclassName,0,-1).' {'.$RTEvalueArray['value'].'}';
443 }
444 }
445 }
446
447 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs'] && is_array($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) {
448 $mSOa_tList = t3lib_div::trimExplode(',',strtoupper($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs']),1);
449 reset($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.']);
450 while(list($mSOa_key,$mSOa_value)=each($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) {
451 if (!is_array($mSOa_value) && (in_array('*',$mSOa_tList)||in_array($mSOa_key,$mSOa_tList))) {
452 $style.='
453 '.$mSOa_key.' {'.$mSOa_value.'}';
454 }
455 }
456 }
457 }
458
459 // Setting body tag margins in CSS:
460 if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins']) && $GLOBALS['TSFE']->pSetup['bodyTagMargins.']['useCSS']) {
461 $margins = intval($GLOBALS['TSFE']->pSetup['bodyTagMargins']);
462 $style.='
463 BODY {margin: '.$margins.'px '.$margins.'px '.$margins.'px '.$margins.'px;}';
464 }
465
466 if ($GLOBALS['TSFE']->pSetup['noLinkUnderline']) {
467 $style.='
468 A:link {text-decoration: none}
469 A:visited {text-decoration: none}
470 A:active {text-decoration: none}';
471 }
472 if (trim($GLOBALS['TSFE']->pSetup['hover'])) {
473 $style.='
474 A:hover {color: '.trim($GLOBALS['TSFE']->pSetup['hover']).';}';
475 }
476 if (trim($GLOBALS['TSFE']->pSetup['hoverStyle'])) {
477 $style.='
478 A:hover {'.trim($GLOBALS['TSFE']->pSetup['hoverStyle']).'}';
479 }
480 if ($GLOBALS['TSFE']->pSetup['smallFormFields']) {
481 $style.='
482 SELECT { font-family: Verdana, Arial, Helvetica; font-size: 10px }
483 TEXTAREA { font-family: Verdana, Arial, Helvetica; font-size: 10px}
484 INPUT { font-family: Verdana, Arial, Helvetica; font-size: 10px }';
485 }
486 if ($GLOBALS['TSFE']->pSetup['adminPanelStyles']) {
487 $style.='
488
489 /* Default styles for the Admin Panel */
490 TABLE.typo3-adminPanel { border: 1px solid black; background-color: #F6F2E6; }
491 TABLE.typo3-adminPanel TR.typo3-adminPanel-hRow TD { background-color: #9BA1A8; }
492 TABLE.typo3-adminPanel TR.typo3-adminPanel-itemHRow TD { background-color: #ABBBB4; }
493 TABLE.typo3-adminPanel TABLE, TABLE.typo3-adminPanel TD { border: 0px; }
494 TABLE.typo3-adminPanel TD FONT { font-family: verdana; font-size: 10px; color: black; }
495 TABLE.typo3-adminPanel TD A FONT { font-family: verdana; font-size: 10px; color: black; }
496 TABLE.typo3-editPanel { border: 1px solid black; background-color: #F6F2E6; }
497 TABLE.typo3-editPanel TD { border: 0px; }
498 ';
499 }
500
501 if (trim($style)) {
502 $GLOBALS['TSFE']->content.='
503 <style type="text/css">
504 /*<![CDATA[*/
505 <!--'.$style.'
506 -->
507 /*]]>*/
508 </style>';
509 }
510
511
512
513
514
515 // Headerdata
516 if (is_array($GLOBALS['TSFE']->pSetup['headerData.'])) {
517 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'],'headerData.');
518 }
519
520 // <title></title> :
521 $titleTagContent = $GLOBALS['TSFE']->tmpl->printTitle(
522 $GLOBALS['TSFE']->altPageTitle?$GLOBALS['TSFE']->altPageTitle:$GLOBALS['TSFE']->page['title'],
523 $GLOBALS['TSFE']->config['config']['noPageTitle'],
524 $GLOBALS['TSFE']->config['config']['pageTitleFirst']
525 );
526 if ($GLOBALS['TSFE']->config['config']['titleTagFunction']) {
527 $titleTagContent = $GLOBALS['TSFE']->cObj->callUserFunction($GLOBALS['TSFE']->config['config']['titleTagFunction'], array(), $titleTagContent);
528 }
529
530 $GLOBALS['TSFE']->content.='
531 <title>'.htmlspecialchars($titleTagContent).'</title>';
532 $GLOBALS['TSFE']->content.='
533 <meta http-equiv="Content-Type" content="text/html; charset='.$theCharset.'" />';
534 $GLOBALS['TSFE']->content.='
535 <meta name="generator" content="TYPO3 3.6 CMS" />';
536
537 $conf=$GLOBALS['TSFE']->pSetup['meta.'];
538 if (is_array($conf)) {
539 reset($conf);
540 while(list($theKey,$theValue)=each($conf)) {
541 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
542 if (strstr($theKey,'.')) {
543 $theKey = substr($theKey,0,-1);
544 }
545 $val = $GLOBALS['TSFE']->cObj->stdWrap($conf[$theKey],$conf[$theKey.'.']);
546 $key = $theKey;
547 if (trim($val)) {
548 $a='name';
549 if (strtolower($key)=='refresh') {$a='http-equiv';}
550 $GLOBALS['TSFE']->content.= '
551 <meta '.$a.'="'.$key.'" content="'.htmlspecialchars(trim($val)).'" />';
552 }
553 }
554 }
555 }
556
557 unset($GLOBALS['TSFE']->additionalHeaderData['JSCode']);
558 unset($GLOBALS['TSFE']->additionalHeaderData['JSImgCode']);
559
560 if (is_array($GLOBALS['TSFE']->config['INTincScript'])) {
561 // Storing the JSCode and JSImgCode vars...
562 $GLOBALS['TSFE']->additionalHeaderData['JSCode'] = $GLOBALS['TSFE']->JSCode;
563 $GLOBALS['TSFE']->additionalHeaderData['JSImgCode'] = $GLOBALS['TSFE']->JSImgCode;
564 $GLOBALS['TSFE']->config['INTincScript_ext']['divKey']= $GLOBALS['TSFE']->uniqueHash();
565 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalHeaderData'] = $GLOBALS['TSFE']->additionalHeaderData; // Storing the header-data array
566 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalJavaScript'] = $GLOBALS['TSFE']->additionalJavaScript; // Storing the JS-data array
567 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalCSS'] = $GLOBALS['TSFE']->additionalCSS; // Storing the Style-data array
568
569 $GLOBALS['TSFE']->additionalHeaderData=array('<!--HD_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'); // Clearing the array
570 $GLOBALS['TSFE']->divSection.='<!--TDS_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->';
571 } else {
572 $GLOBALS['TSFE']->INTincScript_loadJSCode();
573 }
574 $JSef = TSpagegen::JSeventFunctions();
575
576 if (!$GLOBALS['TSFE']->config['config']['removeDefaultJS']) {
577 $GLOBALS['TSFE']->content.='
578 <script type="text/javascript">
579 /*<![CDATA[*/
580 <!--
581 browserName = navigator.appName;
582 browserVer = parseInt(navigator.appVersion);
583 var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
584 if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror") {version = "n3";} else {version = "n2";}
585 // Blurring links:
586 function blurLink(theObject) { //
587 if (msie4) {theObject.blur();}
588 }
589 // -->
590 /*]]>*/
591 </script>';
592 }
593
594 $GLOBALS['TSFE']->content.=implode($GLOBALS['TSFE']->additionalHeaderData,chr(10)).'
595 '.$JSef[0].'
596 </head>';
597 if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
598 $fs = t3lib_div::makeInstance('tslib_frameset');
599 $GLOBALS['TSFE']->content.=$fs->make($GLOBALS['TSFE']->pSetup['frameSet.']);
600 $GLOBALS['TSFE']->content.= chr(10).'<noframes>'.chr(10);
601 }
602
603 // Bodytag:
604 $defBT = $GLOBALS['TSFE']->pSetup['bodyTagCObject'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($GLOBALS['TSFE']->pSetup['bodyTagCObject'],$GLOBALS['TSFE']->pSetup['bodyTagCObject.'],'bodyTagCObject') : '';
605 if (!$defBT) $defBT = $GLOBALS['TSFE']->defaultBodyTag;
606 $bodyTag = $GLOBALS['TSFE']->pSetup['bodyTag'] ? $GLOBALS['TSFE']->pSetup['bodyTag'] : $defBT;
607 if ($bgImg=$GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'],$GLOBALS['TSFE']->pSetup['bgImg.'])) {
608 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' background="'.$GLOBALS["TSFE"]->absRefPrefix.$bgImg[3].'">';
609 }
610
611 if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins'])) {
612 $margins = intval($GLOBALS['TSFE']->pSetup['bodyTagMargins']);
613 if ($GLOBALS['TSFE']->pSetup['bodyTagMargins.']['useCSS']) {
614 // Setting margins in CSS, see above
615 } else {
616 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' leftmargin="'.$margins.'" topmargin="'.$margins.'" marginwidth="'.$margins.'" marginheight="'.$margins.'">';
617 }
618 }
619
620 if (trim($GLOBALS['TSFE']->pSetup['bodyTagAdd'])) {
621 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']).'>';
622 }
623
624 if (count($JSef[1])) { // Event functions:
625 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim(implode(' ',$JSef[1])).'>';
626 }
627
628
629 // Div-sections
630 $GLOBALS['TSFE']->content.= chr(10).$bodyTag;
631 if ($GLOBALS['TSFE']->divSection) {
632 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->divSection;
633 }
634
635 // Page content
636 $GLOBALS['TSFE']->content.=chr(10).$pageContent;
637
638 // Ending page
639 $GLOBALS['TSFE']->content.= chr(10).'</body>';
640 if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
641 $GLOBALS['TSFE']->content.= chr(10).'</noframes>';
642 }
643 $GLOBALS['TSFE']->content.=chr(10).'</html>';
644 }
645 }
646
647 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']) {
648 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']);
649 }
650
651
652
653 // ********************************************************
654 // Includes the search-class if $sword and $scols are set.
655 // ********************************************************
656 if (t3lib_div::_GP('sword') && t3lib_div::_GP('scols')) {
657 require_once(PATH_tslib.'class.tslib_search.php');
658 }
659
660 // ************
661 // LoadDBGroup
662 // ************
663 require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
664
665 /**
666 * Class for fetching record relations for the frontend.
667 *
668 * @author Kasper Skaarhoj <kasper@typo3.com>
669 * @package TYPO3
670 * @subpackage tslib
671 * @see tslib_cObj::RECORDS()
672 */
673 class FE_loadDBGroup extends t3lib_loadDBGroup {
674 var $fromTC = 0; // Means the not only uid and label-field is returned, but everything
675 }
676
677 // **********************************
678 // includes stuff for graphical work
679 // **********************************
680 require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');
681 require_once(PATH_tslib.'class.tslib_gifbuilder.php');
682
683 // *************************
684 // includes menu-management
685 // *************************
686 require_once(PATH_tslib.'class.tslib_menu.php');
687
688 // *************************
689 // Global content object...
690 // *************************
691 require_once(PATH_tslib.'class.tslib_content.php');
692
693 ?>