⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class.tslib_fe.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 5 页
字号:
		'onunload' => array(),	);	var $JSCode='';						// Deprecated, use additionalJavaScript instead.	var $JSImgCode='';					// Used to accumulate JavaScript loaded images (by menus)	var $divSection='';					// Used to accumulate DHTML-layers.	var $defaultBodyTag='<body>';		// Default bodytag, if nothing else is set. This can be overridden by applications like TemplaVoila.		// RENDERING configuration, settings from TypoScript is loaded into these vars. See pagegen.php	var $debug='';						// Debug flag, may output special debug html-code.	var $intTarget='';					// Default internal target	var $extTarget='';					// Default external target	var $MP_defaults=array();			// Keys are page ids and values are default &MP (mount point) values to set when using the linking features...)	var $spamProtectEmailAddresses=0;	// If set, typolink() function encrypts email addresses. Is set in pagegen-class.	var $absRefPrefix='';				// Absolute Reference prefix	var $absRefPrefix_force=0;			// Absolute Reference prefix force flag. This is set, if the type and id is retrieve from PATH_INFO and thus we NEED to prefix urls with at least '/'	var $compensateFieldWidth='';		// Factor for form-field widths compensation	var $lockFilePath='';				// Lock file path	var $ATagParams='';					// <A>-tag parameters	var $sWordRegEx='';					// Search word regex, calculated if there has been search-words send. This is used to mark up the found search words on a page when jumped to from a link in a search-result.	var $sWordList='';					// Is set to the incoming array sword_list in case of a page-view jumped to from a search-result.	var $linkVars='';					// A string prepared for insertion in all links on the page as url-parameters. Based on configuration in TypoScript where you defined which GET_VARS you would like to pass on.	var $excludeCHashVars='';			// A string set with a comma list of additional GET vars which should NOT be included in the cHash calculation. These vars should otherwise be detected and involved in caching, eg. through a condition in TypoScript.	var $displayEditIcons='';			// If set, edit icons are rendered aside content records. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.	var $displayFieldEditIcons='';		// If set, edit icons are rendered aside individual fields of content. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.	var $sys_language_uid=0;			// Site language, 0 (zero) is default, int+ is uid pointing to a sys_language record. Should reflect which language menus, templates etc is displayed in (master language) - but not necessarily the content which could be falling back to default (see sys_language_content)	var $sys_language_mode='';			// Site language mode for content fall back.	var $sys_language_content=0;		// Site content selection uid (can be different from sys_language_uid if content is to be selected from a fall-back language. Depends on sys_language_mode)	var $sys_language_contentOL=0;		// Site content overlay flag; If set - and sys_language_content is > 0 - , records selected will try to look for a translation pointing to their uid. (If configured in [ctrl][languageField] / [ctrl][transOrigP...]	var $sys_language_isocode = '';		// Is set to the iso code of the sys_language_content if that is properly defined by the sys_language record representing the sys_language_uid. (Requires the extension "static_info_tables")		// RENDERING data	var $applicationData=Array();		//	 'Global' Storage for various applications. Keys should be 'tx_'.extKey for extensions.	var $register=Array();	var $registerStack=Array();			// Stack used for storing array and retrieving register arrays (see LOAD_REGISTER and CLEAR_REGISTER)	var $cObjectDepthCounter = 50;		// Checking that the function is not called eternally. This is done by interrupting at a depth of 50	var $recordRegister = Array();		// used by cObj->RECORDS and cObj->CONTENT to ensure the a records is NOT rendered twice through it!	var $currentRecord = '';			// This is set to the [table]:[uid] of the latest record rendered. Note that class tslib_cObj has an equal value, but that is pointing to the record delivered in the $data-array of the tslib_cObj instance, if the cObjects CONTENT or RECORD created that instance	var $accessKey =array();			// Used by class tslib_menu to keep track of access-keys.	var $imagesOnPage=array();			// Numerical array where image filenames are added if they are referenced in the rendered document. This includes only TYPO3 generated/inserted images.	var $lastImageInfo=array();			// Is set in tslib_cObj->cImage() function to the info-array of the most recent rendered image. The information is used in tslib_cObj->IMGTEXT	var $uniqueCounter=0;				// Used to generate page-unique keys. Point is that uniqid() functions is very slow, so a unikey key is made based on this, see function uniqueHash()	var $uniqueString='';	var $indexedDocTitle='';			// This value will be used as the title for the page in the indexer (if indexing happens)	var $altPageTitle='';				// Alternative page title (normally the title of the page record). Can be set from applications you make.	var $pEncAllowedParamNames=array();	// An array that holds parameter names (keys) of GET parameters which MAY be MD5/base64 encoded with simulate_static_documents method.	var $baseUrl='';					// The base URL set for the page header.	var $anchorPrefix='';				// The proper anchor prefix needed when using speaking urls. (only set if baseUrl is set)		// Page content render object	var $cObj ='';						// is instantiated object of tslib_cObj		// CONTENT accumulation	var $content='';					// All page content is accumulated in this variable. See pagegen.php		// GENERAL	var $clientInfo='';					// Set to the browser: net / msie if 4+ browsers	var $scriptParseTime=0;	var $TCAloaded = 0;					// Set ONLY if the full TCA is loaded		// Character set (charset) conversion object:	var $csConvObj;						// An instance of the "t3lib_cs" class. May be used by any application.	var $defaultCharSet = 'iso-8859-1';	// The default charset used in the frontend if nothing else is set.	var $renderCharset='';				// Internal charset of the frontend during rendering: Defaults to "forceCharset" and if that is not set, to ->defaultCharSet	var $metaCharset='';				// Output charset of the websites content. This is the charset found in the header, meta tag etc. If different from $renderCharset a conversion happens before output to browser. Defaults to ->renderCharset if not set.	var $localeCharset='';				// Assumed charset of locale strings.		// LANG:	var $lang='';						// Set to the system language key (used on the site)	var $langSplitIndex=0;				// Set to the index number of the language key	var $labelsCharset='';				// Charset of the labels from locallang (based on $this->lang)	var $convCharsetToFrom='';			// Set to the charsets to convert from/to IF there are any difference. Otherwise this stays a string	var $LL_labels_cache=array();	var $LL_files_cache=array();	/**	 * Class constructor	 * Takes a number of GET/POST input variable as arguments and stores them internally.	 * The processing of these variables goes on later in this class.	 * Also sets internal clientInfo array (browser information) and a unique string (->uniqueString) for this script instance; A md5 hash of the microtime()	 *	 * @param	array		The global $TYPO3_CONF_VARS array. Will be set internally in ->TYPO3_CONF_VARS	 * @param	mixed		The value of t3lib_div::_GP('id')	 * @param	integer		The value of t3lib_div::_GP('type')	 * @param	boolean		The value of t3lib_div::_GP('no_cache'), evaluated to 1/0	 * @param	string		The value of t3lib_div::_GP('cHash')	 * @param	string		The value of t3lib_div::_GP('jumpurl')	 * @param	string		The value of t3lib_div::_GP('MP')	 * @param	string		The value of t3lib_div::_GP('RDCT')	 * @return	void	 * @see index_ts.php	 */	function tslib_fe($TYPO3_CONF_VARS, $id, $type, $no_cache='', $cHash='', $jumpurl='',$MP='',$RDCT='')	{			// Setting some variables:		$this->TYPO3_CONF_VARS = $TYPO3_CONF_VARS;		$this->id = $id;		$this->type = $type;		$this->no_cache = $no_cache ? 1 : 0;		$this->cHash = $cHash;		$this->jumpurl = $jumpurl;		$this->MP = $this->TYPO3_CONF_VARS['FE']['enable_mount_pids'] ? (string)$MP : '';		$this->RDCT = $RDCT;		$this->clientInfo = t3lib_div::clientInfo();		$this->uniqueString=md5(microtime());		$this->csConvObj = t3lib_div::makeInstance('t3lib_cs');			// Call post processing function for constructor:		if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc']))	{			$_params = array('pObj' => &$this);			foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'] as $_funcRef)	{				t3lib_div::callUserFunction($_funcRef,$_params,$this);			}		}	}	/**	 * Connect to MySQL database	 * May exit after outputting an error message or some JavaScript redirecting to the install tool.	 * Use connectToDB() instead!	 *	 * @return	void	 * @deprecated	 */	function connectToMySQL()	{		$this->connectToDB();	}	/**	 * Connect to SQL database	 * May exit after outputting an error message or some JavaScript redirecting to the install tool.	 *	 * @return	void	 */	function connectToDB()	{		if ($GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password))	{			if (!TYPO3_db)	{				$this->printError('No database selected','Database Error');					// Redirects to the Install Tool:				echo '<script type="text/javascript">						/*<![CDATA[*/					window.location.href = "'.TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316";						/*]]>*/					</script>';				exit;			} elseif (!$GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db))	{				$this->printError('Cannot connect to the current database, "'.TYPO3_db.'"','Database Error');				exit;			}		} else {			if (!TYPO3_db)	{					// Redirects to the Install Tool:				echo '<script type="text/javascript">						/*<![CDATA[*/					window.location.href = "'.TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316";						/*]]>*/					</script>';				exit;			}			$this->printError('The current username, password or host was not accepted when the connection to the database was attempted to be established!','Database Error');			exit;		}			// Call post processing function for DB connection:		if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB']))	{			$_params = array('pObj' => &$this);			foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'] as $_funcRef)	{				t3lib_div::callUserFunction($_funcRef,$_params,$this);			}		}	}	/**	 * Looks up the value of $this->RDCT in the database and if it is found to be associated with a redirect URL then the redirection is carried out with a 'Location:' header	 * May exit after sending a location-header.	 *	 * @return	void	 */	function sendRedirect()	{		$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('params', 'cache_md5params', 'md5hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->RDCT, 'cache_md5params'));		if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{			$this->updateMD5paramsRecord($this->RDCT);			header('Location: '.$row['params']);			exit;		}	}	/********************************************	 *	 * Initializing, resolving page id	 *	 ********************************************/	/**	 * Initializes the front-end login user.	 *	 * @return	void	 */	function initFEuser()	{		$this->fe_user = t3lib_div::makeInstance('tslib_feUserAuth');		$this->fe_user->lockIP = $this->TYPO3_CONF_VARS['FE']['lockIP'];		$this->fe_user->lockHashKeyWords = $this->TYPO3_CONF_VARS['FE']['lockHashKeyWords'];		$this->fe_user->checkPid = $this->TYPO3_CONF_VARS['FE']['checkFeUserPid'];		$this->fe_user->lifetime = intval($this->TYPO3_CONF_VARS['FE']['lifetime']);		$this->fe_user->checkPid_value = $GLOBALS['TYPO3_DB']->cleanIntList(t3lib_div::_GP('pid'));	// List of pid's acceptable			// Check if a session is transferred:		if (t3lib_div::_GP('FE_SESSION_KEY'))	{			$fe_sParts = explode('-',t3lib_div::_GP('FE_SESSION_KEY'));			if (!strcmp(md5($fe_sParts[0].'/'.$this->TYPO3_CONF_VARS['SYS']['encryptionKey']), $fe_sParts[1]))	{	// If the session key hash check is OK:				$_COOKIE[$this->fe_user->name] = $fe_sParts[0];				$this->fe_user->forceSetCookie = 1;			}		}		if ($this->TYPO3_CONF_VARS['FE']['dontSetCookie'])	{			$this->fe_user->dontSetCookie=1;		}		$this->fe_user->start();		$this->fe_user->unpack_uc('');		$this->fe_user->fetchSessionData();	// Gets session data		$recs = t3lib_div::_GP('recs');		if (is_array($recs))	{	// If any record registration is submitted, register the record.			$this->fe_user->record_registration($recs, $this->TYPO3_CONF_VARS['FE']['maxSessionDataSize']);		}			// Call hook for possible manipulation of frontend user object		if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser']))	{			$_params = array('pObj' => &$this);			foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'] as $_funcRef)	{				t3lib_div::callUserFunction($_funcRef,$_params,$this);			}		}			// For every 60 seconds the is_online timestamp is updated.		if (is_array($this->fe_user->user) && $this->fe_user->user['uid'] && $this->fe_user->user['is_online']<($GLOBALS['EXEC_TIME']-60))	{			$GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid='.intval($this->fe_user->user['uid']), array('is_online' => $GLOBALS['EXEC_TIME']));		}	}	/**	 * Initializes the front-end user groups.	 * Sets ->loginUser and ->gr_list based on front-end user status.	 *	 * @return	void	 */	function initUserGroups() {		$this->fe_user->showHiddenRecords = $this->showHiddenRecords;		// This affects the hidden-flag selecting the fe_groups for the user!		$this->fe_user->fetchGroupData(); 	// no matter if we have an active user we try to fetch matching groups which can be set without an user (simulation for instance!)		if (is_array($this->fe_user->user) && count($this->fe_user->groupData['uid']))	{			$this->loginUser=1;	// global flag!			$this->gr_list = '0,-2';	// group -2 is not an existing group, but denotes a 'default' group when a user IS logged in. This is used to let elements be shown for all logged in users!			$gr_array = $this->fe_user->groupData['uid'];		} else {			$this->loginUser=0;			$this->gr_list = '0,-1';	// group -1 is not an existing group, but denotes a 'default' group when not logged in. This is used to let elements be hidden, when a user is logged in!			if ($this->loginAllowedInBranch)	{				$gr_array = $this->fe_user->groupData['uid'];	// For cases where logins are not banned from a branch usergroups can be set based on IP masks so we should add the usergroups uids.			} else {				$gr_array = array();		// Set to blank since we will NOT risk any groups being set when no logins are allowed!			}		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -