66 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lowlevel/dbint/locallang.xlf');
82 $this->doc->setModuleTemplate(
'EXT:lowlevel/Resources/Private/Templates/dbint.html');
83 $this->doc->form =
'<form action="" method="post" name="' . $this->formName .
'">';
84 $this->doc->table_TABLE =
'<table class="t3-table"> 85 <colgroup><col width="24"><col><col width="150"></colgroup>';
86 $this->doc->tableLayout = array(
88 'tr' => array(
'<thead><tr>',
'</tr></thead>'),
89 'defCol' => array(
'<th>',
'</th>')
92 'defCol' => array(
'<td>',
'</td>')
109 $this->MOD_MENU = array(
111 0 =>
$GLOBALS[
'LANG']->getLL(
'menu', TRUE),
112 'records' =>
$GLOBALS[
'LANG']->getLL(
'recordStatistics', TRUE),
113 'relations' =>
$GLOBALS[
'LANG']->getLL(
'databaseRelations', TRUE),
114 'search' =>
$GLOBALS[
'LANG']->getLL(
'fullSearch', TRUE),
115 'refindex' =>
$GLOBALS[
'LANG']->getLL(
'manageRefIndex', TRUE)
118 'raw' =>
$GLOBALS[
'LANG']->getLL(
'rawSearch', TRUE),
119 'query' =>
$GLOBALS[
'LANG']->getLL(
'advancedQuery', TRUE)
121 'search_query_smallparts' =>
'',
122 'search_result_labels' =>
'',
123 'labels_noprefix' =>
'',
124 'options_sortlabel' =>
'',
125 'show_deleted' =>
'',
136 'queryOrderDesc' =>
'',
140 'queryOrder2Desc' =>
'',
146 'storeQueryConfigs' =>
'',
148 'search_query_makeQuery' => array(
149 'all' =>
$GLOBALS[
'LANG']->getLL(
'selectRecords', TRUE),
150 'count' =>
$GLOBALS[
'LANG']->getLL(
'countResults', TRUE),
151 'explain' =>
$GLOBALS[
'LANG']->getLL(
'explainQuery', TRUE),
152 'csv' =>
$GLOBALS[
'LANG']->getLL(
'csvExport', TRUE)
164 foreach ($OLD_MOD_SETTINGS as $key => $val) {
165 if (substr($key, 0, 5) ==
'query' && $this->MOD_SETTINGS[$key] != $val && $key !=
'queryLimit' && $key !=
'use_listview') {
166 $setLimitToStart = 1;
167 if ($key ==
'queryTable' && !$addConditionCheck) {
168 $this->MOD_SETTINGS[
'queryConfig'] =
'';
171 if ($key ==
'queryTable' && $this->MOD_SETTINGS[$key] != $val) {
172 $this->MOD_SETTINGS[
'queryFields'] =
'';
175 if ($setLimitToStart) {
176 $currentLimit = explode(
',', $this->MOD_SETTINGS[
'queryLimit']);
177 if ($currentLimit[1]) {
178 $this->MOD_SETTINGS[
'queryLimit'] =
'0,' . $currentLimit[1];
180 $this->MOD_SETTINGS[
'queryLimit'] =
'0';
194 if (!
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableTopMenu']) {
197 switch ($this->MOD_SETTINGS[
'function']) {
202 $this->func_records();
216 'CSH' => $docHeaderButtons[
'csh'],
218 'CONTENT' => $this->content
221 $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
223 $this->content = $this->doc->render(
$GLOBALS[
'LANG']->getLL(
'title'), $this->content);
247 if (
$GLOBALS[
'BE_USER']->mayMakeShortcut()) {
248 $buttons[
'shortcut'] = $this->doc->makeShortcutIcon(
'',
'function,search,search_query_makeQuery', $this->MCONF[
'name']);
259 if (!
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableTopMenu']) {
271 $availableModFuncs = array(
'records',
'relations',
'search',
'refindex');
272 $content =
'<dl class="t3-overview-list">';
273 foreach ($availableModFuncs as $modFunc) {
275 $title =
$GLOBALS[
'LANG']->getLL($modFunc);
276 $description =
$GLOBALS[
'LANG']->getLL($modFunc .
'_description');
279 <dt><a href="' . htmlspecialchars($functionUrl) .
'">' . $icon . $title .
'</a></dt> 280 <dd>' . $description .
'</dd> 284 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'title'));
285 $this->content .= $this->doc->section(
'',
$content, FALSE, TRUE);
300 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'manageRefIndex', TRUE));
305 list($headerContent, $bodyContent) = $refIndexObj->updateIndex($testOnly);
307 $this->content .= $this->doc->section(
'', str_replace(LF,
'<br/>', $bodyContent), FALSE, TRUE);
311 $content =
'<p class="lead">' .
$GLOBALS[
'LANG']->getLL(
'referenceIndex_description') .
'</p>';
312 $content .=
'<input type="submit" name="_check" value="' .
$GLOBALS[
'LANG']->getLL(
'referenceIndex_buttonCheck') .
'" /> <input type="submit" name="_update" value="' .
$GLOBALS[
'LANG']->getLL(
'referenceIndex_buttonUpdate') .
'" /><br /><br />';
313 $this->content .= $this->doc->section(
'',
$content, FALSE, TRUE);
319 $content .=
'<h3>' .
$GLOBALS[
'LANG']->getLL(
'checkScript_check_description') .
'</h3>';
320 $content .=
'<p><code>php ' . PATH_typo3 .
'cli_dispatch.phpsh lowlevel_refindex -c</code></p>';
322 $content .=
'<h3>' .
$GLOBALS[
'LANG']->getLL(
'checkScript_update_description') .
'</h3>';
323 $content .=
'<p><code>php ' . PATH_typo3 .
'cli_dispatch.phpsh lowlevel_refindex -e</code></p>';
324 $content .=
'<div class="typo3-message message-information"><div class="message-body">' .
$GLOBALS[
'LANG']->getLL(
'checkScript_information') .
'</div></div>';
326 $content .=
'<p>' .
$GLOBALS[
'LANG']->getLL(
'checkScript_moreDetails') .
'<br />';
327 $content .=
'<a href="' .
$GLOBALS[
'BACK_PATH'] .
'sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt" target="_new">' . PATH_typo3 .
'sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt</a></p>';
328 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'checkScript_headline'),
$content, FALSE, TRUE);
340 $fullsearch->setFormName($this->formName);
341 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'search'));
342 $this->content .= $this->doc->spacer(5);
344 if (!
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableTopMenu']) {
347 if ($this->MOD_SETTINGS[
'search'] ==
'query' && !
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableTopMenu']) {
348 $menu2 .=
BackendUtility::getFuncMenu(0,
'SET[search_query_makeQuery]', $this->MOD_SETTINGS[
'search_query_makeQuery'], $this->MOD_MENU[
'search_query_makeQuery']) .
'<br />';
350 if (!
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableTopCheckboxes'] && $this->MOD_SETTINGS[
'search'] ==
'query') {
351 $menu2 .=
BackendUtility::getFuncCheck(
$GLOBALS[
'SOBE']->
id,
'SET[search_query_smallparts]', $this->MOD_SETTINGS[
'search_query_smallparts'],
'',
'',
'id="checkSearch_query_smallparts"') .
' <label for="checkSearch_query_smallparts">' .
$GLOBALS[
'LANG']->getLL(
'showSQL') .
'</label><br />';
352 $menu2 .=
BackendUtility::getFuncCheck(
$GLOBALS[
'SOBE']->
id,
'SET[search_result_labels]', $this->MOD_SETTINGS[
'search_result_labels'],
'',
'',
'id="checkSearch_result_labels"') .
' <label for="checkSearch_result_labels">' .
$GLOBALS[
'LANG']->getLL(
'useFormattedStrings') .
'</label><br />';
353 $menu2 .=
BackendUtility::getFuncCheck(
$GLOBALS[
'SOBE']->
id,
'SET[labels_noprefix]', $this->MOD_SETTINGS[
'labels_noprefix'],
'',
'',
'id="checkLabels_noprefix"') .
' <label for="checkLabels_noprefix">' .
$GLOBALS[
'LANG']->getLL(
'dontUseOrigValues') .
'</label><br />';
354 $menu2 .=
BackendUtility::getFuncCheck(
$GLOBALS[
'SOBE']->
id,
'SET[options_sortlabel]', $this->MOD_SETTINGS[
'options_sortlabel'],
'',
'',
'id="checkOptions_sortlabel"') .
' <label for="checkOptions_sortlabel">' .
$GLOBALS[
'LANG']->getLL(
'sortOptions') .
'</label><br />';
355 $menu2 .=
BackendUtility::getFuncCheck(
$GLOBALS[
'SOBE']->
id,
'SET[show_deleted]', $this->MOD_SETTINGS[
'show_deleted'],
'',
'',
'id="checkShow_deleted"') .
' <label for="checkShow_deleted">' .
$GLOBALS[
'LANG']->getLL(
'showDeleted') .
'</label>';
357 $this->content .= $this->doc->section(
'', $menu2) . $this->doc->spacer(10);
358 switch ($this->MOD_SETTINGS[
'search']) {
360 $this->content .= $fullsearch->queryMaker();
365 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'searchOptions'), $fullsearch->form(), FALSE, TRUE);
366 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'result'), $fullsearch->search(), FALSE, TRUE);
376 public function func_records() {
379 $admin->genTree_makeHTML = 0;
380 $admin->backPath =
$GLOBALS[
'BACK_PATH'];
381 $admin->genTree(0,
'');
382 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'records'));
386 $codeArr[
'tableheader'] = array(
'',
'',
$GLOBALS[
'LANG']->getLL(
'count'));
389 $codeArr[$i][] =
$GLOBALS[
'LANG']->getLL(
'total_pages');
390 $codeArr[$i][] = count($admin->page_idArray);
393 $codeArr[$i][] =
$GLOBALS[
'LANG']->getLL(
'hidden_pages');
394 $codeArr[$i][] = $admin->recStats[
'hidden'];
397 $codeArr[$i][] =
$GLOBALS[
'LANG']->getLL(
'deleted_pages');
398 $codeArr[$i][] = count($admin->recStats[
'deleted'][
'pages']);
399 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'pages'), $this->doc->table($codeArr), TRUE, TRUE);
403 $codeArr[
'tableheader'] = array(
'',
$GLOBALS[
'LANG']->getLL(
'doktype_value'),
$GLOBALS[
'LANG']->getLL(
'count'));
404 $doktype =
$GLOBALS[
'TCA'][
'pages'][
'columns'][
'doktype'][
'config'][
'items'];
405 if (is_array($doktype)) {
406 foreach ($doktype as $n => $setup) {
407 if ($setup[1] !=
'--div--') {
409 $codeArr[$n][] =
$GLOBALS[
'LANG']->sL($setup[0]) .
' (' . $setup[1] .
')';
410 $codeArr[$n][] = (int)$admin->recStats[
'doktype'][$setup[1]];
413 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'doktype'), $this->doc->table($codeArr), TRUE, TRUE);
417 $id_list =
'-1,0,' . implode(
',', array_keys($admin->page_idArray));
418 $id_list = rtrim($id_list,
',');
419 $admin->lostRecords($id_list);
423 $admin->genTree(0,
'');
424 $id_list =
'-1,0,' . implode(
',', array_keys($admin->page_idArray));
425 $id_list = rtrim($id_list,
',');
426 $admin->lostRecords($id_list);
429 $codeArr[
'tableheader'] = array(
432 $GLOBALS[
'LANG']->getLL(
'tablename'),
433 $GLOBALS[
'LANG']->getLL(
'total_lost'),
436 $countArr = $admin->countRecords($id_list);
438 foreach (
$GLOBALS[
'TCA'] as $t => $value) {
439 if (
$GLOBALS[
'TCA'][$t][
'ctrl'][
'hideTable']) {
443 $codeArr[$t][] =
$GLOBALS[
'LANG']->sL(
$GLOBALS[
'TCA'][$t][
'ctrl'][
'title']);
445 if ($t ===
'pages' && $admin->lostPagesList !==
'') {
446 $lostRecordCount = count(explode(
',', $admin->lostPagesList));
448 $lostRecordCount = count($admin->lRecords[$t]);
450 if ($countArr[
'all'][$t]) {
451 $theNumberOfRe = (int)$countArr[
'non_deleted'][$t] .
'/' . $lostRecordCount;
455 $codeArr[$t][] = $theNumberOfRe;
457 if (is_array($admin->lRecords[$t])) {
458 foreach ($admin->lRecords[$t] as $data) {
460 $lr .=
'<nobr><strong><a href="' . htmlspecialchars((
BackendUtility::getModuleUrl(
'system_dbint') .
'&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="' .
$GLOBALS[
'LANG']->getLL(
'fixLostRecord') .
'"></a>uid:' . $data[
'uid'] .
', pid:' . $data[
'pid'] .
', ' . htmlspecialchars(
GeneralUtility::fixed_lgd_cs(strip_tags($data[
'title']), 20)) .
'</strong></nobr><br>';
462 $lr .=
'<nobr><img src="' .
$BACK_PATH .
'clear.gif" width="16" height="1" border="0"><font color="Gray">uid:' . $data[
'uid'] .
', pid:' . $data[
'pid'] .
', ' . htmlspecialchars(
GeneralUtility::fixed_lgd_cs(strip_tags($data[
'title']), 20)) .
'</font></nobr><br>';
466 $codeArr[$t][] = $lr;
468 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'tables'), $this->doc->table($codeArr), FALSE, TRUE);
480 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'relations'));
482 $admin->genTree_makeHTML = 0;
484 $fkey_arrays = $admin->getGroupFields(
'');
485 $admin->selectNonEmptyRecordsWithFkeys($fkey_arrays);
486 $fileTest = $admin->testFileRefs();
489 if (is_array($fileTest[
'noReferences'])) {
490 foreach ($fileTest[
'noReferences'] as $val) {
491 $code .=
'<nobr>' . $val[0] .
'/<strong>' . $val[1] .
'</strong></nobr><br>';
494 $code =
'<p>' .
$GLOBALS[
'LANG']->getLL(
'no_files_found') .
'</p>';
496 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'files_no_ref'), $code, TRUE, TRUE);
499 if (is_array($fileTest[
'moreReferences'])) {
500 foreach ($fileTest[
'moreReferences'] as $val) {
501 $code .=
'<nobr>' . $val[0] .
'/<strong>' . $val[1] .
'</strong>: ' . $val[2] .
' ' .
$GLOBALS[
'LANG']->getLL(
'references') .
'</nobr><br>' . $val[3] .
'<br><br>';
504 $code =
'<p>' .
$GLOBALS[
'LANG']->getLL(
'no_files_found') .
'</p>';
506 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'files_many_ref'), $code, TRUE, TRUE);
509 if (is_array($fileTest[
'noFile'])) {
510 ksort($fileTest[
'noFile']);
511 foreach ($fileTest[
'noFile'] as $val) {
512 $code .=
'<nobr>' . $val[0] .
'/<strong>' . $val[1] .
'</strong> ' .
$GLOBALS[
'LANG']->getLL(
'isMissing') .
' </nobr><br>' .
$GLOBALS[
'LANG']->getLL(
'referencedFrom') . $val[2] .
'<br><br>';
515 $code =
'<p>' .
$GLOBALS[
'LANG']->getLL(
'no_files_found') .
'</p>';
518 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'files_no_file'), $code, TRUE, TRUE);
519 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'select_db'), $admin->testDBRefs($admin->checkSelectDBRefs), TRUE, TRUE);
520 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'group_db'), $admin->testDBRefs($admin->checkGroupDBRefs), TRUE, TRUE);
543 public function findFile($basedir, $pattern, &$matching_files, $depth) {
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static getFuncCheck($mainParams, $elementName, $currentValue, $script='', $addParams='', $tagParams='')
static logDeprecatedFunction()
static makeInstance($className)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
findFile($basedir, $pattern, &$matching_files, $depth)
static getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
static getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
static fixed_lgd_cs($string, $chars, $appendString='...')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)