"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/lowlevel/class.tx_lowlevel_cleaner.php Source File", "datetime" => "Sat Dec 2 19:22:34 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com) 00006 * All rights reserved 00007 * 00008 * This script is part of the TYPO3 project. The TYPO3 project is 00009 * free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * The GNU General Public License can be found at 00015 * http://www.gnu.org/copyleft/gpl.html. 00016 * A copy is found in the textfile GPL.txt and important notices to the license 00017 * from the author is found in LICENSE.txt distributed with these scripts. 00018 * 00019 * 00020 * This script is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * This copyright notice MUST APPEAR in all copies of the script! 00026 ***************************************************************/ 00049 require_once(PATH_t3lib.'class.t3lib_extobjbase.php'); 00050 require_once(t3lib_extMgm::extPath('lowlevel').'class.tx_lowlevel_cleaner_core.php'); 00051 00052 00053 00054 00055 00056 00057 00065 class tx_lowlevel_cleaner extends t3lib_extobjbase { 00066 00067 00074 function modMenu() { 00075 global $LANG; 00076 00077 $modMenuAdd = array( 00078 'tx_lowlevel_cleaner' => array( 00079 # 'delete_flush' => 'Flush "deleted" records', // ID/depth related 00080 # 'delete_restore' => 'Restore "deleted" records', // ID/depth related 00081 # 'versions_flush' => 'Flush published versions', // ID/depth related 00082 00083 # 'clean_flexform_xml' => 'Clean up FlexForm XML', // ID/depth related 00084 # tt_content element removal: templavoila plugin! // ID/depth related 00085 # Check for various: uid>0, pid>-1 , lost swapping operations, 00086 # 'l10n_duplicates' => 'Localization errors', 00087 # Find TCA/FlexForm fields which should probably have a soft reference parser attached! 00088 00089 # TemplaVoila plugs in to display mapping issues. 00090 # Overview of http:// and emails // UPDATE index! 00091 00092 'missing_files' => 'Missing files', // UPDATE index! 00093 'missing_relations' => 'Missing relations', // UPDATE index! 00094 # 'lost_records' => 'Orphan records', 00095 'lost_files' => 'Orphan files (from uploads/)', // UPDATE index! 00096 'RTEmagic_files' => 'RTE Magic Images', // UPDATE index! 00097 'double_files' => 'Double file references', // UPDATE index! 00098 ) 00099 ); 00100 00101 return $modMenuAdd; 00102 } 00103 00109 function main() { 00110 global $BE_USER; 00111 00112 $content = ''; 00113 00114 if ($BE_USER->isAdmin()) { 00115 $content.= $this->pObj->doc->spacer(5); 00116 $content.= $this->createMenu().'<hr/>'; 00117 $content.= $this->moduleContent(); 00118 } else { 00119 $content.= $this->pObj->doc->spacer(5); 00120 $content.= 'Only access for admin users, sorry.'; 00121 } 00122 return $content; 00123 } 00124 00130 function createMenu() { 00131 if (is_array($this->pObj->MOD_MENU['tx_lowlevel_cleaner'])) { 00132 $menu = ''; 00133 foreach($this->pObj->MOD_MENU['tx_lowlevel_cleaner'] as $key => $value) { 00134 $menu.='<a href="index.php?id='.intval(t3lib_div::_GP('id')).'&tx_lowlevel_cleaner='.$key.'">'.htmlspecialchars($value).'</a><br/>'; 00135 } 00136 return $menu; 00137 } 00138 } 00139 00145 function moduleContent() { 00146 $cleanerObj = t3lib_div::makeInstance('tx_lowlevel_cleaner_core'); 00147 $silent = FALSE; 00148 $filter = 0; 00149 00150 switch(t3lib_div::_GP('tx_lowlevel_cleaner')) { 00151 case 'lost_files': 00152 $res = $cleanerObj->clean_lost_files_analyze(); 00153 $output = $cleanerObj->html_printInfo('clean_lost_files_analyze()',$res,$silent,$filter); 00154 break; 00155 case 'RTEmagic_files': 00156 $res = $cleanerObj->RTEmagic_files_analyze(); 00157 $output = $cleanerObj->html_printInfo('RTEmagic_files_analyze()',$res,$silent,$filter); 00158 break; 00159 case 'double_files': 00160 $res = $cleanerObj->double_files_analyze(); 00161 $output = $cleanerObj->html_printInfo('double_files_analyze()',$res,$silent,$filter); 00162 break; 00163 case 'missing_files': 00164 $res = $cleanerObj->missing_files_analyze(); 00165 $output = $cleanerObj->html_printInfo('missing_files_analyze()',$res,$silent,$filter); 00166 break; 00167 case 'missing_relations': 00168 $res = $cleanerObj->missing_relations_analyze(); 00169 $output = $cleanerObj->html_printInfo('missing_relations_analyze()',$res,$silent,$filter); 00170 break; 00171 } 00172 00173 /* 00174 // TEST of how we can get the used Content Elements on a TemplaVoila page: 00175 require_once(t3lib_extMgm::extPath('templavoila').'class.tx_templavoila_api.php'); 00176 $apiClassName = t3lib_div::makeInstanceClassName('tx_templavoila_api'); 00177 $apiObj = new $apiClassName('pages'); 00178 $contentTreeData = $apiObj->getContentTree('pages', t3lib_BEfunc::getRecordWSOL('pages',33),FALSE); 00179 debug($contentTreeData); 00180 */ 00181 return $output; 00182 } 00183 } 00184 00185 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/class.tx_lowlevel_cleaner.php']) { 00186 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/class.tx_lowlevel_cleaner.php']); 00187 } 00188 ?>