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

📄 index.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php/****************************************************************  Copyright notice**  (c) 1999-2005 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!***************************************************************//** * Module: Database integrity check * * This module lets you check if all pages and the records relate properly to each other * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @coauthor	Jo Hasenau <info@cybercraft.de> *//** * [CLASS/FUNCTION INDEX of SCRIPT] * * * *   89: class SC_mod_tools_dbint_index *  105:     function init() *  119:     function jumpToUrl(URL) *  139:     function menuConfig() *  226:     function main() *  270:     function printContent() *  281:     function func_default() * *              SECTION: Functionality implementation *  314:     function func_refindex() *  344:     function func_search() *  386:     function func_tree() *  409:     function func_records() *  507:     function func_relations() *  558:     function func_filesearch() *  607:     function findFile($basedir,$pattern,&$matching_files,$depth) * * TOTAL FUNCTIONS: 13 * (This index is automatically created/updated by the extension "extdeveval") * */unset($MCONF);require ('conf.php');require ($BACK_PATH.'init.php');require ($BACK_PATH.'template.php');require_once (PATH_t3lib.'class.t3lib_admin.php');require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');require_once (PATH_t3lib.'class.t3lib_querygenerator.php');require_once (PATH_t3lib.'class.t3lib_xml.php');require_once (PATH_t3lib.'class.t3lib_fullsearch.php');require_once (PATH_t3lib.'class.t3lib_refindex.php');$LANG->includeLLFile('EXT:lowlevel/dbint/locallang.xml');$BE_USER->modAccess($MCONF,1);/** * Script class for the DB int module * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */class SC_mod_tools_dbint_index {	var $MCONF = array();	var $MOD_MENU = array();	var $MOD_SETTINGS = array();	var $doc;	var $content;	var $menu;	/**	 * Initialization	 *	 * @return	void	 */	function init()	{		global $LANG,$BACK_PATH;		$this->MCONF = $GLOBALS['MCONF'];		$this->menuConfig();		$this->doc = t3lib_div::makeInstance('mediumDoc');		$this->doc->form='<form action="" method="post">';		$this->doc->backPath = $BACK_PATH;				// JavaScript		$this->doc->JScode = '		<script language="javascript" type="text/javascript">			script_ended = 0;			function jumpToUrl(URL)	{				window.location.href = URL;			}		</script>		';		$this->doc->tableLayout = Array (			'defRow' => Array (				'0' => Array('<td valign="top">','</td>'),				'1' => Array('<td valign="top">','</td>'),				'defCol' => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="15" height="1" alt="" /></td><td valign="top">','</td>')			)		);	}	/**	 * Configure menu	 *	 * @return	void	 */	function menuConfig()	{		global $LANG;		// MENU-ITEMS:			// If array, then it's a selector box menu			// If empty string it's just a variable, that'll be saved.			// Values NOT in this array will not be saved in the settings-array for the module.		$this->MOD_MENU = array(			'function' => array(				0 => '[ MENU ]',				'records' => 'Record Statistics',				'tree' => 'Total Page Tree',				'relations' => 'Database Relations',				'search' => 'Full search',				'filesearch' => 'Find filename',				'refindex' => 'Manage Reference Index',			),			'search' => array(				'raw' => 'Raw search in all fields',				'query' => 'Advanced query'			),			'search_query_smallparts' => '',			'search_result_labels' => '',			'labels_noprefix' => '',			'options_sortlabel' => '',			'show_deleted' => '',			'queryConfig' => '',	// Current query			'queryTable' => '',	// Current table			'queryFields' => '',	// Current tableFields			'queryLimit' => '',	// Current limit			'queryOrder' => '',	// Current Order field			'queryOrderDesc' => '',	// Current Order field descending flag			'queryOrder2' => '',	// Current Order2 field			'queryOrder2Desc' => '',	// Current Order2 field descending flag			'queryGroup' => '',	// Current Group field			'storeArray' => '',	// Used to store the available Query config memory banks			'storeQueryConfigs' => '',	// Used to store the available Query configs in memory			'search_query_makeQuery' => array(				'all' => 'Select records',				'count' => 'Count results',				'explain' => 'Explain query',				'csv' => 'CSV Export',				'xml' => 'XML Export'			),			'sword' => ''		);			// CLEAN SETTINGS		$OLD_MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU,'', $this->MCONF['name'], 'ses');		$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], 'ses');		if (t3lib_div::_GP('queryConfig'))	{			$qA = t3lib_div::_GP('queryConfig');			$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, array('queryConfig'=>serialize($qA)), $this->MCONF['name'], 'ses');		}		$addConditionCheck = t3lib_div::_GP('qG_ins');		foreach ($OLD_MOD_SETTINGS as $key=>$val)	{			if (substr($key, 0, 5)=='query' && $this->MOD_SETTINGS[$key]!=$val && $key!='queryLimit' && $key!='use_listview')	{				$setLimitToStart = 1;				if ($key == 'queryTable' && !$addConditionCheck) {					$this->MOD_SETTINGS['queryConfig'] = '';				}			}			if ($key=='queryTable' && $this->MOD_SETTINGS[$key]!=$val)	{				$this->MOD_SETTINGS['queryFields'] = '';			}		}		if ($setLimitToStart)	{			$currentLimit = explode(',',$this->MOD_SETTINGS['queryLimit']);			if ($currentLimit[1])	{				$this->MOD_SETTINGS['queryLimit']='0,'.$currentLimit[1];			} else {				$this->MOD_SETTINGS['queryLimit']='0';			}			$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, $this->MOD_SETTINGS, $this->MCONF['name'], 'ses');		}	}	/**	 * Main	 *	 * @return	void	 */	function main()	{		global $BE_USER,$LANG;			// Content creation		$this->content.= $this->doc->startPage($LANG->getLL('title'));		if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopMenu'])	{			$this->menu = t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']);		}		switch($this->MOD_SETTINGS['function'])	{			case 'search':				$this->func_search();			break;			case 'tree':				$this->func_tree();			break;			case 'records':				$this->func_records();			break;			case 'relations':				$this->func_relations();			break;			case 'filesearch':				$this->func_filesearch();			break;			case 'refindex':				$this->func_refindex();			break;			default:				$this->func_default();			break;		}		if ($BE_USER->mayMakeShortcut())	{			$this->content.=$this->doc->spacer(20).						$this->doc->section('',$this->doc->makeShortcutIcon('','function,search,search_query_makeQuery',$this->MCONF['name']));		}	}	/**	 * Print content	 *	 * @return	void	 */	function printContent()	{		$this->content.= $this->doc->endPage();		echo $this->content;	}	/**	 * Menu	 *	 * @return	void	 */	function func_default()	{		global $LANG;		$this->content.=$this->doc->header($LANG->getLL('title'));		$this->content.=$this->doc->spacer(5);		$this->content.=$this->doc->section('',$this->menu);		$this->content.=$this->doc->section('<a href="index.php?SET[function]=records">'.$LANG->getLL('records').'</a>',$LANG->getLL('records_description'),1,1,0,1);		$this->content.=$this->doc->section('<a href="index.php?SET[function]=tree">'.$LANG->getLL('tree').'</a>',$LANG->getLL('tree_description'),1,1,0,1);		$this->content.=$this->doc->section('<a href="index.php?SET[function]=relations">'.$LANG->getLL('relations').'</a>',$LANG->getLL('relations_description'),1,1,0,1);		$this->content.=$this->doc->section('<a href="index.php?SET[function]=search">'.$LANG->getLL('search').'</a>',$LANG->getLL('search_description'),1,1,0,1);		$this->content.=$this->doc->section('<a href="index.php?SET[function]=filesearch">'.$LANG->getLL('filesearch').'</a>',$LANG->getLL('filesearch_description'),1,1,0,1);		$this->content.=$this->doc->section('<a href="index.php?SET[function]=refindex">'.$LANG->getLL('refindex').'</a>',$LANG->getLL('refindex_description'),1,1,0,1);		$this->content.=$this->doc->spacer(50);	}	/****************************	 *	 * Functionality implementation	 *	 ****************************/	/**	 * Check and update reference index!	 *	 * @return	void	 */	function func_refindex()	{		global $TYPO3_DB,$TCA;		$this->content.=$this->doc->section('',$this->menu);		$this->content.=$this->doc->section('',$menu2).$this->doc->spacer(10);		if (t3lib_div::_GP('_update') || t3lib_div::_GP('_check'))	{			$testOnly = t3lib_div::_GP('_check')?TRUE:FALSE;				// Call the functionality			$refIndexObj = t3lib_div::makeInstance('t3lib_refindex');			list($headerContent,$bodyContent) = $refIndexObj->updateIndex($testOnly);				// Output content:			$this->content.=$this->doc->section($headerContent,str_replace(chr(10),'<br/>',$bodyContent),0,1);		}			// Output content:		$content = 'Click here to update reference index: <input type="submit" name="_update" value="Update now!" /><br/>';

⌨️ 快捷键说明

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