📄 class.tslib_fe.php
字号:
<?php/**************************************************************** Copyright notice** (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)* All rights reserved** This script is part of the TYPO3 project. The TYPO3 project is* free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** The GNU General Public License can be found at* http://www.gnu.org/copyleft/gpl.html.* A copy is found in the textfile GPL.txt and important notices to the license* from the author is found in LICENSE.txt distributed with these scripts.*** This script is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** This copyright notice MUST APPEAR in all copies of the script!***************************************************************//** * Class for the built TypoScript based Front End * * This class has a lot of functions and internal variable which are use from index_ts.php. * The class is instantiated as $GLOBALS['TSFE'] in index_ts.php. * The use of this class should be inspired by the order of function calls as found in index_ts.php. * * $Id: class.tslib_fe.php 2757 2007-11-23 15:24:18Z baschny $ * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj * XHTML compliant * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> *//** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 213: class tslib_fe * 382: function tslib_fe($TYPO3_CONF_VARS, $id, $type, $no_cache='', $cHash='', $jumpurl='',$MP='',$RDCT='') * 415: function connectToMySQL() * 425: function connectToDB() * 470: function sendRedirect() * * SECTION: Initializing, resolving page id * 508: function initFEuser() * 558: function initUserGroups() * 593: function isUserOrGroupSet() * 618: function checkAlternativeIdMethods() * 670: function clear_preview() * 683: function determineId() * 817: function fetch_the_id() * 911: function getPageAndRootline() * 994: function getPageShortcut($SC,$mode,$thisUid,$itera=20,$pageLog=array()) * 1044: function checkRootlineForIncludeSection() * 1081: function checkEnableFields($row,$bypassGroupCheck=FALSE) * 1097: function checkPageGroupAccess($row, $groupList=NULL) * 1116: function checkPagerecordForIncludeSection($row) * 1125: function checkIfLoginAllowedInBranch() * 1150: function getPageAccessFailureReasons() * 1182: function setIDfromArgV() * 1198: function getPageAndRootlineWithDomain($domainStartPage) * 1225: function setSysPageWhereClause() * 1237: function findDomainRecord($recursive=0) * 1257: function pageNotFoundAndExit($reason='', $header='') * 1272: function pageNotFoundHandler($code, $header='', $reason='') * 1316: function checkAndSetAlias() * 1335: function idPartsAnalyze($str) * 1360: function mergingWithGetVars($GET_VARS) * 1390: function ADMCMD_preview() * 1433: function ADMCMD_preview_postInit($previewConfig) * * SECTION: Template and caching related functions. * 1465: function makeCacheHash() * 1489: function reqCHash() * 1511: function cHashParams($addQueryParams) * 1520: function initTemplate() * 1532: function getFromCache() * 1578: function getFromCache_queryRow() * 1608: function headerNoCache() * 1637: function getHash() * 1657: function getConfigArray() * * SECTION: Further initialization and data processing * 1818: function getCompressedTCarray() * 1872: function includeTCA($TCAloaded=1) * 1899: function settingLanguage() * 1992: function settingLocale() * 2017: function checkDataSubmission() * 2050: function fe_tce() * 2064: function locDataCheck($locationData) * 2080: function sendFormmail() * 2131: function extractRecipientCopy($bodytext) * 2145: function setExternalJumpUrl() * 2156: function checkJumpUrlReferer() * 2171: function jumpUrl() * 2215: function setUrlIdToken() * * SECTION: Page generation; cache handling * 2258: function isGeneratePage() * 2268: function tempPageCacheContent() * 2325: function realPageCacheContent() * 2355: function setPageCacheContent($content,$data,$tstamp) * 2382: function clearPageCacheContent() * 2392: function clearPageCacheContent_pidList($pidList) * 2403: function pageCachePostProcess(&$row,$type) * 2426: function setSysLastChanged() * * SECTION: Page generation; rendering and inclusion * 2462: function generatePage_preProcessing() * 2484: function generatePage_whichScript() * 2496: function generatePage_postProcessing() * 2588: function INTincScript() * 2648: function INTincScript_loadJSCode() * 2689: function isINTincScript() * 2698: function doXHTML_cleaning() * 2707: function doLocalAnchorFix() * * SECTION: Finished off; outputting, storing session data, statistics... * 2738: function isOutputting() * 2761: function processOutput() * 2834: function sendCacheHeaders() * 2902: function isStaticCacheble() * 2915: function contentStrReplace() * 2941: function isEXTincScript() * 2950: function storeSessionData() * 2960: function setParseTime() * 2972: function statistics() * 3066: function previewInfo() * 3101: function hook_eofe() * 3117: function beLoginLinkIPList() * 3138: function addTempContentHttpHeaders() * * SECTION: Various internal API functions * 3184: function makeSimulFileName($inTitle,$page,$type,$addParams='',$no_cache='') * 3231: function simulateStaticDocuments_pEnc_onlyP_proc($linkVars) * 3260: function getSimulFileName() * 3271: function setSimulReplacementChar() * 3291: function fileNameASCIIPrefix($inTitle,$titleChars,$mergeChar='.') * 3314: function encryptEmail($string,$back=0) * 3340: function codeString($string, $decode=FALSE) * 3366: function roundTripCryptString($string) * 3386: function checkFileInclude($incFile) * 3401: function newCObj() * 3414: function setAbsRefPrefix() * 3428: function baseUrlWrap($url) * 3447: function printError($label,$header='Error!') * 3458: function updateMD5paramsRecord($hash) * 3469: function tidyHTML($content) * 3495: function prefixLocalAnchorsWithScript() * 3505: function workspacePreviewInit() * 3521: function doWorkspacePreview() * 3531: function whichWorkspace($returnTitle = FALSE) * * SECTION: Various external API functions - for use in plugins etc. * 3589: function getStorageSiterootPids() * 3604: function getPagesTSconfig() * 3637: function setJS($key,$content='') * 3677: function setCSS($key,$content) * 3692: function make_seed() * 3705: function uniqueHash($str='') * 3714: function set_no_cache() * 3724: function set_cache_timeout_default($seconds) * 3740: function plainMailEncoded($email,$subject,$message,$headers='') * * SECTION: Localization and character set conversion * 3784: function sL($input) * 3813: function readLLfile($fileRef) * 3824: function getLLL($index,$LOCAL_LANG) * 3838: function initLLvars() * 3872: function csConv($str,$from='') * 3890: function convOutputCharset($content,$label='') * 3903: function convPOSTCharset() * * TOTAL FUNCTIONS: 116 * (This index is automatically created/updated by the extension "extdeveval") * *//** * Main frontend class, instantiated in the index_ts.php script as the global object TSFE * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tslib */ class tslib_fe { // CURRENT PAGE: var $id=''; // The page id (int) var $type=''; // RO The type (int) var $idParts=array(); // Loaded with the id, exploded by ',' var $cHash=''; // The submitted cHash var $no_cache=''; // Page will not be cached. Write only true. Never clear value (some other code might have reasons to set it true) var $rootLine=''; // The rootLine (all the way to tree root, not only the current site!) (array) var $page=''; // The pagerecord (array) var $contentPid=0; // This will normally point to the same value as id, but can be changed to point to another page from which content will then be displayed instead. var $sys_page=''; // The object with pagefunctions (object) var $jumpurl=''; var $pageNotFound=0; // Is set to 1 if a pageNotFound handler could have been called. var $domainStartPage=0; // Domain start page var $pageAccessFailureHistory=array(); // Array containing a history of why a requested page was not accessible. var $MP=''; var $RDCT=''; var $page_cache_reg1=0; // This can be set from applications as a way to tag cached versions of a page and later perform some external cache management, like clearing only a part of the cache of a page... var $siteScript=''; // Contains the value of the current script path that activated the frontend. Typically "index.php" but by rewrite rules it could be something else! Used for Speaking Urls / Simulate Static Documents. // USER var $fe_user=''; // The user (object) var $loginUser=''; // Global flag indicating that a front-end user is logged in. This is set only if a user really IS logged in. The group-list may show other groups (like added by IP filter or so) even though there is no user. var $gr_list=''; // (RO=readonly) The group list, sorted numerically. Group '0,-1' is the default group, but other groups may be added by other means than a user being logged in though... var $beUserLogin=''; // Flag that indicates if a Backend user is logged in! var $workspacePreview=''; // Integer, that indicates which workspace is being previewed. var $loginAllowedInBranch = TRUE; // Shows whether logins are allowed in branch var $ADMCMD_preview_BEUSER_uid = 0; // Integer, set to backend user ID to initialize when keyword-based preview is used. // PREVIEW var $fePreview=''; // Flag indication that preview is active. This is based on the login of a backend user and whether the backend user has read access to the current page. A value of 1 means ordinary preview, 2 means preview of a non-live workspace var $showHiddenPage=''; // Flag indicating that hidden pages should be shown, selected and so on. This goes for almost all selection of pages! var $showHiddenRecords=''; // Flag indicating that hidden records should be shown. This includes sys_template, pages_language_overlay and even fe_groups in addition to all other regular content. So in effect, this includes everything except pages. var $simUserGroup='0'; // Value that contains the simulated usergroup if any // CONFIGURATION var $TYPO3_CONF_VARS=array(); // The configuration array as set up in t3lib/config_default.php. Should be an EXACT copy of the global array. var $config=''; // 'CONFIG' object from TypoScript. Array generated based on the TypoScript configuration of the current page. Saved with the cached pages. var $TCAcachedExtras=array(); // Array of cached information from TCA. This is NOT TCA itself! // TEMPLATE / CACHE var $tmpl=''; // The TypoScript template object. Used to parse the TypoScript template var $cacheTimeOutDefault=''; // Is set to the time-to-live time of cached pages. If false, default is 60*60*24, which is 24 hours. var $cacheContentFlag=''; // Set internally if cached content is fetched from the database var $cacheExpires=0; // Set to the expire time of cached content var $isClientCachable=FALSE; // Set if cache headers allowing caching are sent. var $all=''; // $all used by template fetching system. This array is an identification of the template. If $this->all is empty it's because the template-data is not cached, which it must be. var $sPre=''; // toplevel - objArrayName, eg 'page' var $pSetup=''; // TypoScript configuration of the page-object pointed to by sPre. $this->tmpl->setup[$this->sPre.'.'] var $newHash=''; // This hash is unique to the template, the $this->id and $this->type vars and the gr_list (list of groups). Used to get and later store the cached data var $getMethodUrlIdToken=''; // If config.ftu (Frontend Track User) is set in TypoScript for the current page, the string value of this var is substituted in the rendered source-code with the string, '&ftu=[token...]' which enables GET-method usertracking as opposed to cookie based var $no_CacheBeforePageGen=''; // This flag is set before inclusion of pagegen.php IF no_cache is set. If this flag is set after the inclusion of pagegen.php, no_cache is forced to be set. This is done in order to make sure that php-code from pagegen does not falsely clear the no_cache flag. var $tempContent = FALSE; // This flag indicates if temporary content went into the cache during page-generation. var $forceTemplateParsing=''; // Boolean, passed to TypoScript template class and tells it to render the template forcibly var $cHash_array=array(); // The array which cHash_calc is based on, see ->makeCacheHash(). var $hash_base=''; // Loaded with the serialized array that is used for generating a hashstring for the cache var $pagesTSconfig=''; // May be set to the pagesTSconfig // PAGE-GENERATION / cOBJ /* Eg. insert JS-functions in this array ($additionalHeaderData) to include them once. Use associative keys. Keys in use: JSFormValidate : <script type="text/javascript" src="'.$GLOBALS["TSFE"]->absRefPrefix.'t3lib/jsfunc.validateform.js"></script> JSincludeFormupdate : <script type="text/javascript" src="t3lib/jsfunc.updateform.js"></script> JSMenuCode, JSMenuCode_menu : JavaScript for the JavaScript menu JSCode : reserved JSImgCode : reserved */ var $additionalHeaderData=array(); // used to accumulate additional HTML-code for the header-section, <head>...</head>. Insert either associative keys (like additionalHeaderData['myStyleSheet'], see reserved keys above) or num-keys (like additionalHeaderData[] = '...') var $additionalJavaScript=array(); // used to accumulate additional JavaScript-code. Works like additionalHeaderData. Reserved keys at 'openPic' and 'mouseOver' var $additionalCSS=array(); // used to accumulate additional Style code. Works like additionalHeaderData. var $JSeventFuncCalls = array( // you can add JavaScript functions to each entry in these arrays. Please see how this is done in the GMENU_LAYERS script. The point is that many applications on a page can set handlers for onload, onmouseover and onmouseup 'onmousemove' => array(), 'onmouseup' => array(), 'onmousemove' => array(), 'onkeydown' => array(), 'onkeyup' => array(), 'onkeypress' => array(), 'onload' => array(),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -