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

📄 index.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 2 页
字号:
		$this->content.=$this->doc->endPage();		echo $this->content;	}	// ***************************	// OTHER FUNCTIONS:	// ***************************	function getCountCacheTables($humanReadable)	{		$out=array();		$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pages', '');		list($out["cache_pages"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);		$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pagesection', '');		list($out["cache_pagesection"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);		$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_hash', '');		list($out["cache_hash"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);		if ($humanReadable)	{			$newOut=array();			reset($out);			while(list($k,$v)=each($out))	{				$newOut[]=$k.":".$v;			}			$out=implode($newOut,", ");		}		return $out;	}	function linkWrapTemplateTitle($title,$onlyKey="")	{		if ($onlyKey)	{			$title = '<a href="index.php?id='.$GLOBALS["SOBE"]->id.'&e['.$onlyKey.']=1&SET[function]=tx_tstemplateinfo">'.htmlspecialchars($title).'</a>';		} else {			$title = '<a href="index.php?id='.$GLOBALS["SOBE"]->id.'&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo">'.htmlspecialchars($title).'</a>';		}		return $title;	}	function noTemplate($newStandardTemplate=0)	{		global $SOBE;		$tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");	// Defined global here!		$tmpl->tt_track = 0;	// Do not log time-performance information		$tmpl->init();		$confirm = ' onClick="return confirm(\'Are you sure you want to do this?\');"';			// No template		$theOutput.=$this->doc->spacer(10);		$theOutput.=$this->doc->section('<span class="typo3-red">No template</span>',"There was no template on this page!<BR>Create a template record first in order to edit constants!",0,0,0,1);			// New standard?		if ($newStandardTemplate)	{			$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'static_template', '', '', 'title');			$opt = "";			while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{				if (substr(trim($row["title"]),0,8)=="template")	{					$opt.='<option value="'.$row["uid"].'">'.htmlspecialchars($row["title"]).'</option>';				}			}			$selector = '<select name="createStandard"><option></option>'.$opt.'</select>';				// Extension?			$theOutput.=$this->doc->spacer(10);			$theOutput.=$this->doc->section("Create new website",'If you want this page to be the root of a new website, optionally based on one of the standard templates, then press the button below:<BR>			<BR>			'.$selector.'<BR>			<img src="'.$GLOBALS["BACK_PATH"].'gfx/icon_warning.gif" width=18 height=16 hspace=5 align=top><input type="Submit" name="newWebsite" value="Create template for a new site"'.$confirm.'>',0,1);		}			// Extension?		$theOutput.=$this->doc->spacer(10);		$theOutput.=$this->doc->section("Create extension template",'An extension template allows you to enter TypoScript values that will affect only this page and subpages.<BR><BR><img src="'.$GLOBALS["BACK_PATH"].'gfx/icon_warning.gif" width=18 height=16 hspace=5 align=top><input type="submit" name="createExtension" value="Click here to create an extension template."'.$confirm.'>',0,1);			// Go to first appearing...		$first = $tmpl->ext_prevPageWithTemplate($this->id,$this->perms_clause);		if ($first)	{			$theOutput.=$this->doc->spacer(10);			$theOutput.=$this->doc->section("Go to closest page with template",sprintf("Closest template is on page '%s' (uid %s).<BR><BR>%s<strong>Click here to go.</strong>%s",$first["title"],$first["uid"],'<a href="index.php?id='.$first["uid"].'">','</a>'),0,1);		}		return $theOutput;	}	function templateMenu()	{		$tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");	// Defined global here!		$tmpl->tt_track = 0;	// Do not log time-performance information		$tmpl->init();		$all = $tmpl->ext_getAllTemplates($this->id,$this->perms_clause);		$menu='';		if (count($all)>1)	{			$this->MOD_MENU['templatesOnPage']=array();			foreach($all as $d)	{				$this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];			}		}		$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);		$menu = t3lib_BEfunc::getFuncMenu($this->id,'SET[templatesOnPage]',$this->MOD_SETTINGS['templatesOnPage'],$this->MOD_MENU['templatesOnPage']);		return $menu;	}	function createTemplate($id)	{		if (t3lib_div::_GP("createExtension"))	{			require_once (PATH_t3lib."class.t3lib_tcemain.php");			$tce = t3lib_div::makeInstance("t3lib_TCEmain");			$tce->stripslashes_values=0;			$recData=array();			$recData["sys_template"]["NEW"] = array(				"pid" => $id,				"title" => "+ext",				"sorting" => time()			);			$tce->start($recData,Array());			$tce->process_datamap();		} elseif (t3lib_div::_GP("newWebsite"))	{			require_once (PATH_t3lib."class.t3lib_tcemain.php");			$tce = t3lib_div::makeInstance("t3lib_TCEmain");			$tce->stripslashes_values=0;			$recData=array();			if (intval(t3lib_div::_GP("createStandard")))	{				$staticT = intval(t3lib_div::_GP("createStandard"));				$recData["sys_template"]["NEW"] = array(					"pid" => $id,					"title" => "NEW SITE, based on standard",					"sorting" => 0,					"root" => 1,					"clear" => 3,					"include_static" => $staticT.",57"	// 57 is cSet				);			} else {				$recData["sys_template"]["NEW"] = array(					"pid" => $id,					"title" => "NEW SITE",					"sorting" => 0,					"root" => 1,					"clear" => 3,					"config" => '# Default PAGE object:page = PAGEpage.10 = TEXTpage.10.value = HELLO WORLD!'				);			}			$tce->start($recData,Array());			$tce->process_datamap();			$tce->clear_cacheCmd("all");		}	}	// ********************************************	// RENDER LIST of pages with templates, BEGIN	// ********************************************	function setInPageArray(&$pArray,$rlArr,$row)	{		ksort($rlArr);		reset($rlArr);		if (!$rlArr[0]["uid"])		array_shift($rlArr);		$cEl = current($rlArr);		$pArray[$cEl["uid"]]=$cEl["title"];		array_shift($rlArr);		if (count($rlArr))	{			if (!isset($pArray[$cEl["uid"]."."]))	$pArray[$cEl["uid"]."."]=array();			$this->setInPageArray($pArray[$cEl["uid"]."."],$rlArr,$row);		} else {			$pArray[$cEl["uid"]."_"]=$row;		}	}	function renderList($pArray,$lines=array(),$c=0)	{		if (is_array($pArray))	{			reset($pArray);			while(list($k,$v)=each($pArray))	{				if (t3lib_div::testInt($k))	{					if (isset($pArray[$k."_"]))	{						$lines[]='<tr class="bgColor4">							<td nowrap><img src=clear.gif width=1 height=1 hspace='.($c*10).' align=top>'.							'<a href="'.t3lib_div::linkThisScript(array("id"=>$k)).'">'.							t3lib_iconWorks::getIconImage("pages",t3lib_BEfunc::getRecordWSOL("pages",$k),$GLOBALS["BACK_PATH"],' align="top" title="ID: '.$k.'"').							t3lib_div::fixed_lgd_cs($pArray[$k],30).'</a></td>							<td align=center>'.$pArray[$k."_"]["count"].'</td>							<td align=center>'.($pArray[$k."_"]["root_max_val"]>0?"x":"&nbsp;").'</td>							<td align=center>'.($pArray[$k."_"]["root_min_val"]==0?"x":"&nbsp;").'</td>							</tr>';					} else {						$lines[]='<tr>							<td nowrap colspan=3><img src=clear.gif width=1 height=1 hspace='.($c*10).' align=top>'.							t3lib_iconWorks::getIconImage("pages",t3lib_BEfunc::getRecordWSOL("pages",$k),$GLOBALS["BACK_PATH"]," align=top").							t3lib_div::fixed_lgd_cs($pArray[$k],30).'</td>							</tr>';					}					$lines=$this->renderList($pArray[$k."."],$lines,$c+1);				}			}		}		return $lines;	}}// Include extension?if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate/ts/index.php"])	{	include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate/ts/index.php"]);}// Make instance:$SOBE = t3lib_div::makeInstance("SC_mod_web_ts_index");$SOBE->init();// Include files?foreach($SOBE->include_once as $INC_FILE)	include_once($INC_FILE);$SOBE->checkExtObj();	// Checking for first level external objects$SOBE->clearCache();$SOBE->main();$SOBE->printContent();?>

⌨️ 快捷键说明

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