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

📄 index.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 2 页
字号:
		$content.= 'Click here to test reference index: <input type="submit" name="_check" value="Check now!" /><br/>';		$content.= 'You can also run the check as a shell script if the processing takes longer than the PHP max_execution_time allows:<br/>'.					t3lib_extMgm::extPath('lowlevel').'dbint/cli/refindex_cli.phpsh';		$this->content.=$this->doc->section('Update reference index',$content,0,1);	}	/**	 * Search (Full / Advanced)	 *	 * @return	void	 */	function func_search()	{		global $LANG;		$fullsearch = t3lib_div::makeInstance('t3lib_fullsearch');		$this->content.= $this->doc->header($LANG->getLL('search'));		$this->content.= $this->doc->spacer(5);		$menu2='';		if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopMenu'])	{			$menu2 = t3lib_BEfunc::getFuncMenu(0, 'SET[search]', $this->MOD_SETTINGS['search'], $this->MOD_MENU['search']);		}		if ($this->MOD_SETTINGS['search']=='query' && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopMenu'])	{			$menu2 .= t3lib_BEfunc::getFuncMenu(0, 'SET[search_query_makeQuery]', $this->MOD_SETTINGS['search_query_makeQuery'], $this->MOD_MENU['search_query_makeQuery']). '<br />';		}		if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopCheckboxes'] && $this->MOD_SETTINGS['search']=='query')	{			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_query_smallparts]', $this->MOD_SETTINGS['search_query_smallparts'],'','','id="checkSearch_query_smallparts"').'&nbsp;<label for="checkSearch_query_smallparts">Show SQL parts</label><br />';			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_result_labels]', $this->MOD_SETTINGS['search_result_labels'],'','','id="checkSearch_result_labels"').'&nbsp;<label for="checkSearch_result_labels">Use formatted strings, labels and dates instead of original values for results</label><br />';			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[labels_noprefix]', $this->MOD_SETTINGS['labels_noprefix'],'','','id="checkLabels_noprefix"').'&nbsp;<label for="checkLabels_noprefix">Don\'t use original values in brackets as prefix for labelled results</label><br />';			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[options_sortlabel]', $this->MOD_SETTINGS['options_sortlabel'],'','','id="checkOptions_sortlabel"').'&nbsp;<label for="checkOptions_sortlabel">Sort selectbox options for relations by label and not by value</label><br />';			$menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[show_deleted]', $this->MOD_SETTINGS['show_deleted'],'','','id="checkShow_deleted"').'&nbsp;<label for="checkShow_deleted">Show even deleted entries (with undelete buttons)</label>';		}		$this->content.= $this->doc->section('',$this->menu);//$this->doc->divider(5);		$this->content.= $this->doc->section('',$menu2).$this->doc->spacer(10);		switch($this->MOD_SETTINGS['search'])		{			case 'query':				$this->content.=$fullsearch->queryMaker();			break;			case 'raw':			default:				$this->content.=$this->doc->section('Search options:',$fullsearch->form(),0,1);				$this->content.=$this->doc->section('Result:',$fullsearch->search(),0,1);			break;		}	}	/**	 * Display page tree	 *	 * @return	void	 */	function func_tree()	{		global $LANG,$BACK_PATH;		$startID = 0;		$admin = t3lib_div::makeInstance('t3lib_admin');		$admin->genTree_makeHTML=1;		$admin->backPath = $BACK_PATH;		$admin->genTree(intval($startID),'<img src="'.$BACK_PATH.'clear.gif" width="1" height="1" align="top" alt="" />');		$this->content.= $this->doc->header($LANG->getLL('tree'));		$this->content.= $this->doc->spacer(5);		$this->content.= $this->doc->section('',$this->menu).$this->doc->divider(5);		$this->content.= $this->doc->sectionEnd();		$this->content.= $admin->genTree_HTML;		$this->content.= $admin->lostRecords($admin->genTree_idlist.'0');	}	/**	 * Records overview	 *	 * @return	void	 */	function func_records()	{		global $LANG,$TCA,$BACK_PATH,$PAGES_TYPES;		$admin = t3lib_div::makeInstance('t3lib_admin');		$admin->genTree_makeHTML = 0;		$admin->backPath = $BACK_PATH;		$admin->genTree(0,'');		$this->content.= $this->doc->header($LANG->getLL('records'));		$this->content.= $this->doc->spacer(5);		$this->content.= $this->doc->section('',$this->menu);			// Pages stat		$codeArr=Array();		$i++;		$codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/pages.gif','width="18" height="16"').' hspace="4" align="top" alt="" />';		$codeArr[$i][]=$LANG->getLL('total_pages');		$codeArr[$i][]=count($admin->page_idArray);		$i++;		if (t3lib_extMgm::isLoaded('cms'))	{			$codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/hidden_page.gif','width="18" height="16"').' hspace="4" align="top">';			$codeArr[$i][]=$LANG->getLL('hidden_pages');			$codeArr[$i][]=$admin->recStat['hidden'];			$i++;		}		$codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/deleted_page.gif','width="18" height="16"').' hspace="4" align="top">';		$codeArr[$i][]=$LANG->getLL('deleted_pages');		$codeArr[$i][]=$admin->recStat['deleted'];		$this->content.=$this->doc->section($LANG->getLL('pages'),$this->doc->table($codeArr),0,1);			// Doktype		$codeArr=Array();		$doktype= $TCA['pages']['columns']['doktype']['config']['items'];		if (is_array($doktype))	{			reset($doktype);			while(list($n,$setup) = each($doktype))	{				if ($setup[1]!='--div--')	{					$codeArr[$n][] = '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/'.($PAGES_TYPES[$setup[1]]['icon'] ? $PAGES_TYPES[$setup[1]]['icon'] : $PAGES_TYPES['default']['icon']),'width="18" height="16"').' hspace="4" align="top">';					$codeArr[$n][] = $LANG->sL($setup[0]).' ('.$setup[1].')';					$codeArr[$n][] = intval($admin->recStat[doktype][$setup[1]]);				}			}			$this->content.=$this->doc->section($LANG->getLL('doktype'),$this->doc->table($codeArr),0,1);		}			// Tables and lost records		$id_list = '-1,0,'.implode(array_keys($admin->page_idArray),',');		$id_list = t3lib_div::rm_endcomma($id_list);		$admin->lostRecords($id_list);		if ($admin->fixLostRecord(t3lib_div::_GET('fixLostRecords_table'),t3lib_div::_GET('fixLostRecords_uid')))	{			$admin = t3lib_div::makeInstance('t3lib_admin');			$admin->backPath = $BACK_PATH;			$admin->genTree(0,'');			$id_list = '-1,0,'.implode(array_keys($admin->page_idArray),',');			$id_list = t3lib_div::rm_endcomma($id_list);			$admin->lostRecords($id_list);		}		$codeArr = Array();		$countArr = $admin->countRecords($id_list);		if (is_array($TCA))	{			reset($TCA);			while(list($t)=each($TCA))	{				$codeArr[$t][]=t3lib_iconWorks::getIconImage($t,array(),$BACK_PATH,'hspace="4" align="top"');				$codeArr[$t][]=$LANG->sL($TCA[$t]['ctrl']['title']);				$codeArr[$t][]=$t;				if ($countArr['all'][$t])	{					$theNumberOfRe = intval($countArr['non_deleted'][$t]).'/'.(intval($countArr['all'][$t])-intval($countArr['non_deleted'][$t]));				} else {					$theNumberOfRe ='';				}				$codeArr[$t][]=$theNumberOfRe;				$lr='';				if (is_array($admin->lRecords[$t]))	{					reset($admin->lRecords[$t]);					while(list(,$data)=each($admin->lRecords[$t]))	{						if (!t3lib_div::inList($admin->lostPagesList,$data[pid]))	{							$lr.='<nobr><b><a href="index.php?SET[function]=records&fixLostRecords_table='.$t.'&fixLostRecords_uid='.$data[uid].'"><img src="'.$BACK_PATH.'gfx/required_h.gif" width="10" hspace="3" height="10" border="0" align="top" title="'.$LANG->getLL('fixLostRecord').'"></a>uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</b></nobr><br>';						} else {							$lr.='<nobr><img src="'.$BACK_PATH.'clear.gif" width="16" height="1" border="0"><font color="Gray">uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</font></nobr><br>';						}					}				}				$codeArr[$t][]=$lr;			}			$this->content.=$this->doc->section($LANG->getLL('tables'),$this->doc->table($codeArr),0,1);		}	}	/**	 * Show list references	 *	 * @return	void	 */	function func_relations()	{		global $LANG,$BACK_PATH;		$this->content.= $this->doc->header($LANG->getLL('relations'));		$this->content.= $this->doc->spacer(5);		$this->content.= $this->doc->section('',$this->menu);		$admin = t3lib_div::makeInstance('t3lib_admin');		$admin->genTree_makeHTML=0;		$admin->backPath = $BACK_PATH;		$fkey_arrays = $admin->getGroupFields('');		$admin->selectNonEmptyRecordsWithFkeys($fkey_arrays);		$fileTest = $admin->testFileRefs();		$code='';		if (is_array($fileTest['noReferences']))	{			while(list(,$val)=each($fileTest['noReferences']))	{				$code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b></nobr><br>';			}		}		$this->content.=$this->doc->section($LANG->getLL('files_no_ref'),$code,1,1);		$code='';		if (is_array($fileTest['moreReferences']))	{			while(list(,$val)=each($fileTest['moreReferences']))	{				$code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b>: '.$val[2].' references:</nobr><br>'.$val[3].'<br><br>';			}		}		$this->content.=$this->doc->section($LANG->getLL('files_many_ref'),$code,1,1);		$code='';		if (is_array($fileTest['noFile']))	{			ksort($fileTest['noFile']);			reset($fileTest['noFile']);			while(list(,$val)=each($fileTest['noFile']))	{				$code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b> is missing! </nobr><br>Referenced from: '.$val[2].'<br><br>';			}		}		$this->content.=$this->doc->section($LANG->getLL('files_no_file'),$code,1,1);		$this->content.=$this->doc->section($LANG->getLL('select_db'),$admin->testDBRefs($admin->checkSelectDBRefs),1,1);		$this->content.=$this->doc->section($LANG->getLL('group_db'),$admin->testDBRefs($admin->checkGroupDBRefs),1,1);	}	/**	 * Searching for files with a specific pattern	 *	 * @return	Searching		for files	 */	function func_filesearch()	{		global $LANG;		$this->content.= $this->doc->header($LANG->getLL('relations'));		$this->content.= $this->doc->spacer(5);		$this->content.= $this->doc->section('',$this->menu);		$pattern = t3lib_div::_GP('pattern');		$pcontent = 'Enter regex pattern: <input type="text" name="pattern" value="'.htmlspecialchars($pattern?$pattern:$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']).'"> <input type="submit" name="Search">';		$this->content.= $this->doc->section('Pattern',$pcontent,0,1);		if (strcmp($pattern,''))	{			$dirs = t3lib_div::get_dirs(PATH_site);	#		debug($dirs);			$lines=array();			$depth=10;			foreach ($dirs as $key => $value) {				$matching_files=array();				$info='';				if (!t3lib_div::inList('typo3,typo3conf,tslib,media,t3lib',$value))	{					$info = $this->findFile(PATH_site.$value.'/',$pattern,$matching_files,$depth);				}				if (is_array($info))	{					$lines[]='<hr><b>'.$value.'/</b> being checked...';					$lines[]='Dirs: '.$info[0];					if ($info[2])	$lines[]='<span class="typo3-red">ERROR: Directories deeper than '.$depth.' levels</span>';					$lines[]='Files: '.$info[1];					$lines[]='Matching files:<br><nobr><span class="typo3-red">'.implode('<br>',$matching_files).'</span></nobr>';				} else {					$lines[]=$GLOBALS['TBE_TEMPLATE']->dfw('<hr><b>'.$value.'/</b> not checked.');				}			}			$this->content.=$this->doc->section('Searching for filenames:',implode('<br>',$lines),0,1);		}	}	/**	 * Searching for filename pattern recursively in the specified dir.	 *	 * @param	string		Base directory	 * @param	string		Match pattern	 * @param	array		Array of matching files, passed by reference	 * @param	integer		Depth to recurse	 * @return	array		Array with various information about the search result	 * @see func_filesearch()	 */	function findFile($basedir,$pattern,&$matching_files,$depth)	{		$files_searched=0;		$dirs_searched=0;		$dirs_error=0;			// Traverse files:		$files = t3lib_div::getFilesInDir($basedir,'',1);		if (is_array($files))	{			$files_searched+=count($files);			foreach ($files as $value) {				if (eregi($pattern,basename($value)))	$matching_files[]=substr($value,strlen(PATH_site));			}		}			// Traverse subdirs		if ($depth>0)	{			$dirs = t3lib_div::get_dirs($basedir);			if (is_array($dirs))	{				$dirs_searched+=count($dirs);				foreach ($dirs as $value) {					$inf= $this->findFile($basedir.$value.'/',$pattern,$matching_files,$depth-1);					$dirs_searched+=$inf[0];					$files_searched+=$inf[1];					$dirs_error=$inf[2];				}			}		} else {			$dirs = t3lib_div::get_dirs($basedir);			if (is_array($dirs) && count($dirs))	{				$dirs_error=1;	// Means error - there were further subdirs!			}		}		return array($dirs_searched,$files_searched,$dirs_error);	}}// Include extension?if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/dbint/index.php'])	{	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/dbint/index.php']);}// Make instance:$SOBE = t3lib_div::makeInstance('SC_mod_tools_dbint_index');$SOBE->init();$SOBE->main();$SOBE->printContent();?>

⌨️ 快捷键说明

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