📄 class.tslib_pagegen.php
字号:
// Headerdata if (is_array($GLOBALS['TSFE']->pSetup['headerData.'])) { $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'],'headerData.'); } // Title $titleTagContent = $GLOBALS['TSFE']->tmpl->printTitle( $GLOBALS['TSFE']->altPageTitle?$GLOBALS['TSFE']->altPageTitle:$GLOBALS['TSFE']->page['title'], $GLOBALS['TSFE']->config['config']['noPageTitle'], $GLOBALS['TSFE']->config['config']['pageTitleFirst'] ); if ($GLOBALS['TSFE']->config['config']['titleTagFunction']) { $titleTagContent = $GLOBALS['TSFE']->cObj->callUserFunction($GLOBALS['TSFE']->config['config']['titleTagFunction'], array(), $titleTagContent); } if (strlen($titleTagContent) && intval($GLOBALS['TSFE']->config['config']['noPageTitle'])!==2) { $GLOBALS['TSFE']->content.=' <title>'.htmlspecialchars($titleTagContent).'</title>'; } $GLOBALS['TSFE']->content.=' <meta name="generator" content="TYPO3 '.TYPO3_branch.' CMS" />'; $conf=$GLOBALS['TSFE']->pSetup['meta.']; if (is_array($conf)) { reset($conf); while(list($theKey,$theValue)=each($conf)) { 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 if (strstr($theKey,'.')) { $theKey = substr($theKey,0,-1); } $val = $GLOBALS['TSFE']->cObj->stdWrap($conf[$theKey],$conf[$theKey.'.']); $key = $theKey; if (trim($val)) { $a='name'; if (strtolower($key)=='refresh') {$a='http-equiv';} $GLOBALS['TSFE']->content.= ' <meta '.$a.'="'.$key.'" content="'.htmlspecialchars(trim($val)).'" />'; } } } } unset($GLOBALS['TSFE']->additionalHeaderData['JSCode']); unset($GLOBALS['TSFE']->additionalHeaderData['JSImgCode']); if (is_array($GLOBALS['TSFE']->config['INTincScript'])) { // Storing the JSCode and JSImgCode vars... $GLOBALS['TSFE']->additionalHeaderData['JSCode'] = $GLOBALS['TSFE']->JSCode; $GLOBALS['TSFE']->additionalHeaderData['JSImgCode'] = $GLOBALS['TSFE']->JSImgCode; $GLOBALS['TSFE']->config['INTincScript_ext']['divKey'] = $GLOBALS['TSFE']->uniqueHash(); $GLOBALS['TSFE']->config['INTincScript_ext']['additionalHeaderData'] = $GLOBALS['TSFE']->additionalHeaderData; // Storing the header-data array $GLOBALS['TSFE']->config['INTincScript_ext']['additionalJavaScript'] = $GLOBALS['TSFE']->additionalJavaScript; // Storing the JS-data array $GLOBALS['TSFE']->config['INTincScript_ext']['additionalCSS'] = $GLOBALS['TSFE']->additionalCSS; // Storing the Style-data array $GLOBALS['TSFE']->additionalHeaderData = array('<!--HD_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'); // Clearing the array $GLOBALS['TSFE']->divSection.= '<!--TDS_'.$GLOBALS['TSFE']->config['INTincScript_ext']['divKey'].'-->'; } else { $GLOBALS['TSFE']->INTincScript_loadJSCode(); } $JSef = TSpagegen::JSeventFunctions(); // Adding default Java Script: $_scriptCode = ' var browserName = navigator.appName; var browserVer = parseInt(navigator.appVersion); var version = ""; var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4); if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";} // Blurring links: function blurLink(theObject) { // if (msie4) {theObject.blur();} } '; if ($GLOBALS['TSFE']->spamProtectEmailAddresses && $GLOBALS['TSFE']->spamProtectEmailAddresses !== 'ascii') { $_scriptCode.= ' // decrypt helper function function decryptCharcode(n,start,end,offset) { n = n + offset; if (offset > 0 && n > end) { n = start + (n - end - 1); } else if (offset < 0 && n < start) { n = end - (start - n - 1); } return String.fromCharCode(n); } // decrypt string function decryptString(enc,offset) { var dec = ""; var len = enc.length; for(var i=0; i < len; i++) { var n = enc.charCodeAt(i); if (n >= 0x2B && n <= 0x3A) { dec += decryptCharcode(n,0x2B,0x3A,offset); // 0-9 . , - + / : } else if (n >= 0x40 && n <= 0x5A) { dec += decryptCharcode(n,0x40,0x5A,offset); // A-Z @ } else if (n >= 0x61 && n <= 0x7A) { dec += decryptCharcode(n,0x61,0x7A,offset); // a-z } else { dec += enc.charAt(i); } } return dec; } // decrypt spam-protected emails function linkTo_UnCryptMailto(s) { location.href = decryptString(s,'.($GLOBALS['TSFE']->spamProtectEmailAddresses*-1).'); } '; } if (!$GLOBALS['TSFE']->config['config']['removeDefaultJS']) { // NOTICE: The following code must be kept synchronized with "tslib/default.js"!!! $GLOBALS['TSFE']->content.=' <script type="text/javascript"> /*<![CDATA[*/ <!--'.$_scriptCode.' // --> /*]]>*/ </script>'; } elseif ($GLOBALS['TSFE']->config['config']['removeDefaultJS']==='external') { $GLOBALS['TSFE']->content.= TSpagegen::inline2TempFile($_scriptCode, 'js'); } $GLOBALS['TSFE']->content.= chr(10).implode($GLOBALS['TSFE']->additionalHeaderData,chr(10)).''.$JSef[0].'</head>'; if ($GLOBALS['TSFE']->pSetup['frameSet.']) { $fs = t3lib_div::makeInstance('tslib_frameset'); $GLOBALS['TSFE']->content.= $fs->make($GLOBALS['TSFE']->pSetup['frameSet.']); $GLOBALS['TSFE']->content.= chr(10).'<noframes>'.chr(10); } // Bodytag: $defBT = $GLOBALS['TSFE']->pSetup['bodyTagCObject'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($GLOBALS['TSFE']->pSetup['bodyTagCObject'],$GLOBALS['TSFE']->pSetup['bodyTagCObject.'],'bodyTagCObject') : ''; if (!$defBT) $defBT = $GLOBALS['TSFE']->defaultBodyTag; $bodyTag = $GLOBALS['TSFE']->pSetup['bodyTag'] ? $GLOBALS['TSFE']->pSetup['bodyTag'] : $defBT; if ($bgImg=$GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'],$GLOBALS['TSFE']->pSetup['bgImg.'])) { $bodyTag = ereg_replace('>$','',trim($bodyTag)).' background="'.$GLOBALS["TSFE"]->absRefPrefix.$bgImg[3].'">'; } if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins'])) { $margins = intval($GLOBALS['TSFE']->pSetup['bodyTagMargins']); if ($GLOBALS['TSFE']->pSetup['bodyTagMargins.']['useCSS']) { // Setting margins in CSS, see above } else { $bodyTag = ereg_replace('>$','',trim($bodyTag)).' leftmargin="'.$margins.'" topmargin="'.$margins.'" marginwidth="'.$margins.'" marginheight="'.$margins.'">'; } } if (trim($GLOBALS['TSFE']->pSetup['bodyTagAdd'])) { $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']).'>'; } if (count($JSef[1])) { // Event functions: $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim(implode(' ',$JSef[1])).'>'; } $GLOBALS['TSFE']->content.= chr(10).$bodyTag; // Div-sections if ($GLOBALS['TSFE']->divSection) { $GLOBALS['TSFE']->content.= chr(10).$GLOBALS['TSFE']->divSection; } // Page content $GLOBALS['TSFE']->content.= chr(10).$pageContent; // Ending page $GLOBALS['TSFE']->content.= chr(10).'</body>'; if ($GLOBALS['TSFE']->pSetup['frameSet.']) { $GLOBALS['TSFE']->content.= chr(10).'</noframes>'; } $GLOBALS['TSFE']->content.=chr(10).'</html>'; } /************************* * * Helper functions * Remember: Calls internally must still be done on the non-instantiated class: TSpagegen::inline2TempFile() * *************************/ /** * Writes string to a temporary file named after the md5-hash of the string * * @param string CSS styles / JavaScript to write to file. * @param string Extension: "css" or "js" * @return string <script> or <link> tag for the file. */ function inline2TempFile($str,$ext) { // Create filename / tags: $script = ''; switch($ext) { case 'js': $script = 'typo3temp/javascript_'.substr(md5($str),0,10).'.js'; $output = ' <script type="text/javascript" src="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.$script).'"></script>'; break; case 'css': $script = 'typo3temp/stylesheet_'.substr(md5($str),0,10).'.css'; $output = ' <link rel="stylesheet" type="text/css" href="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.$script).'" />'; break; } // Write file: if ($script) { if (!@is_file(PATH_site.$script)) { t3lib_div::writeFile(PATH_site.$script,$str); } } return $output; } /** * Checks if the value defined in "config.linkVars" contains an allowed value. Otherwise, return false which means the value will not be added to any links. * * @param string The string in which to find $needle * @param string The string to find in $haystack * @return boolean Returns true if $needle matches or is found in $haystack */ function isAllowedLinkVarValue($haystack,$needle) { $OK = false; if ($needle=='int' || $needle=='integer') { // Integer if (t3lib_div::testInt($haystack)) { $OK = true; } } elseif (preg_match('/^\/.+\/[imsxeADSUXu]*$/', $needle)) { // Regular expression, only "//" is allowed as delimiter if (@preg_match($needle, $haystack)) { $OK = true; } } elseif (strstr($needle,'-')) { // Range if (t3lib_div::testInt($haystack)) { $range = explode('-',$needle); if ($range[0] <= $haystack && $range[1] >= $haystack) { $OK = true; } } } elseif (strstr($needle,'|')) { // List $haystack = str_replace(' ','',$haystack); // Trim the input if (strstr('|'.$needle.'|', '|'.$haystack.'|')) { $OK = true; } } elseif (!strcmp($needle,$haystack)) { // String comparison $OK = true; } return $OK; }}if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_pagegen.php']);}// ********************************************************// Includes the search-class if $sword and $scols are set.// ********************************************************if (t3lib_div::_GP('sword') && t3lib_div::_GP('scols')) { require_once(PATH_tslib.'class.tslib_search.php');}// ************// LoadDBGroup// ************require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');/** * Class for fetching record relations for the frontend. * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tslib * @see tslib_cObj::RECORDS() */class FE_loadDBGroup extends t3lib_loadDBGroup { var $fromTC = 0; // Means the not only uid and label-field is returned, but everything}// **********************************// includes stuff for graphical work// **********************************require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');require_once(PATH_tslib.'class.tslib_gifbuilder.php');// *************************// includes menu-management// *************************require_once(PATH_tslib.'class.tslib_menu.php');// *************************// Global content object...// *************************require_once(PATH_tslib.'class.tslib_content.php');?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -