[!!!][TASK] Remove old BE implementation of indexed_search 38/35338/6
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 13 Dec 2014 23:56:36 +0000 (00:56 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 15 Dec 2014 12:20:34 +0000 (13:20 +0100)
The old code can be removed as the new module has been merged.

The breaking change is already documented in the file
'Breaking-61510-IndexedSearch.rst'

Change-Id: Ief1867cbaa2f0768e3e8c08c490e64963b91a06c
Resolves: #61638
Releases: master
Reviewed-on: http://review.typo3.org/35338
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
12 files changed:
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/indexed_search/Classes/Controller/IndexedPagesController.php [deleted file]
typo3/sysext/indexed_search/Classes/Controller/IndexingStatisticsController.php [deleted file]
typo3/sysext/indexed_search/Classes/Controller/ModuleController.php [deleted file]
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/indexed_search/ext_tables.php
typo3/sysext/indexed_search/mod/clear.gif [deleted file]
typo3/sysext/indexed_search/mod/conf.php [deleted file]
typo3/sysext/indexed_search/mod/index.php [deleted file]
typo3/sysext/indexed_search/mod/isearch.gif [deleted file]
typo3/sysext/indexed_search/mod/mod_template.html [deleted file]

index cd74a1f..73f81c8 100644 (file)
@@ -1028,9 +1028,6 @@ return array(
        'tx_impexp' => \TYPO3\CMS\Impexp\ImportExport::class,
        'tx_impexp_localPageTree' => \TYPO3\CMS\Impexp\LocalPageTree::class,
        'tx_impexp_task' => \TYPO3\CMS\Impexp\Task\ImportExportTask::class,
-       'tx_indexedsearch_modfunc1' => \TYPO3\CMS\IndexedSearch\Controller\IndexedPagesController::class,
-       'tx_indexedsearch_modfunc2' => \TYPO3\CMS\IndexedSearch\Controller\IndexingStatisticsController::class,
-       'SC_mod_tools_isearch_index' => \TYPO3\CMS\IndexedSearch\Controller\ModuleController::class,
        'Tx_IndexedSearch_Controller_SearchController' => \TYPO3\CMS\IndexedSearch\Controller\SearchController::class,
        'tx_indexedsearch' => \TYPO3\CMS\IndexedSearch\Controller\SearchFormController::class,
        'Tx_IndexedSearch_Domain_Repository_IndexSearchRepository' => \TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository::class,
index 1b0c302..a7bc70c 100644 (file)
@@ -5124,21 +5124,6 @@ class tx_impexp_task extends \TYPO3\CMS\Impexp\Task\ImportExportTask {}
 /**
  * @deprecated since 6.0, removed since 7.0
  */
-class tx_indexedsearch_modfunc1 extends \TYPO3\CMS\IndexedSearch\Controller\IndexedPagesController {}
-
-/**
- * @deprecated since 6.0, removed since 7.0
- */
-class tx_indexedsearch_modfunc2 extends \TYPO3\CMS\IndexedSearch\Controller\IndexingStatisticsController {}
-
-/**
- * @deprecated since 6.0, removed since 7.0
- */
-class SC_mod_tools_isearch_index extends \TYPO3\CMS\IndexedSearch\Controller\ModuleController {}
-
-/**
- * @deprecated since 6.0, removed since 7.0
- */
 class Tx_IndexedSearch_Controller_SearchController extends \TYPO3\CMS\IndexedSearch\Controller\SearchController {}
 
 /**
diff --git a/typo3/sysext/indexed_search/Classes/Controller/IndexedPagesController.php b/typo3/sysext/indexed_search/Classes/Controller/IndexedPagesController.php
deleted file mode 100644 (file)
index 20ce2a2..0000000
+++ /dev/null
@@ -1,1027 +0,0 @@
-<?php
-namespace TYPO3\CMS\IndexedSearch\Controller;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Indexing class for TYPO3 frontend
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class IndexedPagesController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule {
-
-       // Internal, dynamic:
-       public $allPhashListed = array();
-
-       // phash values accumulations for link to clear all
-       public $external_parsers = array();
-
-       // External content parsers - objects set here with file extensions as keys.
-       public $iconFileNameCache = array();
-
-       // File extensions - icon map/cache.
-       public $indexerConfig = array();
-
-       // Indexer configuration, coming from $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']
-       public $enableMetaphoneSearch = FALSE;
-
-       /**
-        * Indexer object
-        *
-        * @var \TYPO3\CMS\IndexedSearch\Indexer
-        */
-       public $indexerObj;
-
-       /**
-        * @int Default number of list entries per page
-        */
-       protected $maxListPerPage;
-
-       /**
-        * Default constructor loads additional locallang
-        */
-       public function __construct() {
-               $GLOBALS['LANG']->includeLLFile('EXT:indexed_search/modfunc1/locallang.xlf');
-       }
-
-       /**
-        * Initialize menu array internally
-        *
-        * @return void
-        */
-       public function modMenu() {
-               return array(
-                       'depth' => array(
-                               0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
-                               1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
-                               2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
-                               3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
-                               999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
-                       ),
-                       'type' => array(
-                               0 => 'Overview',
-                               1 => 'Technical Details',
-                               2 => 'Words and content'
-                       )
-               );
-       }
-
-       /**
-        * Produces main content of the module
-        *
-        * @return string HTML output
-        */
-       public function main() {
-               // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
-               // Return if no page id:
-               if ($this->pObj->id <= 0) {
-                       return;
-               }
-               // Indexer configuration from Extension Manager interface:
-               $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
-               // Workaround: If the extension configuration was not updated yet, the value is not existing
-               $this->enableMetaphoneSearch = isset($this->indexerConfig['enableMetaphoneSearch']) ? ($this->indexerConfig['enableMetaphoneSearch'] ? TRUE : FALSE) : TRUE;
-               // Initialize max-list items
-               $this->maxListPerPage = GeneralUtility::_GP('listALL') ? 100000 : 100;
-               // Processing deletion of phash rows:
-               if (GeneralUtility::_GP('deletePhash')) {
-                       $this->removeIndexedPhashRow(GeneralUtility::_GP('deletePhash'));
-               }
-               // Processing stop-words:
-               if (GeneralUtility::_POST('_stopwords')) {
-                       $this->processStopWords(GeneralUtility::_POST('stopWord'));
-               }
-               // Processing stop-words:
-               if (GeneralUtility::_POST('_pageKeywords')) {
-                       $this->processPageKeywords(GeneralUtility::_POST('pageKeyword'), GeneralUtility::_POST('pageKeyword_pageUid'));
-               }
-               // Initialize external document parsers:
-               // Example configuration, see ext_localconf.php of this file!
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef) {
-                               $this->external_parsers[$extension] = GeneralUtility::getUserObj($_objRef);
-                               // Init parser and if it returns FALSE, unset its entry again:
-                               if (!$this->external_parsers[$extension]->softInit($extension)) {
-                                       unset($this->external_parsers[$extension]);
-                               }
-                       }
-               }
-               // Initialize indexer if we need it (metaphone display does...)
-               $this->indexerObj = GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class);
-               // Set CSS styles specific for this document:
-               $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', '
-                       TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
-               ', $this->pObj->content);
-               // Check if details for a phash record should be shown:
-               if (GeneralUtility::_GET('phash')) {
-                       // Show title / function menu:
-                       $theOutput .= $this->pObj->doc->spacer(5);
-                       $theOutput .= $this->pObj->doc->section('Details for a single result row:', $this->showDetailsForPhash(GeneralUtility::_GET('phash')), 0, 1);
-               } elseif (GeneralUtility::_GET('wid')) {
-                       // Show title / function menu:
-                       $theOutput .= $this->pObj->doc->spacer(5);
-                       $theOutput .= $this->pObj->doc->section('Details for a word:', $this->showDetailsForWord(GeneralUtility::_GET('wid')), 0, 1);
-               } elseif ($this->enableMetaphoneSearch && GeneralUtility::_GET('metaphone')) {
-                       // Show title / function menu:
-                       $theOutput .= $this->pObj->doc->spacer(5);
-                       $theOutput .= $this->pObj->doc->section('Details for metaphone value:', $this->showDetailsForMetaphone(GeneralUtility::_GET('metaphone')), 0, 1);
-               } elseif (GeneralUtility::_GET('reindex')) {
-                       // Show title / function menu:
-                       $theOutput .= $this->pObj->doc->spacer(5);
-                       $theOutput .= $this->pObj->doc->section('Reindexing...', $this->reindexPhash(GeneralUtility::_GET('reindex'), GeneralUtility::_GET('reindex_id')), 0, 1);
-               } else {
-                       // Detail listings:
-                       // Depth function menu:
-                       $h_func = BackendUtility::getFuncMenu($this->pObj->id, 'SET[type]', $this->pObj->MOD_SETTINGS['type'], $this->pObj->MOD_MENU['type']);
-                       $h_func .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
-                       // Show title / function menu:
-                       $theOutput .= $this->pObj->doc->header($GLOBALS['LANG']->getLL('title'));
-                       $theOutput .= $this->pObj->doc->section('', $h_func, 0, 1);
-                       $theOutput .= $this->drawTableOfIndexedPages();
-               }
-               return $theOutput;
-       }
-
-       /*******************************
-        *
-        * Drawing table of indexed pages
-        *
-        ******************************/
-       /**
-        * Produces a table with indexing information for each page.
-        *
-        * @return string HTML output
-        */
-       public function drawTableOfIndexedPages() {
-               // Drawing tree:
-               $tree = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class);
-               $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-               $tree->init('AND ' . $perms_clause);
-               $HTML = '<img src="' . $GLOBALS['BACK_PATH'] . \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('pages', $this->pObj->pageinfo) . '" width="18" height="16" align="top" alt="" />';
-               $tree->tree[] = array(
-                       'row' => $this->pObj->pageinfo,
-                       'HTML' => $HTML
-               );
-               if ($this->pObj->MOD_SETTINGS['depth']) {
-                       $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
-               }
-               // Traverse page tree:
-               $code = '';
-               foreach ($tree->tree as $data) {
-                       $code .= $this->indexed_info($data['row'], $data['HTML'] . $this->showPageDetails(
-                                       BackendUtility::getRecordTitlePrep($data['row']['title']), $data['row']['uid']));
-               }
-               if ($code) {
-                       $code = '<br /><br />
-                                       <table border="0" cellspacing="1" cellpadding="2" class="c-list">' . $this->printPhashRowHeader() . $code . '</table>';
-                       // Create section to output:
-                       $theOutput .= $this->pObj->doc->section('', $code, 0, 1);
-               } else {
-                       $theOutput .= $this->pObj->doc->section('', '<br /><br />' . $this->pObj->doc->icons(1) . 'There were no indexed pages found in the tree.<br /><br />', 0, 1);
-               }
-               return $theOutput;
-       }
-
-       /**
-        * Create information table row for a page regarding indexing information.
-        *
-        * @param array Data array for this page
-        * @param string HTML content for first column (page tree icon etc.)
-        * @return string HTML code. (table row)
-        */
-       public function indexed_info($data, $firstColContent) {
-               // Query:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ISEC.phash_t3, ISEC.rl0, ISEC.rl1, ISEC.rl2, ISEC.page_id, ISEC.uniqid, ' . 'IP.phash, IP.phash_grouping, IP.cHashParams, IP.data_filename, IP.data_page_id, ' . 'IP.data_page_reg1, IP.data_page_type, IP.data_page_mp, IP.gr_list, IP.item_type, ' . 'IP.item_title, IP.item_description, IP.item_mtime, IP.tstamp, IP.item_size, ' . 'IP.contentHash, IP.crdate, IP.parsetime, IP.sys_language_uid, IP.item_crdate, ' . 'IP.externalUrl, IP.recordUid, IP.freeIndexUid, IP.freeIndexSetId, count(*) AS count_val', 'index_phash IP, index_section ISEC', 'IP.phash = ISEC.phash AND ISEC.page_id = ' . (int)$data['uid'], 'IP.phash,IP.phash_grouping,IP.cHashParams,IP.data_filename,IP.data_page_id,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2,ISEC.page_id,ISEC.uniqid,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', 'IP.item_type, IP.tstamp', $this->maxListPerPage + 1);
-               // Initialize variables:
-               $rowCount = 0;
-               $lines = array();
-               // Collecting HTML rows here.
-               $phashAcc = array();
-               // Collecting phash values (to remove local indexing for)
-               $phashAcc[] = 0;
-               // Traverse the result set of phash rows selected:
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       if ($rowCount == $this->maxListPerPage) {
-                               $rowCount++;
-                               // Increase to the extra warning row will appear as well.
-                               break;
-                       }
-                       // Adds a display row:
-                       $lines[$row['phash_grouping']][] = $this->printPhashRow($row, isset($lines[$row['phash_grouping']]), $this->getGrListEntriesForPhash($row['phash'], $row['gr_list']));
-                       $rowCount++;
-                       $phashAcc[] = $row['phash'];
-                       $this->allPhashListed[] = $row['phash'];
-               }
-               // Compile rows into the table:
-               $out = '';
-               $cellAttrib = $data['_CSSCLASS'] ? ' class="' . $data['_CSSCLASS'] . '"' : '';
-               if (count($lines)) {
-                       $firstColContent = '<td rowspan="' . $rowCount . '"' . $cellAttrib . '>' . $firstColContent . '</td>';
-                       foreach ($lines as $rowSet) {
-                               foreach ($rowSet as $rows) {
-                                       $out .= '
-                                               <tr class="bgColor-20">' . $firstColContent . implode('', $rows) . '</tr>';
-                                       $firstColContent = '';
-                               }
-                       }
-                       if ($rowCount > $this->maxListPerPage) {
-                               // Now checking greater than, because we increased $rowCount before...
-                               $out .= '
-                               <tr class="bgColor-20">
-                                       <td>&nbsp;</td>
-                                       <td colspan="' . ($this->returnNumberOfColumns() - 1) . '">' . $this->pObj->doc->icons(3) . '<span class="">There were more than ' . $this->maxListPerPage . ' rows. <a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_info', array('id' => $this->pObj->id, 'listAll' => 1))) . '">Click here to list them ALL!</a></span></td>
-                               </tr>';
-                       }
-               } else {
-                       $out .= '
-                               <tr class="bgColor-20">
-                                       <td' . $cellAttrib . '>' . $firstColContent . '</td>
-                                       <td colspan="' . ($this->returnNumberOfColumns() - 1) . '"><em>Not indexed</em></td>
-                               </tr>';
-               }
-               // Checking for phash-rows which are NOT joined with the section table:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('IP.*', 'index_phash IP', 'IP.data_page_id = ' . (int)$data['uid'] . ' AND IP.phash NOT IN (' . implode(',', $phashAcc) . ')');
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $out .= '
-                               <tr class="typo3-red">
-                                       <td colspan="' . $this->returnNumberOfColumns() . '"><strong>Warning:</strong> phash-row "' . $row['phash'] . '" didn\'t have a representation in the index_section table!</td>
-                               </tr>';
-                       $this->allPhashListed[] = $row['phash'];
-               }
-               return $out;
-       }
-
-       /**
-        * Render a single row of information about a indexing entry.
-        *
-        * @param array Row from query (combined phash table with sections etc).
-        * @param bool Set if grouped to previous result; the icon of the element is not shown again.
-        * @param array Array of index_grlist records.
-        * @return array Array of table rows.
-        * @see indexed_info()
-        */
-       public function printPhashRow($row, $grouping = 0, $extraGrListRows) {
-               $lines = array();
-               // Title cell attributes will highlight TYPO3 pages with a slightly darker color (bgColor4) than attached medias. Also IF there are more than one section record for a phash row it will be red as a warning that something is wrong!
-               $titleCellAttribs = $row['count_val'] != 1 ? ' bgcolor="red"' : ($row['item_type'] === '0' ? ' class="bgColor4"' : '');
-               if ($row['item_type']) {
-                       $arr = unserialize($row['cHashParams']);
-                       $page = $arr['key'] ? ' [' . $arr['key'] . ']' : '';
-               } else {
-                       $page = '';
-               }
-               $elTitle = $this->linkDetails($row['item_title'] ? htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['item_title'], 20) . $page) : '<em>[No Title]</em>', $row['phash']);
-               $cmdLinks = $this->printRemoveIndexed($row['phash'], 'Clear phash-row') . $this->printReindex($row, 'Re-index element');
-               switch ($this->pObj->MOD_SETTINGS['type']) {
-                       case 1:
-                               // Technical details:
-                               // Display icon:
-                               if (!$grouping) {
-                                       $lines[] = '<td>' . $this->makeItemTypeIcon($row['item_type'], ($row['data_filename'] ? $row['data_filename'] : $row['item_title'])) . '</td>';
-                               } else {
-                                       $lines[] = '<td>&nbsp;</td>';
-                               }
-                               // Title displayed:
-                               $lines[] = '<td' . $titleCellAttribs . '>' . $elTitle . '</td>';
-                               // Remove-indexing-link:
-                               $lines[] = '<td>' . $cmdLinks . '</td>';
-                               // Various data:
-                               $lines[] = '<td>' . $row['phash'] . '</td>';
-                               $lines[] = '<td>' . $row['contentHash'] . '</td>';
-                               if ($row['item_type'] === '0') {
-                                       $lines[] = '<td>' . ($row['data_page_id'] ? $row['data_page_id'] : '&nbsp;') . '</td>';
-                                       $lines[] = '<td>' . ($row['data_page_type'] ? $row['data_page_type'] : '&nbsp;') . '</td>';
-                                       $lines[] = '<td>' . ($row['sys_language_uid'] ? $row['sys_language_uid'] : '&nbsp;') . '</td>';
-                                       $lines[] = '<td>' . ($row['data_page_mp'] ? $row['data_page_mp'] : '&nbsp;') . '</td>';
-                               } else {
-                                       $lines[] = '<td colspan="4">' . htmlspecialchars($row['data_filename']) . '</td>';
-                               }
-                               $lines[] = '<td>' . $row['gr_list'] . $this->printExtraGrListRows($extraGrListRows) . '</td>';
-                               $lines[] = '<td>' . $this->printRootlineInfo($row) . '</td>';
-                               $lines[] = '<td>' . ($row['page_id'] ? $row['page_id'] : '&nbsp;') . '</td>';
-                               $lines[] = '<td>' . ($row['phash_t3'] != $row['phash'] ? $row['phash_t3'] : '&nbsp;') . '</td>';
-                               $lines[] = '<td>' . ($row['freeIndexUid'] ? $row['freeIndexUid'] . ($row['freeIndexSetId'] ? '/' . $row['freeIndexSetId'] : '') : '&nbsp;') . '</td>';
-                               $lines[] = '<td>' . ($row['recordUid'] ? $row['recordUid'] : '&nbsp;') . '</td>';
-                               // cHash parameters:
-                               $arr = unserialize($row['cHashParams']);
-                               if (!is_array($arr)) {
-                                       $arr = array(
-                                               'cHash' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.error', TRUE)
-                                       );
-                               }
-                               $theCHash = $arr['cHash'];
-                               unset($arr['cHash']);
-                               if ($row['item_type']) {
-                                       // pdf...
-                                       $lines[] = '<td>' . ($arr['key'] ? 'Page ' . $arr['key'] : '') . '&nbsp;</td>';
-                               } elseif ($row['item_type'] == 0) {
-                                       $lines[] = '<td>' . htmlspecialchars(GeneralUtility::implodeArrayForUrl('', $arr)) . '&nbsp;</td>';
-                               } else {
-                                       $lines[] = '<td class="bgColor">&nbsp;</td>';
-                               }
-                               $lines[] = '<td>' . $theCHash . '</td>';
-                               break;
-                       case 2:
-                               // Words and content:
-                               // Display icon:
-                               if (!$grouping) {
-                                       $lines[] = '<td>' . $this->makeItemTypeIcon($row['item_type'], ($row['data_filename'] ? $row['data_filename'] : $row['item_title'])) . '</td>';
-                               } else {
-                                       $lines[] = '<td>&nbsp;</td>';
-                               }
-                               // Title displayed:
-                               $lines[] = '<td' . $titleCellAttribs . '>' . $elTitle . '</td>';
-                               // Remove-indexing-link:
-                               $lines[] = '<td>' . $cmdLinks . '</td>';
-                               // Query:
-                               $ftrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'index_fulltext', 'phash = ' . (int)$row['phash']);
-                               $lines[] = '<td style="white-space: normal;">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($ftrow['fulltextdata'], 3000)) . '<hr/><em>Size: ' . strlen($ftrow['fulltextdata']) . '</em>' . '</td>';
-                               // Query:
-                               $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.baseword, index_rel.*', 'index_rel, index_words', 'index_rel.phash = ' . (int)$row['phash'] . ' AND index_words.wid = index_rel.wid', '', '', '', 'baseword');
-                               $wordList = '';
-                               if (is_array($ftrows)) {
-                                       $indexed_words = array_keys($ftrows);
-                                       sort($indexed_words);
-                                       $wordList = htmlspecialchars(implode(' ', $indexed_words));
-                                       $wordList .= '<hr/><em>Count: ' . count($indexed_words) . '</em>';
-                               }
-                               $lines[] = '<td style="white-space: normal;">' . $wordList . '</td>';
-                               break;
-                       default:
-                               // Overview
-                               // Display icon:
-                               if (!$grouping) {
-                                       $lines[] = '<td>' . $this->makeItemTypeIcon($row['item_type'], ($row['data_filename'] ? $row['data_filename'] : $row['item_title'])) . '</td>';
-                               } else {
-                                       $lines[] = '<td>&nbsp;</td>';
-                               }
-                               // Title displayed:
-                               $lines[] = '<td' . $titleCellAttribs . '>' . $elTitle . '</td>';
-                               // Remove-indexing-link:
-                               $lines[] = '<td>' . $cmdLinks . '</td>';
-                               $lines[] = '<td style="white-space: normal;">' . htmlspecialchars($row['item_description']) . '...</td>';
-                               $lines[] = '<td>' . GeneralUtility::formatSize($row['item_size']) . '</td>';
-                               $lines[] = '<td>' . BackendUtility::dateTimeAge($row['tstamp']) . '</td>';
-               }
-               return $lines;
-       }
-
-       /**
-        * Creates the header row for the table
-        *
-        * @return string HTML string (table row)
-        */
-       public function printPhashRowHeader() {
-               $lines = array();
-               switch ($this->pObj->MOD_SETTINGS['type']) {
-                       case 1:
-                               $lines[] = '<td>&nbsp;</td>';
-                               $lines[] = '<td>&nbsp;</td>';
-                               $lines[] = '<td>Title</td>';
-                               $lines[] = '<td bgcolor="red">' . $this->printRemoveIndexed('ALL', 'Clear ALL phash-rows below!') . '</td>';
-                               $lines[] = '<td>pHash</td>';
-                               $lines[] = '<td>contentHash</td>';
-                               $lines[] = '<td>&amp;id</td>';
-                               $lines[] = '<td>&amp;type</td>';
-                               $lines[] = '<td>&amp;L</td>';
-                               $lines[] = '<td>&amp;MP</td>';
-                               $lines[] = '<td>grlist</td>';
-                               $lines[] = '<td>Rootline</td>';
-                               $lines[] = '<td>page_id</td>';
-                               $lines[] = '<td>phash_t3</td>';
-                               $lines[] = '<td>CfgUid</td>';
-                               $lines[] = '<td>RecUid</td>';
-                               $lines[] = '<td>GET-parameters</td>';
-                               $lines[] = '<td>&amp;cHash</td>';
-                               break;
-                       case 2:
-                               $lines[] = '<td>&nbsp;</td>';
-                               $lines[] = '<td>&nbsp;</td>';
-                               $lines[] = '<td>Title</td>';
-                               $lines[] = '<td bgcolor="red">' . $this->printRemoveIndexed('ALL', 'Clear ALL phash-rows below!') . '</td>';
-                               $lines[] = '<td>Content<br />
-                                                               <img src="clear.gif" width="300" height="1" alt="" /></td>';
-                               $lines[] = '<td>Words<br />
-                                                               <img src="clear.gif" width="300" height="1" alt="" /></td>';
-                               break;
-                       default:
-                               $lines[] = '<td>&nbsp;</td>';
-                               $lines[] = '<td>&nbsp;</td>';
-                               $lines[] = '<td>Title</td>';
-                               $lines[] = '<td bgcolor="red">' . $this->printRemoveIndexed('ALL', 'Clear ALL phash-rows below!') . '</td>';
-                               $lines[] = '<td>Description</td>';
-                               $lines[] = '<td>Size</td>';
-                               $lines[] = '<td>Indexed:</td>';
-               }
-               $out = '<tr class="tableheader bgColor5">' . implode('', $lines) . '</tr>';
-               return $out;
-       }
-
-       /**
-        * Returns the number of columns depending on display type of list
-        *
-        * @return int Number of columns in list:
-        */
-       public function returnNumberOfColumns() {
-               switch ($this->pObj->MOD_SETTINGS['type']) {
-                       case 1:
-                               return 18;
-                               break;
-                       case 2:
-                               return 6;
-                               break;
-                       default:
-                               return 7;
-               }
-       }
-
-       /*******************************
-        *
-        * Details display, phash row
-        *
-        *******************************/
-       /**
-        * Showing details for a particular phash row
-        *
-        * @param int phash value to display details for.
-        * @return string HTML content
-        */
-       public function showDetailsForPhash($phash) {
-               $content = '';
-               $phash = (int)$phash;
-                       // Selects the result row:
-               $phashRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'index_phash', 'phash = ' . $phash);
-               // If found, display:
-               if (is_array($phashRecord)) {
-                       $content .= '<h4>phash row content:</h4>' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($phashRecord);
-                       // Getting debug information if any:
-                       $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'index_debug', 'phash = ' . $phash);
-                       if (is_array($ftrows)) {
-                               $debugInfo = unserialize($ftrows[0]['debuginfo']);
-                               $lexer = $debugInfo['lexer'];
-                               unset($debugInfo['lexer']);
-                               $content .= '<h3>Debug information:</h3>' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($debugInfo);
-                               $content .= '<h4>Debug information / lexer splitting:</h4>' . '<hr/><strong>' . $lexer . '</strong><hr/>';
-                       }
-                       $content .= '<h3>Word statistics</h3>';
-                       // Finding all words for this phash:
-                       $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.*, index_rel.*', 'index_rel, index_words', 'index_rel.phash = ' . $phash . ' AND index_words.wid = index_rel.wid', '', 'index_words.baseword', '');
-                       $pageRec = BackendUtility::getRecord('pages', $phashRecord['data_page_id']);
-                       $showStopWordCheckBox = $GLOBALS['BE_USER']->isAdmin();
-                       $content .= $this->listWords($ftrows, 'All words found on page (' . count($ftrows) . '):', $showStopWordCheckBox, $pageRec);
-                       if ($this->enableMetaphoneSearch) {
-                               // Group metaphone hash:
-                               $metaphone = array();
-                               foreach ($ftrows as $row) {
-                                       $metaphone[$row['metaphone']][] = $row['baseword'];
-                               }
-                               $content .= $this->listMetaphoneStat($metaphone, 'Metaphone stats:');
-                       }
-                       // Finding top-20 on frequency for this phash:
-                       $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.baseword, index_words.metaphone, index_rel.*', 'index_rel, index_words', 'index_rel.phash = ' . $phash . ' AND index_words.wid = index_rel.wid
-                                                        AND index_words.is_stopword=0', '', 'index_rel.freq DESC', '20');
-                       $content .= $this->listWords($ftrows, 'Top-20 words by frequency:', 2);
-                       // Finding top-20 on count for this phash:
-                       $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.baseword, index_words.metaphone, index_rel.*', 'index_rel, index_words', 'index_rel.phash = ' . $phash . ' AND index_words.wid = index_rel.wid
-                                                        AND index_words.is_stopword=0', '', 'index_rel.count DESC', '20');
-                       $content .= $this->listWords($ftrows, 'Top-20 words by count:', 2);
-                       $content .= '<h3>Section records for this phash</h3>';
-                       // Finding sections for this record:
-                       $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'index_section', 'index_section.phash = ' . $phash, '', '', '');
-                       $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($ftrows);
-                       // Add go-back link:
-                       $content = $this->linkList() . $content . $this->linkList();
-               } else {
-                       $content .= 'Error: No phash row found';
-               }
-               return $content;
-       }
-
-       /**
-        * Create table with list of words from $ftrows
-        *
-        * @param array Array of records selected from index_rel/index_words
-        * @param string Header string to show before table.
-        * @param bool If set, the stopWord checkboxes will be shown in the word list. Only for admins. (because it is a global setting, not per-site).
-        * @param array The page record from which to load the keywords, if any.
-        * @return string HTML table
-        */
-       public function listWords($ftrows, $header, $stopWordBoxes = FALSE, $page = '') {
-               // Prepare keywords:
-               $keywords = is_array($page) ? array_flip(GeneralUtility::trimExplode(',', $page['keywords'], TRUE)) : '';
-               // Render list:
-               $trows = '';
-               $trows .= '
-                       <tr class="tableheader bgColor5">
-                               ' . ($stopWordBoxes ? '<td>' . htmlspecialchars('Stopword:') . '</td>' : '') . '
-                               <td>' . htmlspecialchars('Word:') . '</td>
-                               <td>' . htmlspecialchars('Count:') . '</td>
-                               <td>' . htmlspecialchars('First:') . '</td>
-                               <td>' . htmlspecialchars('Frequency:') . '</td>
-                               <td>' . htmlspecialchars('Flags:') . '</td>
-                               ' . (is_array($keywords) ? '<td>' . htmlspecialchars('Page keyword:') . '</td>' : '') . '
-                       </tr>
-               ';
-               foreach ($ftrows as $row) {
-                       $hiddenField = $stopWordBoxes != 2 ? '<input type="hidden" name="stopWord[' . $row['wid'] . ']" value="0" />' : '';
-                       $trows .= '
-                               <tr class="' . ($row['is_stopword'] ? 'bgColor' : 'bgColor4') . '">
-                                       ' . ($stopWordBoxes ? '<td align="center"' . ($row['is_stopword'] ? ' style="background-color:red;"' : '') . '>' . $hiddenField . '<input type="checkbox" name="stopWord[' . $row['wid'] . ']" value="1"' . ($row['is_stopword'] ? 'checked="checked"' : '') . ' /></td>' : '') . '
-                                       <td>' . $this->linkWordDetails(htmlspecialchars($row['baseword']), $row['wid']) . '</td>
-                                       <td>' . htmlspecialchars($row['count']) . '</td>
-                                       <td>' . htmlspecialchars($row['first']) . '</td>
-                                       <td>' . htmlspecialchars($row['freq']) . '</td>
-                                       <td>' . htmlspecialchars($this->flagsMsg($row['flags'])) . '</td>
-                                       ' . (is_array($keywords) ? '<td align="center"' . (isset($keywords[$row['baseword']]) ? ' class="bgColor2"' : '') . '><input type="hidden" name="pageKeyword[' . $row['baseword'] . ']" value="0" /><input type="checkbox" name="pageKeyword[' . $row['baseword'] . ']" value="1"' . (isset($keywords[$row['baseword']]) ? 'checked="checked"' : '') . ' /></td>' : '') . '
-                               </tr>
-                       ';
-               }
-               return '<h4>' . htmlspecialchars($header) . '</h4>' . '
-                                       <table border="0" cellspacing="1" cellpadding="2" class="c-list">
-                                       ' . $trows . '
-                                       </table>' . ($stopWordBoxes ? '<input type="submit" value="Change stop-word settings" name="_stopwords" onclick="document.webinfoForm.action=\'' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '\';" />' : '') . (is_array($keywords) ? '<input type="submit" value="Set page keywords" name="_pageKeywords" onclick="document.webinfoForm.action=\'' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '\';" /><input type="hidden" name="pageKeyword_pageUid" value="' . $page['uid'] . '" />' . '<br />Current keywords are: <em>' . htmlspecialchars(implode(', ', array_keys($keywords))) . '</em>' : '');
-       }
-
-       /**
-        * Displays table of metaphone groups larger than 1
-        *
-        * @param array Result from word selection (index_rel/index_words)
-        * @param string Header string
-        * @return string HTML table
-        */
-       public function listMetaphoneStat($ftrows, $header) {
-               $trows = '';
-               $trows .= '
-                       <tr class="tableheader bgColor5">
-                               <td>' . htmlspecialchars('Metaphone:') . '</td>
-                               <td>' . htmlspecialchars('Hash:') . '</td>
-                               <td>' . htmlspecialchars('Count:') . '</td>
-                               <td>' . htmlspecialchars('Words:') . '</td>
-                       </tr>
-               ';
-               foreach ($ftrows as $metaphone => $words) {
-                       if (count($words) > 1) {
-                               $trows .= '
-                                       <tr class="bgColor4">
-                                               <td>' . $this->linkMetaPhoneDetails($this->indexerObj->metaphone($words[0], 1), $metaphone) . '</td>
-                                               <td>' . htmlspecialchars($metaphone) . '</td>
-                                               <td>' . htmlspecialchars(count($words)) . '</td>
-                                               <td style="white-space: normal;">' . htmlspecialchars(implode(', ', $words)) . '</td>
-                                       </tr>
-                               ';
-                       }
-               }
-               return '<h4>' . htmlspecialchars($header) . '</h4>' . '<table border="0" cellspacing="1" cellpadding="2" class="c-list">
-                                       ' . $trows . '
-                                       </table>';
-       }
-
-       /**
-        * Wraps input string in a link that will display details for the word. Eg. which other pages has the word, metaphone associations etc.
-        *
-        * @param string String to wrap, possibly a title or so.
-        * @param int wid value to show details for
-        * @return string Wrapped string
-        */
-       public function linkWordDetails($string, $wid) {
-               return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('wid' => $wid, 'phash' => ''))) . '">' . $string . '</a>';
-       }
-
-       /**
-        * Wraps input string in a link to see more details for metaphone value
-        *
-        * @param string String to wrap
-        * @param int Metaphone value
-        * @return string Wrapped string
-        */
-       public function linkMetaPhoneDetails($string, $metaphone) {
-               return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('metaphone' => $metaphone, 'wid' => '', 'phash' => ''))) . '">' . $string . '</a>';
-       }
-
-       /**
-        * Creates message for flag value
-        *
-        * @param int Flags integer
-        * @return string Message string
-        */
-       public function flagsMsg($flags) {
-               if ($flags > 0) {
-                       return ($flags & 128 ? '<title>' : '') . ($flags & 64 ? '<meta/keywords>' : '') . ($flags & 32 ? '<meta/description>' : '') . ' (' . $flags . ')';
-               }
-       }
-
-       /*******************************
-        *
-        * Details display, words / metaphone
-        *
-        *******************************/
-       /**
-        * Show details for words
-        *
-        * @param int Word ID (wid)
-        * @return string HTML content
-        */
-       public function showDetailsForWord($wid) {
-               // Select references to this word
-               $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_phash.*, index_section.*, index_rel.*', 'index_rel, index_section, index_phash', 'index_rel.wid = ' . (int)$wid . ' AND index_rel.phash = index_section.phash' . ' AND index_section.phash = index_phash.phash', '', 'index_rel.freq DESC', '');
-               // Headers:
-               $content = '
-                       <tr class="tableheader bgColor5">
-                               <td>phash</td>
-                               <td>page_id</td>
-                               <td>data_filename</td>
-                               <td>count</td>
-                               <td>first</td>
-                               <td>freq</td>
-                               <td>flags</td>
-                       </tr>';
-               if (is_array($ftrows)) {
-                       foreach ($ftrows as $wDat) {
-                               $content .= '
-                                       <tr class="bgColor4">
-                                               <td>' . $this->linkDetails(htmlspecialchars($wDat['phash']), $wDat['phash']) . '</td>
-                                               <td>' . htmlspecialchars($wDat['page_id']) . '</td>
-                                               <td>' . htmlspecialchars($wDat['data_filename']) . '</td>
-                                               <td>' . htmlspecialchars($wDat['count']) . '</td>
-                                               <td>' . htmlspecialchars($wDat['first']) . '</td>
-                                               <td>' . htmlspecialchars($wDat['freq']) . '</td>
-                                               <td>' . htmlspecialchars($wDat['flags']) . '</td>
-                                       </tr>';
-                       }
-               }
-               // Compile table:
-               $content = '
-                       <table border="0" cellspacing="1" cellpadding="2" class="c-list">' . $content . '
-                       </table>';
-               // Add go-back link:
-               $content = $content . $this->linkList();
-               return $content;
-       }
-
-       /**
-        * Show details for metaphone value
-        *
-        * @param int Metaphone integer hash
-        * @return string HTML content
-        */
-       public function showDetailsForMetaphone($metaphone) {
-               // Finding top-20 on frequency for this phash:
-               $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.*', 'index_words', 'index_words.metaphone = ' . (int)$metaphone, '', 'index_words.baseword', '');
-               if (count($ftrows)) {
-                       $content .= '<h4>Metaphone: ' . $this->indexerObj->metaphone($ftrows[0]['baseword'], 1) . '</h4>';
-                       $content .= '
-                               <tr class="tableheader bgColor5">
-                                       <td>Word</td>
-                                       <td>Is stopword?</td>
-                               </tr>';
-                       if (is_array($ftrows)) {
-                               foreach ($ftrows as $wDat) {
-                                       $content .= '
-                                               <tr class="bgColor4">
-                                                       <td>' . $this->linkWordDetails(htmlspecialchars($wDat['baseword']), $wDat['wid']) . '</td>
-                                                       <td>' . htmlspecialchars(($wDat['is_stopword'] ? 'YES' : 'No')) . '</td>
-                                               </tr>';
-                               }
-                       }
-                       $content = '
-                               <table border="0" cellspacing="1" cellpadding="2" class="c-list">' . $content . '
-                               </table>';
-                       if ($this->indexerObj->metaphone($ftrows[0]['baseword']) != $metaphone) {
-                               $content .= 'ERROR: Metaphone string and hash did not match for some reason!?';
-                       }
-                       // Add go-back link:
-                       $content = $content . $this->linkList();
-               }
-               return $content;
-       }
-
-       /*******************************
-        *
-        * Helper functions
-        *
-        *******************************/
-       /**
-        * Creates icon which clears indexes for a certain list of phash values.
-        *
-        * @param string List of phash integers
-        * @param string Alt-text for the garbage bin icon.
-        * @return string HTML img-tag with link around.
-        */
-       public function printRemoveIndexed($phash, $alt) {
-               return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('deletePhash' => $phash))) . '" title="' . htmlspecialchars($alt) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
-       }
-
-       /**
-        * Button for re-indexing of documents
-        *
-        * @param array phash table result row.
-        * @param string Title attribute text for icon
-        * @return string HTML content; Icon wrapped in link.
-        */
-       public function printReindex($resultRow, $alt) {
-               if ($resultRow['item_type'] && $resultRow['item_type'] !== '0') {
-                       return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('reindex' => $resultRow['phash'], 'reindex_id' => $resultRow['page_id']))) . '">' . '<img ' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/refresh_n.gif', 'width="14" height="14"') . ' hspace="1" vspace="2" border="0" title="' . htmlspecialchars($alt) . '" alt="" />' . '</a>';
-               }
-       }
-
-       /**
-        * Wraps input string in a link that will display details for the phash value set.
-        *
-        * @param string String to wrap, possibly a title or so.
-        * @param int phash value to show details for
-        * @return string Wrapped string
-        */
-       public function linkDetails($string, $phash) {
-               return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('phash' => $phash))) . '">' . $string . '</a>';
-       }
-
-       /**
-        * Creates link back to listing
-        *
-        * @return string Link back to list
-        */
-       public function linkList() {
-               return '<br /><a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_info', array('id' => $this->pObj->id))) . '">Back to list.</a><br />';
-       }
-
-       /**
-        * Wraps input string in a link that will display details for the phash value set.
-        *
-        * @param string String to wrap, possibly a title or so.
-        * @param int phash value to show details for
-        * @return string Wrapped string
-        */
-       public function showPageDetails($string, $id) {
-               return '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_info', array('id' => $id, 'SET' => array('depth' => 0, 'type' => 1)))) . '">' . $string . '</a>';
-       }
-
-       /**
-        * Prints the gr_lists attached to a indexed entry.
-        *
-        * @param array Array of index_grlist records
-        * @return string HTML code.
-        */
-       public function printExtraGrListRows($extraGrListRows) {
-               if (count($extraGrListRows)) {
-                       $lines = array();
-                       foreach ($extraGrListRows as $r) {
-                               $lines[] = $r['gr_list'];
-                       }
-                       return '<br /><span class="text-muted">' . implode('<br />', $lines) . '</span>';
-               }
-       }
-
-       /**
-        * Print path for indexing
-        *
-        * @param array Result row with content from index_section
-        * @return string Rootline information
-        */
-       public function printRootlineInfo($row) {
-               $uidCollection = array();
-               if ($row['rl0']) {
-                       $uidCollection[0] = $row['rl0'];
-                       if ($row['rl1']) {
-                               $uidCollection[1] = $row['rl1'];
-                               if ($row['rl2']) {
-                                       $uidCollection[2] = $row['rl2'];
-                                       // Additional levels:
-                                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) {
-                                               foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) {
-                                                       if ($row[$fieldName]) {
-                                                               $uidCollection[$rootLineLevel] = $row[$fieldName];
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-               // Return root line.
-               ksort($uidCollection);
-               return implode('/', $uidCollection);
-       }
-
-       /**
-        * Return icon for file extension
-        *
-        * @param string File extension / item type
-        * @param string Title attribute value in icon.
-        * @return string <img> tag for icon
-        */
-       public function makeItemTypeIcon($it, $alt = '') {
-               if (!isset($this->iconFileNameCache[$it])) {
-                       if ($it === '0') {
-                               $icon = 'EXT:indexed_search/pi/res/pages.gif';
-                       } elseif ($this->external_parsers[$it]) {
-                               $icon = $this->external_parsers[$it]->getIcon($it);
-                       }
-                       $fullPath = GeneralUtility::getFileAbsFileName($icon);
-                       if ($fullPath) {
-                               $info = @getimagesize($fullPath);
-                               $iconPath = $GLOBALS['BACK_PATH'] . '../' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($fullPath);
-                               $this->iconFileNameCache[$it] = is_array($info) ? '<img src="' . $iconPath . '" ' . $info[3] . ' title="###TITLE_ATTRIBUTE###" alt="" />' : '';
-                       }
-               }
-               return str_replace('###TITLE_ATTRIBUTE###', htmlspecialchars($it . ': ' . $alt), $this->iconFileNameCache[$it]);
-       }
-
-       /********************************
-        *
-        * Reindexing
-        *
-        *******************************/
-       /**
-        * Re-indexing files/records attached to a page.
-        *
-        * @param int Phash value
-        * @param int The page uid for the section record (file/url could appear more than one place you know...)
-        * @return string HTML content
-        */
-       public function reindexPhash($phash, $pageId) {
-               // Query:
-               $resultRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('ISEC.*, IP.*', 'index_phash IP, index_section ISEC', 'IP.phash = ISEC.phash
-                                               AND IP.phash = ' . (int)$phash . '
-                                               AND ISEC.page_id = ' . (int)$pageId);
-               $content = '';
-               if (is_array($resultRow)) {
-                       if ($resultRow['item_type'] && $resultRow['item_type'] !== '0') {
-                               // (Re)-Indexing file on page.
-                               $indexerObj = GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class);
-                               $indexerObj->backend_initIndexer($pageId, 0, 0, '', $this->getUidRootLineForClosestTemplate($pageId));
-                               // URL or local file:
-                               if ($resultRow['externalUrl']) {
-                                       $indexerObj->indexExternalUrl($resultRow['data_filename']);
-                               } else {
-                                       $indexerObj->indexRegularDocument($resultRow['data_filename'], TRUE);
-                               }
-                               if ($indexerObj->file_phash_arr['phash'] != $resultRow['phash']) {
-                                       $content .= 'ERROR: phash (' . $indexerObj->file_phash_arr['phash'] . ') did NOT match ' . $resultRow['phash'] . ' for strange reasons!';
-                               }
-                               $content .= '<h4>Log for re-indexing of "' . htmlspecialchars($resultRow['data_filename']) . '":</h4>';
-                               $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($indexerObj->internal_log);
-                               $content .= '<h4>Hash-array, page:</h4>';
-                               $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($indexerObj->hash);
-                               $content .= '<h4>Hash-array, file:</h4>';
-                               $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($indexerObj->file_phash_arr);
-                       }
-               }
-               // Link back to list.
-               $content .= $this->linkList();
-               return $content;
-       }
-
-       /**
-        * Get rootline for closest TypoScript template root.
-        * Algorithm same as used in Web > Template, Object browser
-        *
-        * @param int The page id to traverse rootline back from
-        * @return array Array where the root lines uid values are found.
-        */
-       public function getUidRootLineForClosestTemplate($id) {
-               $tmpl = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::class);
-               // Defined global here!
-               $tmpl->tt_track = 0;
-               // Do not log time-performance information
-               $tmpl->init();
-               // Gets the rootLine
-               $sys_page = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
-               $rootLine = $sys_page->getRootLine($id);
-               $tmpl->runThroughTemplates($rootLine, 0);
-               // This generates the constants/config + hierarchy info for the template.
-               // Root line uids
-               $rootline_uids = array();
-               foreach ($tmpl->rootLine as $rlkey => $rldat) {
-                       $rootline_uids[$rlkey] = $rldat['uid'];
-               }
-               return $rootline_uids;
-       }
-
-       /********************************
-        *
-        * SQL functions
-        *
-        *******************************/
-       /**
-        * Removes ALL data regarding a certain list of indexed phash-row
-        *
-        * @param string List of phash integers
-        * @param bool If set, page cache is cleared as well.
-        * @return void
-        */
-       public function removeIndexedPhashRow($phashList, $clearPageCache = 1) {
-               // @todo This is only a workaround
-               if ($phashList == 'ALL') {
-                       $this->drawTableOfIndexedPages();
-                       $phashRows = $this->allPhashListed;
-                       $this->allPhashListed = array();
-               } else {
-                       $phashRows = GeneralUtility::trimExplode(',', $phashList, TRUE);
-               }
-               foreach ($phashRows as $phash) {
-                       $phash = (int)$phash;
-                       if ($phash > 0) {
-                               if ($clearPageCache) {
-                                       // Clearing page cache:
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('page_id', 'index_section', 'phash=' . (int)$phash);
-                                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
-                                               $idList = array();
-                                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                                                       $idList[] = (int)$row['page_id'];
-                                               }
-                                               $pageCache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_pages');
-                                               foreach ($idList as $pageId) {
-                                                       $pageCache->flushByTag('pageId_' . $pageId);
-                                               }
-                                       }
-                               }
-                               // Removing old registrations for all tables.
-                               $tableArr = explode(',', 'index_phash,index_rel,index_section,index_grlist,index_fulltext,index_debug');
-                               foreach ($tableArr as $table) {
-                                       $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'phash=' . (int)$phash);
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Returns an array with gr_list records for a phash
-        *
-        * @param int phash integer to look up on
-        * @param string gr_list string to filter OUT of the result (first occurence)
-        * @return array Array of records from index_grlist table
-        */
-       public function getGrListEntriesForPhash($phash, $gr_list) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'index_grlist', 'phash=' . (int)$phash);
-               $lines = array();
-               $isRemoved = 0;
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       if (!$isRemoved && (string)$row['gr_list'] === (string)$gr_list) {
-                               $isRemoved = 1;
-                       } else {
-                               $lines[] = $row;
-                       }
-               }
-               return $lines;
-       }
-
-       /**
-        * Setting / Unsetting stopwords
-        *
-        * @param array Array of stop-words WIDs with 0/1 to set / unset
-        * @return void
-        */
-       public function processStopWords($stopWords) {
-               if ($GLOBALS['BE_USER']->isAdmin()) {
-                       // Traverse words
-                       foreach ($stopWords as $wid => $state) {
-                               $fieldArray = array(
-                                       'is_stopword' => $state
-                               );
-                               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('index_words', 'wid=' . $wid, $fieldArray);
-                       }
-               }
-       }
-
-       /**
-        * Setting / Unsetting keywords in page header
-        *
-        * @param array Page keywords as keys in array with value 0 or 1 for set or unset.
-        * @param int The page uid of the header where the keywords are to be set.
-        * @return void
-        */
-       public function processPageKeywords($pageKeywords, $pageUid) {
-               // Get pages current keywords
-               $pageRec = BackendUtility::getRecord('pages', $pageUid);
-               $keywords = array_flip(GeneralUtility::trimExplode(',', $pageRec['keywords'], TRUE));
-               // Merge keywords:
-               foreach ($pageKeywords as $key => $v) {
-                       if ($v) {
-                               $keywords[$key] = 1;
-                       } else {
-                               unset($keywords[$key]);
-                       }
-               }
-               // Compile new list:
-               $data = array();
-               $data['pages'][$pageUid]['keywords'] = implode(', ', array_keys($keywords));
-               $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
-               $tce->stripslashes_values = 0;
-               $tce->start($data, array());
-               $tce->process_datamap();
-       }
-
-}
diff --git a/typo3/sysext/indexed_search/Classes/Controller/IndexingStatisticsController.php b/typo3/sysext/indexed_search/Classes/Controller/IndexingStatisticsController.php
deleted file mode 100644 (file)
index ee6adef..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-namespace TYPO3\CMS\IndexedSearch\Controller;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Module extension (addition to function menu) 'Indexed search statistics' for the 'indexed_search' extension.
- *
- * @author Dimitri Ebert <dimitri.ebert@dkd.de>
- */
-class IndexingStatisticsController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule {
-
-       /**
-        * Default constructor loads additional locallang
-        */
-       public function __construct() {
-               $GLOBALS['LANG']->includeLLFile('EXT:indexed_search/modfunc2/locallang.xlf');
-       }
-
-       /**
-        * Calls showStats to generate output.
-        *
-        * @return string html table with results from showStats()
-        */
-       public function main() {
-               // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
-               $theOutput = $this->pObj->doc->header($GLOBALS['LANG']->getLL('title'));
-               $theOutput .= $this->pObj->doc->section('', $this->showStats(), 0, 1);
-               $menu = array();
-               $functionMenu = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[tx_indexedsearch_modfunc2_check]', $this->pObj->MOD_SETTINGS['tx_indexedsearch_modfunc2_check'], '', '', 'id="checkTx_indexedsearch_modfunc2_check"');
-               $menu[] = $functionMenu . '<label for="checkTx_indexedsearch_modfunc2_check"' . $GLOBALS['LANG']->getLL('checklabel') . '</label>';
-               $theOutput .= $this->pObj->doc->spacer(5);
-               return $theOutput;
-       }
-
-       /**
-        * Generates html table containing the statistics.
-        * Calls listSeveralStats 3 times, for all statistics, statistics of the last 30 days and statistics of the last 24 hours.
-        *
-        * @return string html table with results
-        */
-       public function showStats() {
-               $conf['words'] = 50;
-
-               // max words in result list
-               $conf['bid'] = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('id');
-
-               // pageid for several statistics
-               $addwhere1 = '';
-
-               // all records
-               $addwhere2 = ' AND tstamp > ' . ($GLOBALS['EXEC_TIME'] - 30 * 24 * 60 * 60);
-
-               // last 30 days
-               $addwhere3 = ' AND tstamp > ' . ($GLOBALS['EXEC_TIME'] - 24 * 60 * 60);
-
-               // last 24 hours
-               $content = '<p class="lead">' . $GLOBALS['LANG']->getLL('title2') . '</p>';
-               $content .= '<table cellpading="5" cellspacing="5" valign="top" class=""><tr><td valign="top">' . $this->listSeveralStats($GLOBALS['LANG']->getLL('all'), $addwhere1, $conf) . '</td><td valign="top">' . $this->listSeveralStats($GLOBALS['LANG']->getLL('last30days'), $addwhere2, $conf) . '</td><td valign="top">' . $this->listSeveralStats($GLOBALS['LANG']->getLL('last24hours'), $addwhere3, $conf) . '</td></tr></table>';
-               $content .= '<p>' . $this->note . '</p>';
-
-               // Ask hook to include more on the page:
-               if ($hookObj = $this->hookRequest('additionalSearchStat')) {
-                       $content .= $hookObj->additionalSearchStat();
-               }
-               return $content;
-       }
-
-       /**
-        * Generates html table with title and several statistics
-        *
-        * @param string title for statistic, like 'Last 30 days' or 'Last 24 hours'
-        * @param string add where for sql query
-        * @param array configuration: words = max words for results, bid = pageid
-        * @return string html table with results
-        */
-       public function listSeveralStats($title, $addwhere, $conf) {
-               $queryParts['SELECT'] = 'word, COUNT(*) AS c';
-               $queryParts['FROM'] = 'index_stat_word';
-               $queryParts['WHERE'] = sprintf('pageid= %d ' . $addwhere, $conf['bid']);
-               $queryParts['GROUPBY'] = 'word';
-               $queryParts['ORDERBY'] = 'c DESC,word';
-               $queryParts['LIMIT'] = $conf['words'];
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($queryParts['SELECT'], $queryParts['FROM'], $queryParts['WHERE'], $queryParts['GROUPBY'], $queryParts['ORDERBY'], $queryParts['LIMIT']);
-               if ($res) {
-                       $count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
-               } else {
-                       $count = 0;
-               }
-               // exist several statistics for this page?
-               if ($count > 0) {
-                       $this->note = $GLOBALS['LANG']->getLL('justthispage');
-               } else {
-                       // Limit access to pages of the current site
-                       $secureaddwhere = ' AND pageid IN (' . $this->extGetTreeList($conf['bid'], 100, 0, '1=1') . $conf['bid'] . ') ';
-                       $this->note = $GLOBALS['LANG']->getLL('allpages');
-                       $queryParts['WHERE'] = '1=1 ' . $addwhere . $secureaddwhere;
-               }
-               // make real query
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($queryParts['SELECT'], $queryParts['FROM'], $queryParts['WHERE'], $queryParts['GROUPBY'], $queryParts['ORDERBY'], $queryParts['LIMIT']);
-               $table1 = '';
-               $i = 0;
-               if ($res) {
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               $i++;
-                               $table1 .= '<tr class="bgColor4"><td>' . $i . '.</td><td>' . htmlspecialchars($row['word']) . '</td><td>&nbsp;&nbsp;' . $row['c'] . '</td></tr>';
-                       }
-               }
-               if ($i == 0) {
-                       $table1 = '<tr class="bgColor4"><td callspan="3">' . $GLOBALS['LANG']->getLL('noresults') . '</td></tr>';
-               }
-               $table1 = '<table class="bgColor5" cellpadding="2" cellspacing="1"><tr class="tableheader"><td colspan="3">' . $title . '</td></tr>' . $table1 . '</table>';
-               return $note . $table1;
-       }
-
-       /**
-        * Calls \TYPO3\CMS\Backend\FrontendBackendUserAuthentication::extGetTreeList.
-        * Although this duplicates the function \TYPO3\CMS\Backend\FrontendBackendUserAuthentication::extGetTreeList
-        * this is necessary to create the object that is used recursively by the original function.
-        *
-        * Generates a list of Page-uid's from $id. List does not include $id itself
-        * The only pages excluded from the list are deleted pages.
-        *
-        * @param int Start page id
-        * @param int Depth to traverse down the page tree.
-        * @param int $begin is an optional integer that determines at which level in the tree to start collecting uid's. Zero means 'start right away', 1 = 'next level and out'
-        * @param string Perms clause
-        * @return string Returns the list with a comma in the end (if any pages selected!)
-        */
-       public function extGetTreeList($id, $depth, $begin = 0, $perms_clause) {
-               return GeneralUtility::makeInstance(\TYPO3\CMS\Backend\FrontendBackendUserAuthentication::class)->extGetTreeList($id, $depth, $begin, $perms_clause);
-       }
-
-       /**
-        * Returns an object reference to the hook object if any
-        *
-        * @param string Name of the function you want to call / hook key
-        * @return object Hook object, if any. Otherwise NULL.
-        * @author Kasper Skårhøj
-        */
-       public function hookRequest($functionName) {
-               // Hook: menuConfig_preProcessModMenu
-               if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['be_hooks'][$functionName]) {
-                       $hookObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['be_hooks'][$functionName]);
-                       if (method_exists($hookObj, $functionName)) {
-                               $hookObj->pObj = $this;
-                               return $hookObj;
-                       }
-               }
-       }
-
-}
diff --git a/typo3/sysext/indexed_search/Classes/Controller/ModuleController.php b/typo3/sysext/indexed_search/Classes/Controller/ModuleController.php
deleted file mode 100644 (file)
index 085770a..0000000
+++ /dev/null
@@ -1,480 +0,0 @@
-<?php
-namespace TYPO3\CMS\IndexedSearch\Controller;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-
-/**
- * Backend module providing boring statistics of the index-tables.
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class ModuleController {
-
-       /**
-        * @var array
-        */
-       public $MCONF = array();
-
-       /**
-        * @var array
-        */
-       public $MOD_MENU = array();
-
-       /**
-        * @var array
-        */
-       public $MOD_SETTINGS = array();
-
-       /**
-        * document template object
-        *
-        * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
-        */
-       public $doc;
-
-       /**
-        * @var array
-        */
-       public $include_once = array();
-
-       /**
-        * @var string
-        */
-       public $content;
-
-       /**
-        * Constructor
-        */
-       public function __construct() {
-               $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], TRUE);
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('indexed_search', TRUE);
-       }
-
-       /**
-        * Initialization
-        *
-        * @return void
-        */
-       public function init() {
-               $this->MCONF = $GLOBALS['MCONF'];
-               $this->menuConfig();
-               $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
-               $this->doc->form = '<form action="" method="post">';
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('indexed_search') . '/mod/mod_template.html');
-               $this->doc->tableLayout = array(
-                       'defRow' => array(
-                               '0' => array('<td valign="top" nowrap>', '</td>'),
-                               'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width=10 height=1></td><td valign="top" nowrap>', '</td>')
-                       )
-               );
-               $indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class);
-               $indexer->initializeExternalParsers();
-       }
-
-       /**
-        * 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.
-        *
-        * @return void
-        */
-       public function menuConfig() {
-               $this->MOD_MENU = array(
-                       'function' => array(
-                               'stat' => 'General statistics',
-                               'typo3pages' => 'List: TYPO3 Pages',
-                               'externalDocs' => 'List: External documents'
-                       )
-               );
-               // cleanse settings
-               $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name'], 'ses');
-       }
-
-       /**
-        * Main function to generate the content
-        *
-        * @return void
-        */
-       public function main() {
-               $this->content = $this->doc->header('Indexing Engine Statistics');
-               $this->content .= $this->doc->spacer(5);
-               switch ($this->MOD_SETTINGS['function']) {
-                       case 'stat':
-                               $this->content .= $this->doc->section('Records', $this->doc->table($this->getRecordsNumbers()), 0, 1);
-                               $this->content .= $this->doc->spacer(15);
-                               $this->content .= $this->doc->section('index_phash TYPES', $this->doc->table($this->getPhashTypes()), 1);
-                               $this->content .= $this->doc->spacer(15);
-                               break;
-                       case 'externalDocs':
-                               $this->content .= $this->doc->section('External documents', $this->doc->table($this->getPhashExternalDocs()), 0, 1);
-                               $this->content .= $this->doc->spacer(15);
-                               break;
-                       case 'typo3pages':
-                               $this->content .= $this->doc->section('TYPO3 Pages', $this->doc->table($this->getPhashT3pages()), 0, 1);
-                               $this->content .= $this->doc->spacer(15);
-                               break;
-               }
-               $docHeaderButtons = $this->getButtons();
-               $markers = array(
-                       'CSH' => $docHeaderButtons['csh'],
-                       'FUNC_MENU' => BackendUtility::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']),
-                       'CONTENT' => $this->content
-               );
-               $this->content = $this->doc->startPage('Indexing Engine Statistics');
-               $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-               $this->content .= $this->doc->endPage();
-               $this->content = $this->doc->insertStylesAndJS($this->content);
-       }
-
-       /**
-        * Print content
-        *
-        * @return void
-        */
-       public function printContent() {
-               echo $this->content;
-       }
-
-       /**
-        * Create the panel of buttons for submitting the form or otherwise perform operations.
-        *
-        * @return array all available buttons as an assoc. array
-        */
-       protected function getButtons() {
-               $buttons = array(
-                       'csh' => '',
-                       'shortcut' => ''
-               );
-               // Shortcut
-               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
-                       $buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
-               }
-               return $buttons;
-       }
-
-       /***************************
-        *
-        * OTHER FUNCTIONS:
-        *
-        ***************************/
-       /**
-        * @return      [type]          ...
-        */
-       public function getRecordsNumbers() {
-               $tables = explode(',', 'index_phash,index_words,index_rel,index_grlist,index_section,index_fulltext');
-               $recList = array();
-               foreach ($tables as $t) {
-                       $recList[] = array(
-                               $this->tableHead($t),
-                               $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $t)
-                       );
-               }
-               return $recList;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $str: ...
-        * @return      [type]          ...
-        */
-       public function tableHead($str) {
-               return '<strong>' . $str . ':&nbsp;&nbsp;&nbsp;</strong>';
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function getPhashStat() {
-               $recList = array();
-               // TYPO3 pages, unique
-               $items = array();
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*),phash', 'index_phash', 'data_page_id<>0', 'phash_grouping,pcount,phash');
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
-                       $items[] = $row;
-               }
-               $recList[] = array($this->tableHead('TYPO3 pages'), count($items));
-               // TYPO3 pages:
-               $recList[] = array(
-                       $this->tableHead('TYPO3 pages, raw'),
-                       $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_phash', 'data_page_id<>0')
-               );
-               // External files, unique
-               $items = array();
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*),phash', 'index_phash', 'data_filename<>\'\'', 'phash_grouping');
-               $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
-               $recList[] = array($this->tableHead('External files'), $row[0]);
-               // External files
-               $recList[] = array(
-                       $this->tableHead('External files, raw'),
-                       $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_phash', 'data_filename<>\'\'')
-               );
-               return $recList;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function getPhashT3pages() {
-               $recList[] = array(
-                       $this->tableHead('id/type'),
-                       $this->tableHead('Title'),
-                       $this->tableHead('Size'),
-                       $this->tableHead('Words'),
-                       $this->tableHead('mtime'),
-                       $this->tableHead('Indexed'),
-                       $this->tableHead('Updated'),
-                       $this->tableHead('Parsetime'),
-                       $this->tableHead('#sec/gr/full'),
-                       $this->tableHead('#sub'),
-                       $this->tableHead('Lang'),
-                       $this->tableHead('cHash'),
-                       $this->tableHead('phash')
-               );
-               // TYPO3 pages, unique
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'data_page_id<>0', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'data_page_id');
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $cHash = count(unserialize($row['cHashParams'])) ? $this->formatCHash(unserialize($row['cHashParams'])) : '';
-                       $grListRec = $this->getGrlistRecord($row['phash']);
-                       $recList[] = array(
-                               $row['data_page_id'] . ($row['data_page_type'] ? '/' . $row['data_page_type'] : ''),
-                               htmlentities(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['item_title'], 30)),
-                               \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($row['item_size']),
-                               $this->getNumberOfWords($row['phash']),
-                               BackendUtility::datetime($row['item_mtime']),
-                               BackendUtility::datetime($row['crdate']),
-                               $row['tstamp'] != $row['crdate'] ? BackendUtility::datetime($row['tstamp']) : '',
-                               $row['parsetime'],
-                               $this->getNumberOfSections($row['phash']) . '/' . $grListRec[0]['pcount'] . '/' . $this->getNumberOfFulltext($row['phash']),
-                               $row['pcount'] . '/' . $this->formatFeGroup($grListRec),
-                               $row['sys_language_uid'],
-                               $cHash,
-                               $row['phash']
-                       );
-                       if ($row['pcount'] > 1) {
-                               $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping=' . (int)$row['phash_grouping'] . ' AND phash<>' . (int)$row['phash']);
-                               while ($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) {
-                                       $grListRec = $this->getGrlistRecord($row2['phash']);
-                                       $recList[] = array(
-                                               '',
-                                               '',
-                                               \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($row2['item_size']),
-                                               $this->getNumberOfWords($row2['phash']),
-                                               BackendUtility::datetime($row2['item_mtime']),
-                                               BackendUtility::datetime($row2['crdate']),
-                                               $row2['tstamp'] != $row2['crdate'] ? BackendUtility::datetime($row2['tstamp']) : '',
-                                               $row2['parsetime'],
-                                               $this->getNumberOfSections($row2['phash']) . '/' . $grListRec[0]['pcount'] . '/' . $this->getNumberOfFulltext($row2['phash']),
-                                               '-/' . $this->formatFeGroup($grListRec),
-                                               '',
-                                               '',
-                                               $row2['phash']
-                                       );
-                               }
-                       }
-               }
-               return $recList;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function getPhashExternalDocs() {
-               $recList[] = array(
-                       $this->tableHead('Filename'),
-                       $this->tableHead('Size'),
-                       $this->tableHead('Words'),
-                       $this->tableHead('mtime'),
-                       $this->tableHead('Indexed'),
-                       $this->tableHead('Updated'),
-                       $this->tableHead('Parsetime'),
-                       $this->tableHead('#sec/gr/full'),
-                       $this->tableHead('#sub'),
-                       $this->tableHead('cHash'),
-                       $this->tableHead('phash'),
-                       $this->tableHead('Path')
-               );
-               // TYPO3 pages, unique
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'item_type<>\'0\'', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'item_type');
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $cHash = count(unserialize($row['cHashParams'])) ? $this->formatCHash(unserialize($row['cHashParams'])) : '';
-                       $grListRec = $this->getGrlistRecord($row['phash']);
-                       $recList[] = array(
-                               htmlentities(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['item_title'], 30)),
-                               \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($row['item_size']),
-                               $this->getNumberOfWords($row['phash']),
-                               BackendUtility::datetime($row['item_mtime']),
-                               BackendUtility::datetime($row['crdate']),
-                               $row['tstamp'] != $row['crdate'] ? BackendUtility::datetime($row['tstamp']) : '',
-                               $row['parsetime'],
-                               $this->getNumberOfSections($row['phash']) . '/' . $grListRec[0]['pcount'] . '/' . $this->getNumberOfFulltext($row['phash']),
-                               $row['pcount'],
-                               $cHash,
-                               $row['phash'],
-                               htmlentities(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['data_filename'], 100))
-                       );
-                       if ($row['pcount'] > 1) {
-                               $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping=' . (int)$row['phash_grouping'] . ' AND phash<>' . (int)$row['phash']);
-                               while ($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) {
-                                       $cHash = count(unserialize($row2['cHashParams'])) ? $this->formatCHash(unserialize($row2['cHashParams'])) : '';
-                                       $grListRec = $this->getGrlistRecord($row2['phash']);
-                                       $recList[] = array(
-                                               '',
-                                               '',
-                                               $this->getNumberOfWords($row2['phash']),
-                                               '',
-                                               BackendUtility::datetime($row2['crdate']),
-                                               $row2['tstamp'] != $row2['crdate'] ? BackendUtility::datetime($row2['tstamp']) : '',
-                                               $row2['parsetime'],
-                                               $this->getNumberOfSections($row2['phash']) . '/' . $grListRec[0]['pcount'] . '/' . $this->getNumberOfFulltext($row2['phash']),
-                                               '',
-                                               $cHash,
-                                               $row2['phash'],
-                                               ''
-                                       );
-                               }
-                       }
-               }
-               return $recList;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $fegroup_recs: ...
-        * @return      [type]          ...
-        */
-       public function formatFeGroup($fegroup_recs) {
-               $str = array();
-               foreach ($fegroup_recs as $row) {
-                       $str[] = $row['gr_list'] == '0,-1' ? 'NL' : $row['gr_list'];
-               }
-               arsort($str);
-               return implode('|', $str);
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $arr: ...
-        * @return      [type]          ...
-        */
-       public function formatCHash($arr) {
-               $list = array();
-               foreach ($arr as $k => $v) {
-                       $list[] = htmlspecialchars($k) . '=' . htmlspecialchars($v);
-               }
-               return implode('<br />', $list);
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $phash: ...
-        * @return      [type]          ...
-        */
-       public function getNumberOfSections($phash) {
-               return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_section', 'phash=' . (int)$phash);
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $phash: ...
-        * @return      [type]          ...
-        */
-       public function getNumberOfWords($phash) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_rel', 'phash=' . (int)$phash);
-               $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
-               return $row[0];
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $phash: ...
-        * @return      [type]          ...
-        */
-       public function getGrlistRecord($phash) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_grlist.*', 'index_grlist', 'phash=' . (int)$phash);
-               $allRows = array();
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $row['pcount'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
-                       $allRows[] = $row;
-               }
-               return $allRows;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $phash: ...
-        * @return      [type]          ...
-        */
-       public function getNumberOfFulltext($phash) {
-               return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_fulltext', 'phash=' . (int)$phash);
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function getPhashTypes() {
-               $recList = array();
-               // Types:
-               $Itypes = array(
-                       'html' => 1,
-                       'htm' => 1,
-                       'pdf' => 2,
-                       'doc' => 3,
-                       'txt' => 4
-               );
-               $revTypes = array_flip($Itypes);
-               $revTypes[0] = 'TYPO3 page';
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*),item_type', 'index_phash', '', 'item_type', 'item_type');
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
-                       $iT = $row[1];
-                       $recList[] = array($this->tableHead($revTypes[$iT] . ' (' . $iT . ')'), $this->countUniqueTypes($iT) . '/' . $row[0]);
-               }
-               return $recList;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $item_type: ...
-        * @return      [type]          ...
-        */
-       public function countUniqueTypes($item_type) {
-               // TYPO3 pages, unique
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_phash', 'item_type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($item_type, 'index_phash'), 'phash_grouping');
-               $items = array();
-               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
-                       $items[] = $row;
-               }
-               return count($items);
-       }
-
-}
index 7d6e62f..77607c8 100644 (file)
@@ -419,8 +419,8 @@ class CrawlerHook {
                                // Lookup old phash rows:
                                $oldPhashRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('phash', 'index_phash', 'freeIndexUid=' . (int)$cfgRec['uid'] . ' AND freeIndexSetId<>' . (int)$cfgRec['set_id']);
                                foreach ($oldPhashRows as $pHashRow) {
-                                       // Removing old registrations for all tables (code copied from \TYPO3\CMS\IndexedSearch\Controller\IndexedPagesController)
-                                       $tableArr = explode(',', 'index_phash,index_rel,index_section,index_grlist,index_fulltext,index_debug');
+                                       // Removing old registrations for all tables (code copied from \TYPO3\CMS\IndexedSearch\Domain\Repository\IndexedPagesController\AdministrationRepository)
+                                       $tableArr = array('index_phash', 'index_rel', 'index_section', 'index_grlist', 'index_fulltext', 'index_debug');
                                        foreach ($tableArr as $table) {
                                                $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'phash=' . (int)$pHashRow['phash']);
                                        }
index 82f192f..4a7c045 100644 (file)
@@ -4,25 +4,6 @@ defined('TYPO3_MODE') or die();
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Indexed Search (experimental)');
 
 if (TYPO3_MODE === 'BE') {
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
-               'tools',
-               'isearch',
-               'after:log',
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod/'
-       );
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
-               'web_info',
-               \TYPO3\CMS\IndexedSearch\Controller\IndexedPagesController::class,
-               NULL,
-               'LLL:EXT:indexed_search/locallang.xlf:mod_indexed_search'
-       );
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
-               'web_info',
-               \TYPO3\CMS\IndexedSearch\Controller\IndexingStatisticsController::class,
-               NULL,
-               'LLL:EXT:indexed_search/locallang.xlf:mod2_indexed_search'
-       );
-
        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
                'TYPO3.CMS.IndexedSearch',
                'web',
diff --git a/typo3/sysext/indexed_search/mod/clear.gif b/typo3/sysext/indexed_search/mod/clear.gif
deleted file mode 100644 (file)
index e1d2d83..0000000
Binary files a/typo3/sysext/indexed_search/mod/clear.gif and /dev/null differ
diff --git a/typo3/sysext/indexed_search/mod/conf.php b/typo3/sysext/indexed_search/mod/conf.php
deleted file mode 100644 (file)
index befea4f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-$MLANG['default']['tabs_images']['tab'] = '../Resources/Public/Icons/module-indexed_search.png';
-$MLANG['default']['ll_ref'] = 'LLL:EXT:indexed_search/mod/locallang_mod.xlf';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = 'admin';
-$MCONF['name'] = 'tools_isearch';
diff --git a/typo3/sysext/indexed_search/mod/index.php b/typo3/sysext/indexed_search/mod/index.php
deleted file mode 100644 (file)
index 9a1d872..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Module: Indexing Engine Overview
- */
-
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Controller\ModuleController::class);
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
diff --git a/typo3/sysext/indexed_search/mod/isearch.gif b/typo3/sysext/indexed_search/mod/isearch.gif
deleted file mode 100644 (file)
index 8f723c4..0000000
Binary files a/typo3/sysext/indexed_search/mod/isearch.gif and /dev/null differ
diff --git a/typo3/sysext/indexed_search/mod/mod_template.html b/typo3/sysext/indexed_search/mod/mod_template.html
deleted file mode 100644 (file)
index 5353a42..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- ###FULLDOC### begin -->
-<div class="typo3-fullDoc">
-       <div id="typo3-docheader">
-               <div class="typo3-docheader-functions">
-                       <div class="left">###FUNC_MENU###</div>
-                       <div class="right"></div>
-               </div>
-               <div class="typo3-docheader-buttons">
-                       <div class="left">###BUTTONLIST_LEFT###</div>
-                       <div class="right">###BUTTONLIST_RIGHT###</div>
-               </div>
-       </div>
-
-       <div id="typo3-docbody">
-               <div id="typo3-inner-docbody">
-                       ###CONTENT###
-               </div>
-       </div>
-</div>
-<!-- ###FULLDOC### end -->
-
-<!-- Grouping the icons on top -->
-
-<!-- ###BUTTON_GROUP_WRAP### -->
-       <div class="buttongroup">###BUTTONS###</div>
-<!-- ###BUTTON_GROUP_WRAP### -->
-
-<!-- ###BUTTON_GROUPS_LEFT### -->
-<!-- ###BUTTON_GROUP1### --><!-- ###BUTTON_GROUP1### -->
-<!-- ###BUTTON_GROUPS_LEFT### -->
-
-<!-- ###BUTTON_GROUPS_RIGHT### -->
-<!-- ###BUTTON_GROUP1### -->###SHORTCUT###<!-- ###BUTTON_GROUP1### -->
-<!-- ###BUTTON_GROUPS_RIGHT### -->