Documentation TYPO3 par Ameos |
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com) 00006 * All rights reserved 00007 * 00008 * This script is part of the TYPO3 project. The TYPO3 project is 00009 * free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * The GNU General Public License can be found at 00015 * http://www.gnu.org/copyleft/gpl.html. 00016 * A copy is found in the textfile GPL.txt and important notices to the license 00017 * from the author is found in LICENSE.txt distributed with these scripts. 00018 * 00019 * 00020 * This script is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * This copyright notice MUST APPEAR in all copies of the script! 00026 ***************************************************************/ 00088 class TSpagegen { 00089 00095 function pagegenInit() { 00096 if ($GLOBALS['TSFE']->page['content_from_pid']>0) { 00097 $temp_copy_TSFE = clone($GLOBALS['TSFE']); // make REAL copy of TSFE object - not reference! 00098 $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! 00099 $temp_copy_TSFE->getPageAndRootlineWithDomain($GLOBALS['TSFE']->config['config']['content_from_pid_allowOutsideDomain']?0:$GLOBALS['TSFE']->domainStartPage); 00100 $GLOBALS['TSFE']->contentPid = intval($temp_copy_TSFE->id); 00101 unset($temp_copy_TSFE); 00102 } 00103 if ($GLOBALS['TSFE']->config['config']['MP_defaults']) { 00104 $temp_parts = t3lib_div::trimExplode('|',$GLOBALS['TSFE']->config['config']['MP_defaults'],1); 00105 reset($temp_parts); 00106 while(list(,$temp_p)=each($temp_parts)) { 00107 list($temp_idP,$temp_MPp) = explode(':',$temp_p,2); 00108 $temp_ids=t3lib_div::intExplode(',',$temp_idP); 00109 reset($temp_ids); 00110 while(list(,$temp_id)=each($temp_ids)) { 00111 $GLOBALS['TSFE']->MP_defaults[$temp_id]=$temp_MPp; 00112 } 00113 } 00114 } 00115 if ($GLOBALS['TSFE']->config['config']['simulateStaticDocuments_pEnc_onlyP']) { 00116 $temp_parts = t3lib_div::trimExplode(',',$GLOBALS['TSFE']->config['config']['simulateStaticDocuments_pEnc_onlyP'],1); 00117 foreach ($temp_parts as $temp_p) { 00118 $GLOBALS['TSFE']->pEncAllowedParamNames[$temp_p]=1; 00119 } 00120 } 00121 00122 00123 // Global vars... 00124 $GLOBALS['TSFE']->indexedDocTitle = $GLOBALS['TSFE']->page['title']; 00125 $GLOBALS['TSFE']->debug = ''.$GLOBALS['TSFE']->config['config']['debug']; 00126 00127 // Base url: 00128 if ($GLOBALS['TSFE']->config['config']['baseURL']) { 00129 if ($GLOBALS['TSFE']->config['config']['baseURL']==='1') { 00130 // Deprecated property, going to be dropped. 00131 $error = 'Deprecated Typoscript property was found in this template: "config.baseURL="1" 00132 00133 You need to change this value to the URL of your website root, otherwise TYPO3 will not work! 00134 00135 See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.typo3.org/index.php/TYPO3_3.8.1</a> for more information.'; 00136 00137 $GLOBALS['TSFE']->printError(nl2br($error)); 00138 exit; 00139 } else { 00140 $GLOBALS['TSFE']->baseUrl = $GLOBALS['TSFE']->config['config']['baseURL']; 00141 } 00142 $GLOBALS['TSFE']->anchorPrefix = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL'))); 00143 } 00144 00145 // Internal and External target defaults 00146 $GLOBALS['TSFE']->intTarget = ''.$GLOBALS['TSFE']->config['config']['intTarget']; 00147 $GLOBALS['TSFE']->extTarget = ''.$GLOBALS['TSFE']->config['config']['extTarget']; 00148 if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'] === 'ascii') { 00149 $GLOBALS['TSFE']->spamProtectEmailAddresses = 'ascii'; 00150 } else { 00151 $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_div::intInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'],-5,1,0); 00152 if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { 00153 $GLOBALS['TSFE']->additionalJavaScript['UnCryptMailto()']=' 00154 // JS function for uncrypting spam-protected emails: 00155 function UnCryptMailto(s) { // 00156 var n=0; 00157 var r=""; 00158 for(var i=0; i < s.length; i++) { 00159 n=s.charCodeAt(i); 00160 if (n>=8364) {n = 128;} 00161 r += String.fromCharCode(n-('.$GLOBALS['TSFE']->spamProtectEmailAddresses.')); 00162 } 00163 return r; 00164 } 00165 // JS function for uncrypting spam-protected emails: 00166 function linkTo_UnCryptMailto(s) { // 00167 location.href=UnCryptMailto(s); 00168 } 00169 '; 00170 } 00171 } 00172 00173 00174 $GLOBALS['TSFE']->absRefPrefix = trim(''.$GLOBALS['TSFE']->config['config']['absRefPrefix']); 00175 if ((!strcmp($GLOBALS['TSFE']->config['config']['simulateStaticDocuments'],'PATH_INFO') || $GLOBALS['TSFE']->absRefPrefix_force) 00176 && !$GLOBALS['TSFE']->absRefPrefix) { 00177 $GLOBALS['TSFE']->absRefPrefix=t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')).'/'; 00178 } // Force absRefPrefix to this value is PATH_INFO is used. 00179 00180 if ($GLOBALS['TSFE']->type && $GLOBALS['TSFE']->config['config']['frameReloadIfNotInFrameset']) { 00181 $tdlLD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page,'_top',$GLOBALS['TSFE']->no_cache,''); 00182 $GLOBALS['TSFE']->JSCode = 'if(!parent.'.trim($GLOBALS['TSFE']->sPre).' && !parent.view_frame) top.location.href="'.$GLOBALS['TSFE']->baseUrlWrap($tdlLD['totalURL']).'"'; 00183 } 00184 $GLOBALS['TSFE']->compensateFieldWidth = ''.$GLOBALS['TSFE']->config['config']['compensateFieldWidth']; 00185 $GLOBALS['TSFE']->lockFilePath = ''.$GLOBALS['TSFE']->config['config']['lockFilePath']; 00186 $GLOBALS['TSFE']->lockFilePath = $GLOBALS['TSFE']->lockFilePath ? $GLOBALS['TSFE']->lockFilePath : 'fileadmin/'; 00187 $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']; 00188 $GLOBALS['TSFE']->TYPO3_CONF_VARS['GFX']['im_noScaleUp'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp']; 00189 00190 $GLOBALS['TSFE']->ATagParams = trim($GLOBALS['TSFE']->config['config']['ATagParams']) ? ' '.trim($GLOBALS['TSFE']->config['config']['ATagParams']) : ''; 00191 if ($GLOBALS['TSFE']->config['config']['setJS_mouseOver']) $GLOBALS['TSFE']->setJS('mouseOver'); 00192 if ($GLOBALS['TSFE']->config['config']['setJS_openPic']) $GLOBALS['TSFE']->setJS('openPic'); 00193 00194 $GLOBALS['TSFE']->sWordRegEx=''; 00195 $GLOBALS['TSFE']->sWordList = t3lib_div::_GP('sword_list'); 00196 if (is_array($GLOBALS['TSFE']->sWordList)) { 00197 $standAlone = trim(''.$GLOBALS['TSFE']->config['config']['sword_standAlone']); 00198 $noMixedCase = trim(''.$GLOBALS['TSFE']->config['config']['sword_noMixedCase']); 00199 00200 $space = ($standAlone) ? '[[:space:]]' : ''; 00201 reset($GLOBALS['TSFE']->sWordList); 00202 while (list($key,$val) = each($GLOBALS['TSFE']->sWordList)) { 00203 if (trim($val)) { 00204 if (!$noMixedCase) { 00205 $GLOBALS['TSFE']->sWordRegEx.= $space.sql_regcase(quotemeta($val)).$space.'|'; 00206 } else { 00207 $GLOBALS['TSFE']->sWordRegEx.= $space.quotemeta($val).$space.'|'; 00208 } 00209 } 00210 } 00211 $GLOBALS['TSFE']->sWordRegEx = ereg_replace('\|$','',$GLOBALS['TSFE']->sWordRegEx); 00212 } 00213 00214 // linkVars 00215 $GLOBALS['TSFE']->linkVars = ''.$GLOBALS['TSFE']->config['config']['linkVars']; 00216 if ($GLOBALS['TSFE']->linkVars) { 00217 $linkVarArr = explode(',',$GLOBALS['TSFE']->linkVars); 00218 $GLOBALS['TSFE']->linkVars=''; 00219 reset($linkVarArr); 00220 while(list(,$val)=each($linkVarArr)) { 00221 $val=trim($val); 00222 $GET = t3lib_div::_GET(); 00223 if ($val && isset($GET[$val])) { 00224 if (!is_array($GET[$val])) { 00225 $GLOBALS['TSFE']->linkVars.='&'.$val.'='.rawurlencode($GET[$val]); 00226 } else { 00227 $GLOBALS['TSFE']->linkVars.=t3lib_div::implodeArrayForUrl($val,$GET[$val]); 00228 } 00229 } 00230 } 00231 } else { 00232 $GLOBALS['TSFE']->linkVars=''; 00233 } 00234 00235 // Setting XHTML-doctype from doctype 00236 if (!$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) { 00237 $GLOBALS['TSFE']->config['config']['xhtmlDoctype'] = $GLOBALS['TSFE']->config['config']['doctype']; 00238 } 00239 00240 if ($GLOBALS['TSFE']->config['config']['xhtmlDoctype']) { 00241 $GLOBALS['TSFE']->xhtmlDoctype = $GLOBALS['TSFE']->config['config']['xhtmlDoctype']; 00242 00243 // Checking XHTML-docytpe 00244 switch((string)$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) { 00245 case 'xhtml_trans': 00246 case 'xhtml_strict': 00247 case 'xhtml_frames': 00248 $GLOBALS['TSFE']->xhtmlVersion = 100; 00249 break; 00250 case 'xhtml_basic': 00251 $GLOBALS['TSFE']->xhtmlVersion = 105; 00252 break; 00253 case 'xhtml_11': 00254 $GLOBALS['TSFE']->xhtmlVersion = 110; 00255 break; 00256 case 'xhtml_2': 00257 $GLOBALS['TSFE']->xhtmlVersion = 200; 00258 break; 00259 default: 00260 $GLOBALS['TSFE']->xhtmlDoctype = ''; 00261 $GLOBALS['TSFE']->xhtmlVersion = 0; 00262 } 00263 } 00264 } 00265 00271 function getIncFiles() { 00272 $incFilesArray = array(); 00273 // Get files from config.includeLibrary 00274 $includeLibrary = trim(''.$GLOBALS['TSFE']->config['config']['includeLibrary']); 00275 if ($includeLibrary) { 00276 $incFile=$GLOBALS['TSFE']->tmpl->getFileName($includeLibrary); 00277 if ($incFile) { 00278 $incFilesArray[] = $incFile; 00279 } 00280 } 00281 00282 if (is_array($GLOBALS['TSFE']->pSetup['includeLibs.'])) {$incLibs=$GLOBALS['TSFE']->pSetup['includeLibs.'];} else {$incLibs=array();} 00283 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) 00284 if (count($incLibs)) { 00285 reset($incLibs); 00286 while(list(,$theLib)=each($incLibs)) { 00287 if (!is_array($theLib) && $incFile=$GLOBALS['TSFE']->tmpl->getFileName($theLib)) { 00288 $incFilesArray[] = $incFile; 00289 } 00290 } 00291 } 00292 // Include HTML mail library? 00293 if ($GLOBALS['TSFE']->config['config']['incT3Lib_htmlmail']) { 00294 $incFilesArray[] = 't3lib/class.t3lib_htmlmail.php'; 00295 } 00296 return $incFilesArray; 00297 } 00298 00304 function JSeventFunctions() { 00305 $functions=array(); 00306 $setEvents=array(); 00307 $setBody=array(); 00308 00309 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'])) { 00310 $functions[]=' function T3_onmousemoveWrapper(e) { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']).' }'; 00311 $setEvents[]=' document.onmousemove=T3_onmousemoveWrapper;'; 00312 } 00313 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'])) { 00314 $functions[]=' function T3_onmouseupWrapper(e) { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']).' }'; 00315 $setEvents[]=' document.onmouseup=T3_onmouseupWrapper;'; 00316 } 00317 if (is_array($GLOBALS['TSFE']->JSeventFuncCalls['onload']) && count($GLOBALS['TSFE']->JSeventFuncCalls['onload'])) { 00318 $functions[]=' function T3_onloadWrapper() { '.implode(' ',$GLOBALS['TSFE']->JSeventFuncCalls['onload']).' }'; 00319 $setEvents[]=' document.onload=T3_onloadWrapper;'; 00320 $setBody[]='onload="T3_onloadWrapper();"'; 00321 } 00322 00323 return Array(count($functions)?' 00324 <script type="text/javascript"> 00325 /*<![CDATA[*/ 00326 '.implode(chr(10),$functions).' 00327 '.implode(chr(10),$setEvents).' 00328 /*]]>*/ 00329 </script> 00330 ':'',$setBody); 00331 } 00332 00338 function renderContent() { 00339 // PAGE CONTENT 00340 $GLOBALS['TT']->incStackPointer(); 00341 $GLOBALS['TT']->push($GLOBALS['TSFE']->sPre, 'PAGE'); 00342 $pageContent = $GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup); 00343 00344 if ($GLOBALS['TSFE']->pSetup['wrap']) {$pageContent = $GLOBALS['TSFE']->cObj->wrap($pageContent, $GLOBALS['TSFE']->pSetup['wrap']);} 00345 if ($GLOBALS['TSFE']->pSetup['stdWrap.']) {$pageContent = $GLOBALS['TSFE']->cObj->stdWrap($pageContent, $GLOBALS['TSFE']->pSetup['stdWrap.']);} 00346 00347 // PAGE HEADER (after content - maybe JS is inserted! 00348 00349 // if 'disableAllHeaderCode' is set, all the header-code is discarded! 00350 if ($GLOBALS['TSFE']->config['config']['disableAllHeaderCode']) { 00351 $GLOBALS['TSFE']->content = $pageContent; 00352 } else { 00353 TSpagegen::renderContentWithHeader($pageContent); 00354 } 00355 $GLOBALS['TT']->pull($GLOBALS['TT']->LR?$GLOBALS['TSFE']->content:''); 00356 $GLOBALS['TT']->decStackPointer(); 00357 } 00358 00365 function renderContentWithHeader($pageContent) { 00366 $customContent = $GLOBALS['TSFE']->config['config']['headerComment']; 00367 if (trim($customContent)) { 00368 $customContent = chr(10).$customContent; 00369 } else $customContent=''; 00370 00371 // Setting charset: 00372 $theCharset = $GLOBALS['TSFE']->metaCharset; 00373 00374 // Reset the content variables: 00375 $GLOBALS['TSFE']->content=''; 00376 $htmlTagAttributes = array(); 00377 $htmlLang = $GLOBALS['TSFE']->config['config']['htmlTag_langKey'] ? $GLOBALS['TSFE']->config['config']['htmlTag_langKey'] : 'en'; 00378 00379 // Set content direction: (More info: http://www.tau.ac.il/~danon/Hebrew/HTML_and_Hebrew.html) 00380 if ($GLOBALS['TSFE']->config['config']['htmlTag_dir']) { 00381 $htmlTagAttributes['dir'] = htmlspecialchars($GLOBALS['TSFE']->config['config']['htmlTag_dir']); 00382 } 00383 00384 // Setting document type: 00385 $docTypeParts = array(); 00386 // Part 1: XML prologue 00387 switch((string)$GLOBALS['TSFE']->config['config']['xmlprologue']) { 00388 case 'none': 00389 break; 00390 case 'xml_10': 00391 $docTypeParts[]='<?xml version="1.0" encoding="'.$theCharset.'"?>'; 00392 break; 00393 case 'xml_11': 00394 $docTypeParts[]='<?xml version="1.1" encoding="'.$theCharset.'"?>'; 00395 break; 00396 case '': 00397 if ($GLOBALS['TSFE']->xhtmlVersion) $docTypeParts[]='<?xml version="1.0" encoding="'.$theCharset.'"?>'; 00398 break; 00399 default: 00400 $docTypeParts[]=$GLOBALS['TSFE']->config['config']['xmlprologue']; 00401 } 00402 // Part 2: DTD 00403 if ($GLOBALS['TSFE']->config['config']['doctype']) { 00404 switch((string)$GLOBALS['TSFE']->config['config']['doctype']) { 00405 case 'xhtml_trans': 00406 $docTypeParts[]='<!DOCTYPE html 00407 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 00408 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; 00409 break; 00410 case 'xhtml_strict': 00411 $docTypeParts[]='<!DOCTYPE html 00412 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 00413 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; 00414 break; 00415 case 'xhtml_frames': 00416 $docTypeParts[]='<!DOCTYPE html 00417 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 00418 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'; 00419 break; 00420 case 'xhtml_basic': 00421 $docTypeParts[]='<!DOCTYPE html 00422 PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" 00423 "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">'; 00424 break; 00425 case 'xhtml_11': 00426 $docTypeParts[]='<!DOCTYPE html 00427 PUBLIC "-//W3C//DTD XHTML 1.1//EN" 00428 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'; 00429 break; 00430 case 'xhtml_2': 00431 $docTypeParts[]='<!DOCTYPE html 00432 PUBLIC "-//W3C//DTD XHTML 2.0//EN" 00433 "http://www.w3.org/TR/xhtml2/DTD/xhtml2.dtd">'; 00434 break; 00435 case 'none': 00436 break; 00437 default: 00438 $docTypeParts[] = $GLOBALS['TSFE']->config['config']['doctype']; 00439 } 00440 } else { 00441 $docTypeParts[]='<!DOCTYPE html 00442 PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; 00443 } 00444 00445 if ($GLOBALS['TSFE']->xhtmlVersion) { 00446 00447 // Setting <html> tag attributes: 00448 $htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml'; 00449 $htmlTagAttributes['xml:lang'] = $htmlLang; 00450 if ($GLOBALS['TSFE']->xhtmlVersion < 110) { 00451 $htmlTagAttributes['lang'] = $htmlLang; 00452 } 00453 } 00454 00455 // Swap XML and doctype order around (for MSIE / Opera standards compliance) 00456 if ($GLOBALS['TSFE']->config['config']['doctypeSwitch']) { 00457 $docTypeParts = array_reverse($docTypeParts); 00458 } 00459 00460 // Adding doctype parts: 00461 $GLOBALS['TSFE']->content.= count($docTypeParts) ? implode(chr(10),$docTypeParts).chr(10) : ''; 00462 00463 // Begin header section: 00464 if (strcmp($GLOBALS['TSFE']->config['config']['htmlTag_setParams'],'none')) { 00465 $_attr = $GLOBALS['TSFE']->config['config']['htmlTag_setParams'] ? $GLOBALS['TSFE']->config['config']['htmlTag_setParams'] : t3lib_div::implodeAttributes($htmlTagAttributes); 00466 } else { 00467 $_attr = ''; 00468 } 00469 $GLOBALS['TSFE']->content.='<html'.($_attr ? ' '.$_attr : '').'>'; 00470 00471 // Head tag: 00472 $headTag = $GLOBALS['TSFE']->pSetup['headTag'] ? $GLOBALS['TSFE']->pSetup['headTag'] : '<head>'; 00473 $GLOBALS['TSFE']->content.= chr(10).$headTag; 00474 00475 // Setting charset meta tag: 00476 $GLOBALS['TSFE']->content.=' 00477 <meta http-equiv="Content-Type" content="text/html; charset='.$theCharset.'" />'; 00478 00479 $GLOBALS['TSFE']->content.=' 00480 00481 <!-- '.($customContent?$customContent.chr(10):'').' 00482 This website is powered by TYPO3 - inspiring people to share! 00483 TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL. 00484 TYPO3 is copyright 1998-2006 of Kasper Skaarhoj. Extensions are copyright of their respective owners. 00485 Information and contribution at http://typo3.com/ and http://typo3.org/ 00486 --> 00487 '; 00488 00489 00490 if ($GLOBALS['TSFE']->baseUrl) { 00491 $GLOBALS['TSFE']->content.=' 00492 <base href="'.htmlspecialchars($GLOBALS['TSFE']->baseUrl).'" />'; 00493 } 00494 00495 if ($GLOBALS['TSFE']->pSetup['shortcutIcon']) { 00496 $ss=$path.$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']); 00497 $GLOBALS['TSFE']->content.=' 00498 <link rel="SHORTCUT ICON" href="'.htmlspecialchars($ss).'" />'; 00499 } 00500 00501 // Including CSS files 00502 if (is_array($GLOBALS['TSFE']->tmpl->setup['plugin.'])) { 00503 $temp_styleLines=array(); 00504 foreach ($GLOBALS['TSFE']->tmpl->setup['plugin.'] as $key=>$iCSScode) { 00505 if (is_array($iCSScode) && $iCSScode['_CSS_DEFAULT_STYLE']) { 00506 $temp_styleLines[]='/* default styles for extension "'.substr($key,0,-1).'" */'.chr(10).$iCSScode['_CSS_DEFAULT_STYLE']; 00507 } 00508 } 00509 if (count($temp_styleLines)) { 00510 if ($GLOBALS['TSFE']->config['config']['inlineStyle2TempFile']) { 00511 $GLOBALS['TSFE']->content.=TSpagegen::inline2TempFile(implode(chr(10),$temp_styleLines),'css'); 00512 } else { 00513 $GLOBALS['TSFE']->content.=' 00514 <style type="text/css"> 00515 /*<![CDATA[*/ 00516 <!-- 00517 '.implode(chr(10),$temp_styleLines).' 00518 --> 00519 /*]]>*/ 00520 </style>'; 00521 } 00522 } 00523 } 00524 00525 if ($GLOBALS['TSFE']->pSetup['stylesheet']) { 00526 $ss=$GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['stylesheet']); 00527 if ($ss) { 00528 $GLOBALS['TSFE']->content.=' 00529 <link rel="stylesheet" type="text/css" href="'.htmlspecialchars($ss).'" />'; 00530 } 00531 } 00532 if (is_array($GLOBALS['TSFE']->pSetup['includeCSS.'])) { 00533 foreach ($GLOBALS['TSFE']->pSetup['includeCSS.'] as $key=>$iCSSfile) { 00534 if (!is_array($iCSSfile)) { 00535 $ss=$GLOBALS['TSFE']->tmpl->getFileName($iCSSfile); 00536 if ($ss) { 00537 if ($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['import']) { 00538 if (substr($ss,0,1)!='/') { // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende) 00539 $ss = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')).'/'.$ss; 00540 } 00541 $GLOBALS['TSFE']->content.=' 00542 <style type="text/css"> 00543 <!-- 00544 @import url("'.htmlspecialchars($ss).'") '.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['media']).'; 00545 --> 00546 </style> 00547 '; 00548 } else { 00549 $GLOBALS['TSFE']->content.=' 00550 <link rel="'.($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['alternate'] ? 'alternate stylesheet' : 'stylesheet').'" type="text/css" href="'.htmlspecialchars($ss).'"'. 00551 ($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['title'] ? ' title="'.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['title']).'"' : ''). 00552 ($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['media'] ? ' media="'.htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$key.'.']['media']).'"' : ''). 00553 ' />'; 00554 } 00555 } 00556 } 00557 } 00558 } 00559 00560 // Stylesheets 00561 $style=''; 00562 $style.=trim($GLOBALS['TSFE']->pSetup['CSS_inlineStyle']).chr(10); 00563 00564 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE']) { 00565 $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig(); 00566 $RTEclasses = $pageTSConfig['RTE.']['classes.']; 00567 if (is_array($RTEclasses)) { 00568 foreach ($RTEclasses as $RTEclassName=>$RTEvalueArray) { 00569 if ($RTEvalueArray['value']) { 00570 $style.=' 00571 .'.substr($RTEclassName,0,-1).' {'.$RTEvalueArray['value'].'}'; 00572 } 00573 } 00574 } 00575 00576 if ($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs'] && is_array($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'])) { 00577 $mSOa_tList = t3lib_div::trimExplode(',',strtoupper($GLOBALS['TSFE']->pSetup['insertClassesFromRTE.']['add_mainStyleOverrideDefs']),1); 00578 foreach ($pageTSConfig['RTE.']['default.']['mainStyleOverride_add.'] as $mSOa_key=>$mSOa_value) { 00579 if (!is_array($mSOa_value) && (in_array('*',$mSOa_tList)||in_array($mSOa_key,$mSOa_tList))) { 00580 $style.=' 00581 '.$mSOa_key.' {'.$mSOa_value.'}'; 00582 } 00583 } 00584 } 00585 } 00586 00587 // Setting body tag margins in CSS: 00588 if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins']) && $GLOBALS['TSFE']->pSetup['bodyTagMargins.']['useCSS']) { 00589 $margins = intval($GLOBALS['TSFE']->pSetup['bodyTagMargins']); 00590 $style.=' 00591 BODY {margin: '.$margins.'px '.$margins.'px '.$margins.'px '.$margins.'px;}'; 00592 } 00593 00594 if ($GLOBALS['TSFE']->pSetup['noLinkUnderline']) { 00595 $style.=' 00596 A:link {text-decoration: none} 00597 A:visited {text-decoration: none} 00598 A:active {text-decoration: none}'; 00599 } 00600 if (trim($GLOBALS['TSFE']->pSetup['hover'])) { 00601 $style.=' 00602 A:hover {color: '.trim($GLOBALS['TSFE']->pSetup['hover']).';}'; 00603 } 00604 if (trim($GLOBALS['TSFE']->pSetup['hoverStyle'])) { 00605 $style.=' 00606 A:hover {'.trim($GLOBALS['TSFE']->pSetup['hoverStyle']).'}'; 00607 } 00608 if ($GLOBALS['TSFE']->pSetup['smallFormFields']) { 00609 $style.=' 00610 SELECT { font-family: Verdana, Arial, Helvetica; font-size: 10px } 00611 TEXTAREA { font-family: Verdana, Arial, Helvetica; font-size: 10px} 00612 INPUT { font-family: Verdana, Arial, Helvetica; font-size: 10px }'; 00613 } 00614 if ($GLOBALS['TSFE']->pSetup['adminPanelStyles']) { 00615 $style.=' 00616 00617 /* Default styles for the Admin Panel */ 00618 TABLE.typo3-adminPanel { border: 1px solid black; background-color: #F6F2E6; } 00619 TABLE.typo3-adminPanel TR.typo3-adminPanel-hRow TD { background-color: #9BA1A8; } 00620 TABLE.typo3-adminPanel TR.typo3-adminPanel-itemHRow TD { background-color: #ABBBB4; } 00621 TABLE.typo3-adminPanel TABLE, TABLE.typo3-adminPanel TD { border: 0px; } 00622 TABLE.typo3-adminPanel TD FONT { font-family: verdana; font-size: 10px; color: black; } 00623 TABLE.typo3-adminPanel TD A FONT { font-family: verdana; font-size: 10px; color: black; } 00624 TABLE.typo3-editPanel { border: 1px solid black; background-color: #F6F2E6; } 00625 TABLE.typo3-editPanel TD { border: 0px; } 00626 '; 00627 } 00628 00629 if (trim($style)) { 00630 if ($GLOBALS['TSFE']->config['config']['inlineStyle2TempFile']) { 00631 $GLOBALS['TSFE']->content.=TSpagegen::inline2TempFile($style, 'css'); 00632 } else { 00633 $GLOBALS['TSFE']->content.=' 00634 <style type="text/css"> 00635 /*<![CDATA[*/ 00636 <!--'.$style.' 00637 --> 00638 /*]]>*/ 00639 </style>'; 00640 } 00641 } 00642 00643 // JavaScript files 00644 if (is_array($GLOBALS['TSFE']->pSetup['includeJS.'])) { 00645 foreach ($GLOBALS['TSFE']->pSetup['includeJS.'] as $key=>$JSfile) { 00646 if (!is_array($JSfile)) { 00647 $ss = $GLOBALS['TSFE']->tmpl->getFileName($JSfile); 00648 if ($ss) { 00649 $type = $GLOBALS['TSFE']->pSetup['includeJS.'][$key.'.']['type']; 00650 if (!$type) $type = 'text/javascript'; 00651 00652 $GLOBALS['TSFE']->content.=' 00653 <script src="'.htmlspecialchars($ss).'" type="'.htmlspecialchars($type).'"></script>'; 00654 } 00655 } 00656 } 00657 } 00658 00659 00660 00661 00662 00663 // Headerdata 00664 if (is_array($GLOBALS['TSFE']->pSetup['headerData.'])) { 00665 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'],'headerData.'); 00666 } 00667 00668 // Title 00669 $titleTagContent = $GLOBALS['TSFE']->tmpl->printTitle( 00670 $GLOBALS['TSFE']->altPageTitle?$GLOBALS['TSFE']->altPageTitle:$GLOBALS['TSFE']->page['title'], 00671 $GLOBALS['TSFE']->config['config']['noPageTitle'], 00672 $GLOBALS['TSFE']->config['config']['pageTitleFirst'] 00673 ); 00674 if ($GLOBALS['TSFE']->config['config']['titleTagFunction']) { 00675 $titleTagContent = $GLOBALS['TSFE']->cObj->callUserFunction($GLOBALS['TSFE']->config['config']['titleTagFunction'], array(), $titleTagContent); 00676 } 00677 00678 if (strlen($titleTagContent) && intval($GLOBALS['TSFE']->config['config']['noPageTitle'])!==2) { 00679 $GLOBALS['TSFE']->content.=' 00680 <title>'.htmlspecialchars($titleTagContent).'</title>'; 00681 } 00682 $GLOBALS['TSFE']->content.=' 00683 <meta name="generator" content="TYPO3 '.TYPO3_branch.' CMS" />'; 00684 00685 $conf=$GLOBALS['TSFE']->pSetup['meta.']; 00686 if (is_array($conf)) { 00687 reset($conf); 00688 while(list($theKey,$theValue)=each($conf)) { 00689 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 00690 if (strstr($theKey,'.')) { 00691 $theKey = substr($theKey,0,-1); 00692 } 00693 $val = $GLOBALS['TSFE']->cObj->stdWrap($conf[$theKey],$conf[$theKey.'.']); 00694 $key = $theKey; 00695 if (trim($val)) { 00696 $a='name'; 00697 if (strtolower($key)=='refresh') {$a='http-equiv';} 00698 $GLOBALS['TSFE']->content.= ' 00699 <meta '.$a.'="'.$key.'" content="'.htmlspecialchars(trim($val)).'" />'; 00700 } 00701 } 00702 } 00703 } 00704 00705 unset($GLOBALS['TSFE']->additionalHeaderData['JSCode']); 00706 unset($GLOBALS['TSFE']->additionalHeaderData['JSImgCode']); 00707 00708 if (is_array($GLOBALS['TSFE']->config['INTincScript'])) { 00709 // Storing the JSCode and JSImgCode vars... 00710 $GLOBALS['TSFE']->additionalHeaderData['JSCode'] = $GLOBALS['TSFE']->JSCode; 00711 $GLOBALS['TSFE']->additionalHeaderData['JSImgCode'] = $GLOBALS['TSFE']->JSImgCode; 00712 $GLOBALS['TSFE']->config['INTincScript_ext']['divKey']= $GLOBALS['TSFE']->uniqueHash(); 00713 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalHeaderData'] = $GLOBALS['TSFE']->additionalHeaderData; // Storing the header-data array 00714 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalJavaScript'] = $GLOBALS['TSFE']->additionalJavaScript; // Storing the JS-data array 00715 $GLOBALS['TSFE']->config['INTincScript_ext']['additionalCSS'] = $GLOBALS['TSFE']->additionalCSS; // Storing the Style-data array 00716 00717 $GLOBALS['TSFE']->additionalHeaderData=array('<!--HD_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'); // Clearing the array 00718 $GLOBALS['TSFE']->divSection.='<!--TDS_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'; 00719 } else { 00720 $GLOBALS['TSFE']->INTincScript_loadJSCode(); 00721 } 00722 $JSef = TSpagegen::JSeventFunctions(); 00723 00724 // Adding default Java Script: 00725 $_scriptCode = ' 00726 var browserName = navigator.appName; 00727 var browserVer = parseInt(navigator.appVersion); 00728 var version = ""; 00729 var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4); 00730 if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";} 00731 // Blurring links: 00732 function blurLink(theObject) { // 00733 if (msie4) {theObject.blur();} 00734 } 00735 '; 00736 if (!$GLOBALS['TSFE']->config['config']['removeDefaultJS']) { 00737 // NOTICE: The following code must be kept synchronized with "tslib/default.js"!!! 00738 $GLOBALS['TSFE']->content.=' 00739 <script type="text/javascript"> 00740 /*<![CDATA[*/ 00741 <!--'.$_scriptCode.' 00742 // --> 00743 /*]]>*/ 00744 </script>'; 00745 } elseif ($GLOBALS['TSFE']->config['config']['removeDefaultJS']==='external') { 00746 $GLOBALS['TSFE']->content.=TSpagegen::inline2TempFile($_scriptCode, 'js'); 00747 } 00748 00749 $GLOBALS['TSFE']->content.=chr(10).implode($GLOBALS['TSFE']->additionalHeaderData,chr(10)).' 00750 '.$JSef[0].' 00751 </head>'; 00752 if ($GLOBALS['TSFE']->pSetup['frameSet.']) { 00753 $fs = t3lib_div::makeInstance('tslib_frameset'); 00754 $GLOBALS['TSFE']->content.=$fs->make($GLOBALS['TSFE']->pSetup['frameSet.']); 00755 $GLOBALS['TSFE']->content.= chr(10).'<noframes>'.chr(10); 00756 } 00757 00758 // Bodytag: 00759 $defBT = $GLOBALS['TSFE']->pSetup['bodyTagCObject'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($GLOBALS['TSFE']->pSetup['bodyTagCObject'],$GLOBALS['TSFE']->pSetup['bodyTagCObject.'],'bodyTagCObject') : ''; 00760 if (!$defBT) $defBT = $GLOBALS['TSFE']->defaultBodyTag; 00761 $bodyTag = $GLOBALS['TSFE']->pSetup['bodyTag'] ? $GLOBALS['TSFE']->pSetup['bodyTag'] : $defBT; 00762 if ($bgImg=$GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'],$GLOBALS['TSFE']->pSetup['bgImg.'])) { 00763 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' background="'.$GLOBALS["TSFE"]->absRefPrefix.$bgImg[3].'">'; 00764 } 00765 00766 if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins'])) { 00767 $margins = intval($GLOBALS['TSFE']->pSetup['bodyTagMargins']); 00768 if ($GLOBALS['TSFE']->pSetup['bodyTagMargins.']['useCSS']) { 00769 // Setting margins in CSS, see above 00770 } else { 00771 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' leftmargin="'.$margins.'" topmargin="'.$margins.'" marginwidth="'.$margins.'" marginheight="'.$margins.'">'; 00772 } 00773 } 00774 00775 if (trim($GLOBALS['TSFE']->pSetup['bodyTagAdd'])) { 00776 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']).'>'; 00777 } 00778 00779 if (count($JSef[1])) { // Event functions: 00780 $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim(implode(' ',$JSef[1])).'>'; 00781 } 00782 $GLOBALS['TSFE']->content.= chr(10).$bodyTag; 00783 00784 00785 // Div-sections 00786 if ($GLOBALS['TSFE']->divSection) { 00787 $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->divSection; 00788 } 00789 00790 // Page content 00791 $GLOBALS['TSFE']->content.=chr(10).$pageContent; 00792 00793 // Ending page 00794 $GLOBALS['TSFE']->content.= chr(10).'</body>'; 00795 if ($GLOBALS['TSFE']->pSetup['frameSet.']) { 00796 $GLOBALS['TSFE']->content.= chr(10).'</noframes>'; 00797 } 00798 $GLOBALS['TSFE']->content.=chr(10).'</html>'; 00799 } 00800 00801 00802 00803 00804 00805 00806 00807 00808 00809 00810 00811 00812 00813 /************************* 00814 * 00815 * Helper functions 00816 * Remember: Calls internally must still be done on the non-instantiated class: TSpagegen::inline2TempFile() 00817 * 00818 *************************/ 00819 00827 function inline2TempFile($str,$ext) { 00828 00829 // Create filename / tags: 00830 $script = ''; 00831 switch($ext) { 00832 case 'js': 00833 $script = 'typo3temp/javascript_'.substr(md5($str),0,10).'.js'; 00834 $output = ' 00835 <script type="text/javascript" src="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.$script).'"></script>'; 00836 break; 00837 case 'css': 00838 $script = 'typo3temp/stylesheet_'.substr(md5($str),0,10).'.css'; 00839 $output = ' 00840 <link rel="stylesheet" type="text/css" href="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.$script).'" />'; 00841 break; 00842 } 00843 00844 // Write file: 00845 if ($script) { 00846 if (!@is_file(PATH_site.$script)) { 00847 t3lib_div::writeFile(PATH_site.$script,$str); 00848 } 00849 } 00850 00851 return $output; 00852 } 00853 } 00854 00855 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']) { 00856 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']); 00857 } 00858 00859 00860 00861 // ******************************************************** 00862 // Includes the search-class if $sword and $scols are set. 00863 // ******************************************************** 00864 if (t3lib_div::_GP('sword') && t3lib_div::_GP('scols')) { 00865 require_once(PATH_tslib.'class.tslib_search.php'); 00866 } 00867 00868 // ************ 00869 // LoadDBGroup 00870 // ************ 00871 require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php'); 00872 00881 class FE_loadDBGroup extends t3lib_loadDBGroup { 00882 var $fromTC = 0; // Means the not only uid and label-field is returned, but everything 00883 } 00884 00885 // ********************************** 00886 // includes stuff for graphical work 00887 // ********************************** 00888 require_once(PATH_t3lib.'class.t3lib_stdgraphic.php'); 00889 require_once(PATH_tslib.'class.tslib_gifbuilder.php'); 00890 00891 // ************************* 00892 // includes menu-management 00893 // ************************* 00894 require_once(PATH_tslib.'class.tslib_menu.php'); 00895 00896 // ************************* 00897 // Global content object... 00898 // ************************* 00899 require_once(PATH_tslib.'class.tslib_content.php'); 00900 00901 ?>