[!!!][TASK] Move indexed search pi1 to EXT:compatibility7 69/47469/9
authorBenni Mack <benni@typo3.org>
Thu, 31 Mar 2016 17:51:10 +0000 (19:51 +0200)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Fri, 1 Apr 2016 08:43:54 +0000 (10:43 +0200)
For further cleanups a new system extension is introduced
that will be moved in to TER before the release of 8 LTS.

Move indexed search pi-based plugin to compatibility7.

Resolves: #75349
Releases: master
Change-Id: I699dbb4b987df92e7dc81d8b5c65ff05b2e2a958
Reviewed-on: https://review.typo3.org/47469
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
23 files changed:
composer.json
composer.lock
typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php [new file with mode: 0755]
typo3/sysext/compatibility7/Configuration/TCA/tt_content.php [new file with mode: 0644]
typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php [new file with mode: 0644]
typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php [new file with mode: 0644]
typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl [new file with mode: 0644]
typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl [new file with mode: 0644]
typo3/sysext/compatibility7/composer.json [new file with mode: 0644]
typo3/sysext/compatibility7/ext_emconf.php [new file with mode: 0644]
typo3/sysext/compatibility7/ext_icon.png [new file with mode: 0644]
typo3/sysext/compatibility7/ext_localconf.php [new file with mode: 0644]
typo3/sysext/compatibility7/ext_tables.php [new file with mode: 0644]
typo3/sysext/compatibility7/ext_typoscript_setup.txt [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Breaking-75349-MoveIndexedSearchPi-basedPluginToCompatibility7.rst [new file with mode: 0644]
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php [deleted file]
typo3/sysext/indexed_search/Configuration/TCA/Overrides/tt_content.php
typo3/sysext/indexed_search/Resources/PHP/class.tx_indexed_search_pi_wizicon.php [deleted file]
typo3/sysext/indexed_search/Resources/Private/Templates/indexed_search.tmpl [deleted file]
typo3/sysext/indexed_search/Resources/Private/Templates/template_css.tmpl [deleted file]
typo3/sysext/indexed_search/ext_localconf.php
typo3/sysext/indexed_search/ext_tables.php
typo3/sysext/indexed_search/ext_typoscript_setup.txt [deleted file]

index 358910a..7082447 100644 (file)
@@ -83,6 +83,7 @@
                "typo3/cms-beuser": "self.version",
                "typo3/cms-context-help": "self.version",
                "typo3/cms-core": "self.version",
+               "typo3/cms-compatibility7": "self.version",
                "typo3/cms-cshmanual": "self.version",
                "typo3/cms-css-styled-content": "self.version",
                "typo3/cms-dbal": "self.version",
                        "TYPO3\\CMS\\Beuser\\": "typo3/sysext/beuser/Classes/",
                        "TYPO3\\CMS\\ContextHelp\\": "typo3/sysext/context_help/Classes/",
                        "TYPO3\\CMS\\Core\\": "typo3/sysext/core/Classes/",
+                       "TYPO3\\CMS\\Compatibility7\\": "typo3/sysext/compatibility7/Classes/",
                        "TYPO3\\CMS\\Cshmanual\\": "typo3/sysext/cshmanual/Classes/",
                        "TYPO3\\CMS\\CssStyledContent\\": "typo3/sysext/css_styled_content/Classes/",
                        "TYPO3\\CMS\\Dbal\\": "typo3/sysext/dbal/Classes/",
index 7a663b4..ec1b3f1 100644 (file)
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "e346427bb60ae5bf1fb7c5b6128dd888",
-    "content-hash": "d9d04a98027086cd867bb7dbff748e7a",
+    "hash": "52d9a34249e63fd04a6a0380c22c1d7b",
+    "content-hash": "603929cd9797026c25345778b263653f",
     "packages": [
         {
             "name": "cogpowered/finediff",
diff --git a/typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php b/typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php
new file mode 100755 (executable)
index 0000000..e110b85
--- /dev/null
@@ -0,0 +1,2485 @@
+<?php
+namespace TYPO3\CMS\Compatibility7\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\Charset\CharsetConverter;
+use TYPO3\CMS\Core\Html\HtmlParser;
+use TYPO3\CMS\Core\TimeTracker\TimeTracker;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\MathUtility;
+use TYPO3\CMS\IndexedSearch\Utility;
+
+/**
+ * Index search frontend
+ *
+ * Creates a searchform for indexed search. Indexing must be enabled
+ * for this to make sense.
+ */
+class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
+{
+    /**
+     * Used as fieldname prefix
+     *
+     * @var string
+     */
+    public $prefixId = 'tx_indexedsearch';
+
+    /**
+     * Extension key.
+     *
+     * @var string
+     */
+    public $extKey = 'indexed_search';
+
+    /**
+     * See document for info about this flag...
+     *
+     * @var int
+     */
+    public $join_pages = 0;
+
+    public $defaultResultNumber = 10;
+
+    /**
+     * Internal variable
+     *
+     * @var array
+     */
+    public $operator_translate_table = array(array('+', 'AND'), array('|', 'OR'), array('-', 'AND NOT'));
+
+    /**
+     * Root-page ids to search in (rl0 field where clause, see initialize() function)
+     *
+     * @var int|string id or comma separated list of ids
+     */
+    public $wholeSiteIdList = 0;
+
+    /**
+     * Search Words and operators
+     *
+     * @var array
+     */
+    public $sWArr = array();
+
+    /**
+     * Selector box values for search configuration form
+     *
+     * @var array
+     */
+    public $optValues = array();
+
+    /**
+     * Will hold the first row in result - used to calculate relative hit-ratings.
+     *
+     * @var array
+     */
+    public $firstRow = array();
+
+    /**
+     * Caching of page path
+     *
+     * @var array
+     */
+    public $cache_path = array();
+
+    /**
+     * Caching of root line data
+     *
+     * @var array
+     */
+    public $cache_rl = array();
+
+    /**
+     * Required fe_groups memberships for display of a result.
+     *
+     * @var array
+     */
+    public $fe_groups_required = array();
+
+    /**
+     * sys_domain records
+     *
+     * @var array
+     */
+    public $domain_records = array();
+
+    /**
+     * Select clauses for individual words
+     *
+     * @var array
+     */
+    public $wSelClauses = array();
+
+    /**
+     * Page tree sections for search result.
+     *
+     * @var array
+     */
+    public $resultSections = array();
+
+    /**
+     * External parser objects
+     * @var array
+     */
+    public $external_parsers = array();
+
+    /**
+     * Storage of icons....
+     *
+     * @var array
+     */
+    public $iconFileNameCache = array();
+
+    /**
+     * Will hold the content of $conf['templateFile']
+     *
+     * @var string
+     */
+    public $templateCode = '';
+
+    public $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results';
+
+    /**
+     * Indexer configuration, coming from $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']
+     *
+     * @var array
+     */
+    public $indexerConfig = array();
+
+    /**
+     * @var bool
+     */
+    public $enableMetaphoneSearch = false;
+
+    public $storeMetaphoneInfoAsWords;
+
+    /**
+     * Lexer object
+     *
+     * @var \TYPO3\CMS\IndexedSearch\Lexer
+     */
+    public $lexerObj;
+
+    /**
+     * @var TimeTracker
+     */
+    protected $timeTracker;
+
+    /**
+     * @var CharsetConverter
+     */
+    protected $charsetConverter;
+
+    /**
+     * Main function, called from TypoScript as a USER_INT object.
+     *
+     * @param string $content Content input, ignore (just put blank string)
+     * @param array $conf TypoScript configuration of the plugin!
+     * @return string HTML code for the search form / result display.
+     */
+    public function main($content, $conf)
+    {
+        // Initialize:
+        $this->charsetConverter = GeneralUtility::makeInstance(CharsetConverter::class);
+        $this->conf = $conf;
+        $this->pi_loadLL('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf');
+        $this->pi_setPiVarDefaults();
+        // Initialize:
+        $this->initialize();
+        // Do search:
+        // If there were any search words entered...
+        if (is_array($this->sWArr) && !empty($this->sWArr)) {
+            $content = $this->doSearch($this->sWArr);
+        }
+        // Finally compile all the content, form, messages and results:
+        $content = $this->makeSearchForm($this->optValues) . $this->printRules() . $content;
+        return $this->pi_wrapInBaseClass($content);
+    }
+
+    /**
+     * Initialize internal variables, especially selector box values for the search form and search words
+     *
+     * @return void
+     */
+    public function initialize()
+    {
+        // Indexer configuration from Extension Manager interface:
+        $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
+        $this->enableMetaphoneSearch = (bool)$this->indexerConfig['enableMetaphoneSearch'];
+        $this->storeMetaphoneInfoAsWords = !\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_words');
+        $this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class);
+        // Initialize external document parsers for icon display and other soft operations
+        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]);
+                }
+            }
+        }
+        // Init lexer (used to post-processing of search words)
+        $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class;
+        $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
+        // If "_sections" is set, this value overrides any existing value.
+        if ($this->piVars['_sections']) {
+            $this->piVars['sections'] = $this->piVars['_sections'];
+        }
+        // If "_sections" is set, this value overrides any existing value.
+        if ($this->piVars['_freeIndexUid'] !== '_') {
+            $this->piVars['freeIndexUid'] = $this->piVars['_freeIndexUid'];
+        }
+        // Add previous search words to current
+        if ($this->piVars['sword_prev_include'] && $this->piVars['sword_prev']) {
+            $this->piVars['sword'] = trim($this->piVars['sword_prev']) . ' ' . $this->piVars['sword'];
+        }
+        $this->piVars['results'] = MathUtility::forceIntegerInRange($this->piVars['results'], 1, 100, $this->defaultResultNumber);
+        // Make sure that some cropping and markup constants used later are defined
+        $this->loadSettings();
+
+        // Selector-box values defined here:
+        $this->optValues = array(
+            'type' => array(
+                '0' => $this->pi_getLL('opt_type_0'),
+                '1' => $this->pi_getLL('opt_type_1'),
+                '2' => $this->pi_getLL('opt_type_2'),
+                '3' => $this->pi_getLL('opt_type_3'),
+                '10' => $this->pi_getLL('opt_type_10'),
+                '20' => $this->pi_getLL('opt_type_20')
+            ),
+            'defOp' => array(
+                '0' => $this->pi_getLL('opt_defOp_0'),
+                '1' => $this->pi_getLL('opt_defOp_1')
+            ),
+            'sections' => array(
+                '0' => $this->pi_getLL('opt_sections_0'),
+                '-1' => $this->pi_getLL('opt_sections_-1'),
+                '-2' => $this->pi_getLL('opt_sections_-2'),
+                '-3' => $this->pi_getLL('opt_sections_-3')
+            ),
+            'freeIndexUid' => array(
+                '-1' => $this->pi_getLL('opt_freeIndexUid_-1'),
+                '-2' => $this->pi_getLL('opt_freeIndexUid_-2'),
+                '0' => $this->pi_getLL('opt_freeIndexUid_0')
+            ),
+            'media' => array(
+                '-1' => $this->pi_getLL('opt_media_-1'),
+                '0' => $this->pi_getLL('opt_media_0'),
+                '-2' => $this->pi_getLL('opt_media_-2')
+            ),
+            'order' => array(
+                'rank_flag' => $this->pi_getLL('opt_order_rank_flag'),
+                'rank_freq' => $this->pi_getLL('opt_order_rank_freq'),
+                'rank_first' => $this->pi_getLL('opt_order_rank_first'),
+                'rank_count' => $this->pi_getLL('opt_order_rank_count'),
+                'mtime' => $this->pi_getLL('opt_order_mtime'),
+                'title' => $this->pi_getLL('opt_order_title'),
+                'crdate' => $this->pi_getLL('opt_order_crdate')
+            ),
+            'group' => array(
+                'sections' => $this->pi_getLL('opt_group_sections'),
+                'flat' => $this->pi_getLL('opt_group_flat')
+            ),
+            'lang' => array(
+                -1 => $this->pi_getLL('opt_lang_-1'),
+                0 => $this->pi_getLL('opt_lang_0')
+            ),
+            'desc' => array(
+                '0' => $this->pi_getLL('opt_desc_0'),
+                '1' => $this->pi_getLL('opt_desc_1')
+            ),
+            'results' => array(
+                '10' => '10',
+                '20' => '20',
+                '50' => '50',
+                '100' => '100'
+            )
+        );
+        // Remove this option if metaphone search is disabled)
+        if (!$this->enableMetaphoneSearch) {
+            unset($this->optValues['type']['10']);
+        }
+        // Free Index Uid:
+        if ($this->conf['search.']['defaultFreeIndexUidList']) {
+            $uidList = GeneralUtility::intExplode(',', $this->conf['search.']['defaultFreeIndexUidList']);
+            $indexCfgRecords = $this->databaseConnection->exec_SELECTgetRows('uid,title', 'index_config', 'uid IN (' . implode(',', $uidList) . ')' . $this->cObj->enableFields('index_config'), '', '', '', 'uid');
+            foreach ($uidList as $uidValue) {
+                if (is_array($indexCfgRecords[$uidValue])) {
+                    $this->optValues['freeIndexUid'][$uidValue] = $indexCfgRecords[$uidValue]['title'];
+                }
+            }
+        }
+        // Should we use join_pages instead of long lists of uids?
+        if ($this->conf['search.']['skipExtendToSubpagesChecking']) {
+            $this->join_pages = 1;
+        }
+        // Add media to search in:
+        if (trim($this->conf['search.']['mediaList']) !== '') {
+            $mediaList = implode(',', GeneralUtility::trimExplode(',', $this->conf['search.']['mediaList'], true));
+        }
+        foreach ($this->external_parsers as $extension => $obj) {
+            // Skip unwanted extensions
+            if ($mediaList && !GeneralUtility::inList($mediaList, $extension)) {
+                continue;
+            }
+            if ($name = $obj->searchTypeMediaTitle($extension)) {
+                $this->optValues['media'][$extension] = $this->pi_getLL('opt_sections_' . $extension, $name);
+            }
+        }
+        // Add operators for various languages
+        // Converts the operators to lowercase
+        $this->operator_translate_table[] = array($this->charsetConverter->conv_case('utf-8', $this->pi_getLL('local_operator_AND'), 'toLower'), 'AND');
+        $this->operator_translate_table[] = array($this->charsetConverter->conv_case('utf-8', $this->pi_getLL('local_operator_OR'), 'toLower'), 'OR');
+        $this->operator_translate_table[] = array($this->charsetConverter->conv_case('utf-8', $this->pi_getLL('local_operator_NOT'), 'toLower'), 'AND NOT');
+        // This is the id of the site root. This value may be a commalist of integer (prepared for this)
+        $this->wholeSiteIdList = (int)$this->frontendController->config['rootLine'][0]['uid'];
+        // Creating levels for section menu:
+        // This selects the first and secondary menus for the "sections" selector - so we can search in sections and sub sections.
+        if ($this->conf['show.']['L1sections']) {
+            $firstLevelMenu = $this->getMenu($this->wholeSiteIdList);
+            foreach ($firstLevelMenu as $optionName => $mR) {
+                if (!$mR['nav_hide']) {
+                    $this->optValues['sections']['rl1_' . $mR['uid']] = trim($this->pi_getLL('opt_RL1') . ' ' . $mR['title']);
+                    if ($this->conf['show.']['L2sections']) {
+                        $secondLevelMenu = $this->getMenu($mR['uid']);
+                        foreach ($secondLevelMenu as $kk2 => $mR2) {
+                            if (!$mR2['nav_hide']) {
+                                $this->optValues['sections']['rl2_' . $mR2['uid']] = trim($this->pi_getLL('opt_RL2') . ' ' . $mR2['title']);
+                            } else {
+                                unset($secondLevelMenu[$kk2]);
+                            }
+                        }
+                        $this->optValues['sections']['rl2_' . implode(',', array_keys($secondLevelMenu))] = $this->pi_getLL('opt_RL2ALL');
+                    }
+                } else {
+                    unset($firstLevelMenu[$optionName]);
+                }
+            }
+            $this->optValues['sections']['rl1_' . implode(',', array_keys($firstLevelMenu))] = $this->pi_getLL('opt_RL1ALL');
+        }
+        // Setting the list of root IDs for the search. Notice, these page IDs MUST have a TypoScript template with root flag on them! Basically this list is used to select on the "rl0" field and page ids are registered as "rl0" only if a TypoScript template record with root flag is there.
+        // This happens AFTER the use of $this->wholeSiteIdList above because the above will then fetch the menu for the CURRENT site - regardless of this kind of searching here. Thus a general search will lookup in the WHOLE database while a specific section search will take the current sections...
+        if ($this->conf['search.']['rootPidList']) {
+            $this->wholeSiteIdList = implode(',', GeneralUtility::intExplode(',', $this->conf['search.']['rootPidList']));
+        }
+        // Load the template
+        $this->templateCode = $this->cObj->fileResource($this->conf['templateFile']);
+        // Add search languages:
+        $res = $this->databaseConnection->exec_SELECTquery('*', 'sys_language', '1=1' . $this->cObj->enableFields('sys_language'));
+        while (false !== ($data = $this->databaseConnection->sql_fetch_assoc($res))) {
+            $this->optValues['lang'][$data['uid']] = $data['title'];
+        }
+        $this->databaseConnection->sql_free_result($res);
+        // Calling hook for modification of initialized content
+        if ($hookObj = $this->hookRequest('initialize_postProc')) {
+            $hookObj->initialize_postProc();
+        }
+        // Default values set:
+        // Setting first values in optValues as default values IF there is not corresponding piVar value set already.
+        foreach ($this->optValues as $optionName => $optionValue) {
+            if (!isset($this->piVars[$optionName])) {
+                reset($optionValue);
+                $this->piVars[$optionName] = key($optionValue);
+            }
+        }
+        // Blind selectors:
+        if (is_array($this->conf['blind.'])) {
+            foreach ($this->conf['blind.'] as $optionName => $optionValue) {
+                if (is_array($optionValue)) {
+                    foreach ($optionValue as $optionValueSubKey => $optionValueSubValue) {
+                        if (!is_array($optionValueSubValue) && $optionValueSubValue && is_array($this->optValues[substr($optionName, 0, -1)])) {
+                            unset($this->optValues[substr($optionName, 0, -1)][$optionValueSubKey]);
+                        }
+                    }
+                } elseif ($optionValue) {
+                    // If value is not set, unset the option array
+                    unset($this->optValues[$optionName]);
+                }
+            }
+        }
+        // This gets the search-words into the $sWArr:
+        $this->sWArr = $this->getSearchWords($this->piVars['defOp']);
+    }
+
+    /**
+     * Splits the search word input into an array where each word is represented by an array with key "sword" holding the search word and key "oper" holding the SQL operator (eg. AND, OR)
+     *
+     * Only words with 2 or more characters are accepted
+     * Max 200 chars total
+     * Space is used to split words, "" can be used search for a whole string
+     * AND, OR and NOT are prefix words, overruling the default operator
+     * +/|/- equals AND, OR and NOT as operators.
+     * All search words are converted to lowercase.
+     *
+     * $defOp is the default operator. 1=OR, 0=AND
+     *
+     * @param bool $defOp If TRUE, the default operator will be OR, not AND
+     * @return array Returns array with search words if any found
+     */
+    public function getSearchWords($defOp)
+    {
+        // Shorten search-word string to max 200 bytes (does NOT take multibyte charsets into account - but never mind, shortening the string here is only a run-away feature!)
+        $inSW = substr($this->piVars['sword'], 0, 200);
+        // Convert to UTF-8 + conv. entities (was also converted during indexing!)
+        $inSW = $this->charsetConverter->conv($inSW, $this->frontendController->metaCharset, 'utf-8');
+        $inSW = $this->charsetConverter->entities_to_utf8($inSW);
+        $sWordArray = false;
+        if ($hookObj = $this->hookRequest('getSearchWords')) {
+            $sWordArray = $hookObj->getSearchWords_splitSWords($inSW, $defOp);
+        } else {
+            if ($this->piVars['type'] == 20) {
+                // type = Sentence
+                $sWordArray = array(array('sword' => trim($inSW), 'oper' => 'AND'));
+            } else {
+                $searchWords = \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::getExplodedSearchString($inSW, $defOp == 1 ? 'OR' : 'AND', $this->operator_translate_table);
+                if (is_array($searchWords)) {
+                    $sWordArray = $this->procSearchWordsByLexer($searchWords);
+                }
+            }
+        }
+        return $sWordArray;
+    }
+
+    /**
+     * Post-process the search word array so it will match the words that was indexed (including case-folding if any)
+     * If any words are split into multiple words (eg. CJK will be!) the operator of the main word will remain.
+     *
+     * @param array $SWArr Search word array
+     * @return array Search word array, processed through lexer
+     */
+    public function procSearchWordsByLexer($SWArr)
+    {
+        // Init output variable:
+        $newSWArr = array();
+        // Traverse the search word array:
+        foreach ($SWArr as $wordDef) {
+            if (!strstr($wordDef['sword'], ' ')) {
+                // No space in word (otherwise it might be a sentense in quotes like "there is").
+                // Split the search word by lexer:
+                $res = $this->lexerObj->split2Words($wordDef['sword']);
+                // Traverse lexer result and add all words again:
+                foreach ($res as $word) {
+                    $newSWArr[] = array('sword' => $word, 'oper' => $wordDef['oper']);
+                }
+            } else {
+                $newSWArr[] = $wordDef;
+            }
+        }
+        // Return result:
+        return $newSWArr;
+    }
+
+    /*****************************
+     *
+     * Main functions
+     *
+     *****************************/
+    /**
+     * Performs the search, the display and writing stats
+     *
+     * @param array $sWArr Search words in array, see ->getSearchWords() for details
+     * @return string HTML for result display.
+     */
+    public function doSearch($sWArr)
+    {
+        // Find free index uid:
+        $freeIndexUid = $this->piVars['freeIndexUid'];
+        if ($freeIndexUid == -2) {
+            $freeIndexUid = $this->conf['search.']['defaultFreeIndexUidList'];
+        }
+        $indexCfgs = GeneralUtility::intExplode(',', $freeIndexUid);
+        $accumulatedContent = '';
+        foreach ($indexCfgs as $freeIndexUid) {
+            // Get result rows:
+            $pt1 = GeneralUtility::milliseconds();
+            if ($hookObj = $this->hookRequest('getResultRows')) {
+                $resData = $hookObj->getResultRows($sWArr, $freeIndexUid);
+            } else {
+                $resData = $this->getResultRows($sWArr, $freeIndexUid);
+            }
+            // Display search results:
+            $pt2 = GeneralUtility::milliseconds();
+            if ($hookObj = $this->hookRequest('getDisplayResults')) {
+                $content = $hookObj->getDisplayResults($sWArr, $resData, $freeIndexUid);
+            } else {
+                $content = $this->getDisplayResults($sWArr, $resData, $freeIndexUid);
+            }
+            $pt3 = GeneralUtility::milliseconds();
+            // Create header if we are searching more than one indexing configuration:
+            if (count($indexCfgs) > 1) {
+                if ($freeIndexUid > 0) {
+                    $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('title', 'index_config', 'uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
+                    $titleString = $indexCfgRec['title'];
+                } else {
+                    $titleString = $this->pi_getLL('opt_freeIndexUid_header_' . $freeIndexUid);
+                }
+                $content = '<h1 class="tx-indexedsearch-category">' . htmlspecialchars($titleString) . '</h1>' . $content;
+            }
+            $accumulatedContent .= $content;
+        }
+        // Write search statistics
+        $this->writeSearchStat($sWArr, $resData['count'], array($pt1, $pt2, $pt3));
+        // Return content:
+        return $accumulatedContent;
+    }
+
+    /**
+     * Get search result rows / data from database. Returned as data in array.
+     *
+     * @param array $searchWordArray Search word array
+     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
+     * @return array False if no result, otherwise an array with keys for first row, result rows and total number of results found.
+     */
+    public function getResultRows($searchWordArray, $freeIndexUid = -1)
+    {
+        // Getting SQL result pointer. This fetches ALL results (1,000,000 if found)
+        $this->timeTracker->push('Searching result');
+        if ($hookObj = &$this->hookRequest('getResultRows_SQLpointer')) {
+            $res = $hookObj->getResultRows_SQLpointer($searchWordArray, $freeIndexUid);
+        } else {
+            $res = $this->getResultRows_SQLpointer($searchWordArray, $freeIndexUid);
+        }
+        $this->timeTracker->pull();
+        // Organize and process result:
+        $result = false;
+        if ($res) {
+            $totalSearchResultCount = $this->databaseConnection->sql_num_rows($res);
+            // Total search-result count
+            $currentPageNumber = MathUtility::forceIntegerInRange($this->piVars['pointer'], 0, floor($totalSearchResultCount / $this->piVars['results']));
+            // The pointer is set to the result page that is currently being viewed
+            // Initialize result accumulation variables:
+            $positionInSearchResults = 0;
+            $groupingPhashes = array();
+            // Used for filtering out duplicates
+            $groupingChashes = array();
+            // Used for filtering out duplicates BASED ON cHash
+            $firstRow = array();
+            // Will hold the first row in result - used to calculate relative hit-ratings.
+            $resultRows = array();
+            // Will hold the results rows for display.
+            // Should we continue counting and checking of results even if
+            // we are sure they are not displayed in this request?
+            // This will slow down your page rendering, but it allows
+            // precise search result counters.
+            $calculateExactCount = (bool)$this->conf['search.']['exactCount'];
+            $lastResultNumberOnPreviousPage = $currentPageNumber * $this->piVars['results'];
+            $firstResultNumberOnNextPage = ($currentPageNumber + 1) * $this->piVars['results'];
+            $lastResultNumberToAnalyze = ($currentPageNumber + 1) * $this->piVars['results'] + $this->piVars['results'];
+            // Now, traverse result and put the rows to be displayed into an array
+            // Each row should contain the fields from 'ISEC.*, IP.*' combined + artificial fields "show_resume" (bool) and "result_number" (counter)
+            while (false !== ($row = $this->databaseConnection->sql_fetch_assoc($res))) {
+                // Set first row:
+                if ($positionInSearchResults === 0) {
+                    $firstRow = $row;
+                }
+                $row['show_resume'] = $this->checkResume($row);
+                // Tells whether we can link directly to a document or not (depends on possible right problems)
+                $phashGr = !in_array($row['phash_grouping'], $groupingPhashes);
+                $chashGr = !in_array(($row['contentHash'] . '.' . $row['data_page_id']), $groupingChashes);
+                if ($phashGr && $chashGr) {
+                    if ($row['show_resume'] || $this->conf['show.']['forbiddenRecords']) {
+                        // Only if the resume may be shown are we going to filter out duplicates...
+                        if (!$this->multiplePagesType($row['item_type'])) {
+                            // Only on documents which are not multiple pages documents
+                            $groupingPhashes[] = $row['phash_grouping'];
+                        }
+                        $groupingChashes[] = $row['contentHash'] . '.' . $row['data_page_id'];
+                        $positionInSearchResults++;
+                        // Check if we are inside result range for current page
+                        if ($positionInSearchResults > $lastResultNumberOnPreviousPage && $positionInSearchResults <= $lastResultNumberToAnalyze) {
+                            // Collect results to display
+                            $row['result_number'] = $positionInSearchResults;
+                            $resultRows[] = $row;
+                            // This may lead to a problem: If the result
+                            // check is not stopped here, the search will
+                            // take longer. However the result counter
+                            // will not filter out grouped cHashes/pHashes
+                            // that were not processed yet. You can change
+                            // this behavior using the "search.exactCount"
+                            // property (see above).
+                            $nextResultPosition = $positionInSearchResults + 1;
+                            if (!$calculateExactCount && $nextResultPosition > $firstResultNumberOnNextPage) {
+                                break;
+                            }
+                        }
+                    } else {
+                        // Skip this row if the user cannot view it (missing permission)
+                        $totalSearchResultCount--;
+                    }
+                } else {
+                    // For each time a phash_grouping document is found
+                    // (which is thus not displayed) the search-result count
+                    // is reduced, so that it matches the number of rows displayed.
+                    $totalSearchResultCount--;
+                }
+            }
+            $this->databaseConnection->sql_free_result($res);
+            $result = array(
+                'resultRows' => $resultRows,
+                'firstRow' => $firstRow,
+                'count' => $totalSearchResultCount
+            );
+        }
+        return $result;
+    }
+
+    /**
+     * Gets a SQL result pointer to traverse for the search records.
+     *
+     * @param array $sWArr Search words
+     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
+     * @return bool|\mysqli_result Query result pointer
+     */
+    public function getResultRows_SQLpointer($sWArr, $freeIndexUid = -1)
+    {
+        // This SEARCHES for the searchwords in $sWArr AND returns a COMPLETE list of phash-integers of the matches.
+        $list = $this->getPhashList($sWArr);
+        // Perform SQL Search / collection of result rows array:
+        if ($list) {
+            // Do the search:
+            $this->timeTracker->push('execFinalQuery');
+            $res = $this->execFinalQuery($list, $freeIndexUid);
+            $this->timeTracker->pull();
+            return $res;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Compiles the HTML display of the incoming array of result rows.
+     *
+     * @param array $sWArr Search words array (for display of text describing what was searched for)
+     * @param array $resData Array with result rows, count, first row.
+     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
+     * @return string HTML content to display result.
+     */
+    public function getDisplayResults($sWArr, $resData, $freeIndexUid = -1)
+    {
+        $content = '';
+        // Perform display of result rows array:
+        if ($resData) {
+            $this->timeTracker->push('Display Final result');
+            // Set first selected row (for calculation of ranking later)
+            $this->firstRow = $resData['firstRow'];
+            // Result display here:
+            $rowcontent = '';
+            $rowcontent .= $this->compileResult($resData['resultRows'], $freeIndexUid);
+            // Browsing box:
+            if ($resData['count']) {
+                $this->internal['res_count'] = $resData['count'];
+                $this->internal['results_at_a_time'] = $this->piVars['results'];
+                $this->internal['maxPages'] = MathUtility::forceIntegerInRange($this->conf['search.']['page_links'], 1, 100, 10);
+                $resultSectionsCount = count($this->resultSections);
+                $addString = $resData['count'] && $this->piVars['group'] == 'sections' && $freeIndexUid <= 0 ? ' ' . sprintf($this->pi_getLL(($resultSectionsCount > 1 ? 'inNsections' : 'inNsection')), $resultSectionsCount) : '';
+                $browseBox1 = $this->renderPagination(1, $addString, $this->printResultSectionLinks(), $freeIndexUid);
+                $browseBox2 = $this->renderPagination(0, '', '', $freeIndexUid);
+                // Browsing nav, bottom.
+                $content = $browseBox1 . $rowcontent . $browseBox2;
+            } else {
+                $content = '<p' . $this->pi_classParam('noresults') . '>' . $this->pi_getLL('noResults', '', true) . '</p>';
+            }
+            $this->timeTracker->pull();
+        } else {
+            $content .= '<p' . $this->pi_classParam('noresults') . '>' . $this->pi_getLL('noResults', '', true) . '</p>';
+        }
+        // Print a message telling which words we searched for, and in which sections etc.
+        $what = $this->tellUsWhatIsSeachedFor($sWArr) . (substr($this->piVars['sections'], 0, 2) == 'rl' ? ' ' . $this->pi_getLL('inSection', '', true) . ' "' . $this->getPathFromPageId(substr($this->piVars['sections'], 4)) . '"' : '');
+        $what = '<div' . $this->pi_classParam('whatis') . '>' . $this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']) . '</div>';
+        $content = $what . $content;
+        // Return content:
+        return $content;
+    }
+
+    /**
+     * Takes the array with resultrows as input and returns the result-HTML-code
+     * Takes the "group" var into account: Makes a "section" or "flat" display.
+     *
+     * @param array $resultRows Result rows
+     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
+     * @return string HTML
+     */
+    public function compileResult($resultRows, $freeIndexUid = -1)
+    {
+        $content = '';
+        // Transfer result rows to new variable, performing some mapping of sub-results etc.
+        $newResultRows = array();
+        foreach ($resultRows as $row) {
+            $id = md5($row['phash_grouping']);
+            if (is_array($newResultRows[$id])) {
+                if (!$newResultRows[$id]['show_resume'] && $row['show_resume']) {
+                    // swapping:
+                    // Remove old
+                    $subrows = $newResultRows[$id]['_sub'];
+                    unset($newResultRows[$id]['_sub']);
+                    $subrows[] = $newResultRows[$id];
+                    // Insert new:
+                    $newResultRows[$id] = $row;
+                    $newResultRows[$id]['_sub'] = $subrows;
+                } else {
+                    $newResultRows[$id]['_sub'][] = $row;
+                }
+            } else {
+                $newResultRows[$id] = $row;
+            }
+        }
+        $resultRows = $newResultRows;
+        $this->resultSections = array();
+        if ($freeIndexUid <= 0) {
+            switch ($this->piVars['group']) {
+                case 'sections':
+                    $rl2flag = substr($this->piVars['sections'], 0, 2) == 'rl';
+                    $sections = array();
+                    foreach ($resultRows as $row) {
+                        $id = $row['rl0'] . '-' . $row['rl1'] . ($rl2flag ? '-' . $row['rl2'] : '');
+                        $sections[$id][] = $row;
+                    }
+                    $this->resultSections = array();
+                    foreach ($sections as $id => $resultRows) {
+                        $rlParts = explode('-', $id);
+                        $theId = $rlParts[2] ? $rlParts[2] : ($rlParts[1] ? $rlParts[1] : $rlParts[0]);
+                        $theRLid = $rlParts[2] ? 'rl2_' . $rlParts[2] : ($rlParts[1] ? 'rl1_' . $rlParts[1] : '0');
+                        $sectionName = $this->getPathFromPageId($theId);
+                        if ($sectionName[0] == '/') {
+                            $sectionName = substr($sectionName, 1);
+                        }
+                        if (!trim($sectionName)) {
+                            $sectionTitleLinked = $this->pi_getLL('unnamedSection', '', true) . ':';
+                        } elseif ($this->conf['linkSectionTitles']) {
+                            $quotedPrefix = GeneralUtility::quoteJSvalue($this->prefixId);
+                            $onclick = 'document.forms[' . $quotedPrefix . '][' . GeneralUtility::quoteJSvalue($this->prefixId . '[_sections]') . '].value=' . GeneralUtility::quoteJSvalue($theRLid) . ';document.forms[' . $quotedPrefix . '].submit();return false;';
+                            $sectionTitleLinked = '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $sectionName . ':</a>';
+                        } else {
+                            $sectionTitleLinked = $sectionName;
+                        }
+                        $resultRowsCount = count($resultRows);
+                        $this->resultSections[$id] = array($sectionName, $resultRowsCount);
+                        // Add content header:
+                        $content .= $this->makeSectionHeader($id, $sectionTitleLinked, $resultRowsCount);
+                        // Render result rows:
+                        $resultlist = '';
+                        foreach ($resultRows as $row) {
+                            $resultlist .= $this->printResultRow($row);
+                        }
+                        $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']);
+                    }
+                    break;
+                default:
+                    // flat:
+                    $resultlist = '';
+                    foreach ($resultRows as $row) {
+                        $resultlist .= $this->printResultRow($row);
+                    }
+                    $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']);
+            }
+        } else {
+            $resultlist = '';
+            foreach ($resultRows as $row) {
+                $resultlist .= $this->printResultRow($row);
+            }
+            $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']);
+        }
+        return '<div' . $this->pi_classParam('res') . '>' . $content . '</div>';
+    }
+
+    /***********************************
+     *
+     * Searching functions (SQL)
+     *
+     ***********************************/
+    /**
+     * Returns a COMPLETE list of phash-integers matching the search-result composed of the search-words in the sWArr array.
+     * The list of phash integers are unsorted and should be used for subsequent selection of index_phash records for display of the result.
+     *
+     * @param array $sWArr Search word array
+     * @return string List of integers
+     */
+    public function getPhashList($sWArr)
+    {
+        // Initialize variables:
+        $c = 0;
+        $totalHashList = array();
+        // This array accumulates the phash-values
+        // Traverse searchwords; for each, select all phash integers and merge/diff/intersect them with previous word (based on operator)
+        foreach ($sWArr as $k => $v) {
+            // Making the query for a single search word based on the search-type
+            $sWord = $v['sword'];
+            $theType = (string)$this->piVars['type'];
+            if (strstr($sWord, ' ')) {
+                // If there are spaces in the search-word, make a full text search instead.
+                $theType = 20;
+            }
+            $this->timeTracker->push('SearchWord "' . $sWord . '" - $theType=' . $theType);
+            // Perform search for word:
+            switch ($theType) {
+                case '1':
+                    // Part of word
+                    $res = $this->searchWord($sWord, Utility\LikeWildcard::BOTH);
+                    break;
+                case '2':
+                    // First part of word
+                    $res = $this->searchWord($sWord, Utility\LikeWildcard::RIGHT);
+                    break;
+                case '3':
+                    // Last part of word
+                    $res = $this->searchWord($sWord, Utility\LikeWildcard::LEFT);
+                    break;
+                case '10':
+                    // Sounds like
+                    /**
+                    * Indexer object
+                    *
+                    * @var \TYPO3\CMS\IndexedSearch\Indexer
+                    */
+                    // Initialize the indexer-class
+                    $indexerObj = GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class);
+                    // Perform metaphone search
+                    $res = $this->searchMetaphone($indexerObj->metaphone($sWord, $this->storeMetaphoneInfoAsWords));
+                    unset($indexerObj);
+                    break;
+                case '20':
+                    // Sentence
+                    $res = $this->searchSentence($sWord);
+                    $this->piVars['order'] = 'mtime';
+                    // If there is a fulltext search for a sentence there is a likeliness that sorting cannot be done by the rankings from the rel-table (because no relations will exist for the sentence in the word-table). So therefore mtime is used instead. It is not required, but otherwise some hits may be left out.
+                    break;
+                default:
+                    // Distinct word
+                    $res = $this->searchDistinct($sWord);
+            }
+            // If there was a query to do, then select all phash-integers which resulted from this.
+            if ($res) {
+                // Get phash list by searching for it:
+                $phashList = array();
+                while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
+                    $phashList[] = $row['phash'];
+                }
+                $this->databaseConnection->sql_free_result($res);
+                // Here the phash list are merged with the existing result based on whether we are dealing with OR, NOT or AND operations.
+                if ($c) {
+                    switch ($v['oper']) {
+                        case 'OR':
+                            $totalHashList = array_unique(array_merge($phashList, $totalHashList));
+                            break;
+                        case 'AND NOT':
+                            $totalHashList = array_diff($totalHashList, $phashList);
+                            break;
+                        default:
+                            // AND...
+                            $totalHashList = array_intersect($totalHashList, $phashList);
+                    }
+                } else {
+                    $totalHashList = $phashList;
+                }
+            }
+            $this->timeTracker->pull();
+            $c++;
+        }
+        return implode(',', $totalHashList);
+    }
+
+    /**
+     * Returns a query which selects the search-word from the word/rel tables.
+     *
+     * @param string $wordSel WHERE clause selecting the word from phash
+     * @param string $plusQ Additional AND clause in the end of the query.
+     * @return bool|\mysqli_result SQL result pointer
+     */
+    public function execPHashListQuery($wordSel, $plusQ = '')
+    {
+        return $this->databaseConnection->exec_SELECTquery('IR.phash', 'index_words IW,
+                                               index_rel IR,
+                                               index_section ISEC', $wordSel . '
+                                               AND IW.wid=IR.wid
+                                               AND ISEC.phash = IR.phash
+                                               ' . $this->sectionTableWhere() . '
+                                               ' . $plusQ, 'IR.phash');
+    }
+
+    /**
+     * Search for a word
+     *
+     * @param string $sWord Word to search for
+     * @param int $wildcard Bit-field of Utility\LikeWildcard
+     * @return bool|\mysqli_result SQL result pointer
+     */
+    public function searchWord($sWord, $wildcard)
+    {
+        $likeWildcard = Utility\LikeWildcard::cast($wildcard);
+        $wSel = $likeWildcard->getLikeQueryPart(
+            'index_words',
+            'IW.baseword',
+            $sWord
+        );
+
+        $this->wSelClauses[] = $wSel;
+        $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
+        return $res;
+    }
+
+    /**
+     * Search for one distinct word
+     *
+     * @param string $sWord Word to search for
+     * @return bool|\mysqli_result SQL result pointer
+     */
+    public function searchDistinct($sWord)
+    {
+        $wSel = 'IW.wid=' . \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash($sWord);
+        $this->wSelClauses[] = $wSel;
+        $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
+        return $res;
+    }
+
+    /**
+     * Search for a sentence
+     *
+     * @param string $sSentence Sentence to search for
+     * @return bool|\mysqli_result SQL result pointer
+     */
+    public function searchSentence($sSentence)
+    {
+        $this->wSelClauses[] = '1=1';
+        $likeWildcard = Utility\LikeWildcard::cast(Utility\LikeWildcard::BOTH);
+        $likePart = $likeWildcard->getLikeQueryPart(
+            'index_fulltext',
+            'IFT.fulltextdata',
+            $sSentence
+        );
+
+        return $this->databaseConnection->exec_SELECTquery('ISEC.phash',
+            'index_section ISEC, index_fulltext IFT',
+            $likePart . ' AND ISEC.phash = IFT.phash' . $this->sectionTableWhere(), 'ISEC.phash'
+        );
+    }
+
+    /**
+     * Search for a metaphone word
+     *
+     * @param string $sWord Word to search for
+     * @return \mysqli_result SQL result pointer
+     */
+    public function searchMetaphone($sWord)
+    {
+        $wSel = 'IW.metaphone=' . $sWord;
+        $this->wSelClauses[] = $wSel;
+        return $this->execPHashListQuery($wSel, ' AND is_stopword=0');
+    }
+
+    /**
+     * Returns AND statement for selection of section in database. (rootlevel 0-2 + page_id)
+     *
+     * @return string AND clause for selection of section in database.
+     */
+    public function sectionTableWhere()
+    {
+        $out = $this->wholeSiteIdList < 0 ? '' : ' AND ISEC.rl0 IN (' . $this->wholeSiteIdList . ')';
+        $match = '';
+        if (substr($this->piVars['sections'], 0, 4) == 'rl1_') {
+            $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], 4)));
+            $out .= ' AND ISEC.rl1 IN (' . $list . ')';
+            $match = true;
+        } elseif (substr($this->piVars['sections'], 0, 4) == 'rl2_') {
+            $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], 4)));
+            $out .= ' AND ISEC.rl2 IN (' . $list . ')';
+            $match = true;
+        } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) {
+            // Traversing user configured fields to see if any of those are used to limit search to a section:
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) {
+                if (substr($this->piVars['sections'], 0, strlen($fieldName) + 1) == $fieldName . '_') {
+                    $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], strlen($fieldName) + 1)));
+                    $out .= ' AND ISEC.' . $fieldName . ' IN (' . $list . ')';
+                    $match = true;
+                    break;
+                }
+            }
+        }
+        // If no match above, test the static types:
+        if (!$match) {
+            switch ((string)$this->piVars['sections']) {
+                case '-1':
+                    // '-1' => 'Only this page',
+                    $out .= ' AND ISEC.page_id=' . $this->frontendController->id;
+                    break;
+                case '-2':
+                    // '-2' => 'Top + level 1',
+                    $out .= ' AND ISEC.rl2=0';
+                    break;
+                case '-3':
+                    // '-3' => 'Level 2 and out',
+                    $out .= ' AND ISEC.rl2>0';
+                    break;
+            }
+        }
+        return $out;
+    }
+
+    /**
+     * Returns AND statement for selection of media type
+     *
+     * @return string AND statement for selection of media type
+     */
+    public function mediaTypeWhere()
+    {
+        switch ((string)$this->piVars['media']) {
+            case '0':
+                // '0' => 'Kun TYPO3 sider',
+                $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr('0', 'index_phash');
+                break;
+            case '-2':
+                // All external documents
+                $out = ' AND IP.item_type<>' . $this->databaseConnection->fullQuoteStr('0', 'index_phash');
+                break;
+            case '-1':
+                // All content
+                $out = '';
+                break;
+            default:
+                $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr($this->piVars['media'], 'index_phash');
+        }
+        return $out;
+    }
+
+    /**
+     * Returns AND statement for selection of language
+     *
+     * @return string AND statement for selection of language
+     */
+    public function languageWhere()
+    {
+        $languageWhere = '';
+        if ($this->piVars['lang'] >= 0) {
+            // -1 is the same as ALL language.
+            $languageWhere = 'AND IP.sys_language_uid=' . (int)$this->piVars['lang'];
+        }
+        return $languageWhere;
+    }
+
+    /**
+     * Where-clause for free index-uid value.
+     *
+     * @param int $freeIndexUid Free Index UID value to limit search to.
+     * @return string WHERE SQL clause part.
+     */
+    public function freeIndexUidWhere($freeIndexUid)
+    {
+        if ($freeIndexUid < 0) {
+            return '';
+        }
+        // First, look if the freeIndexUid is a meta configuration:
+        $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('indexcfgs', 'index_config', 'type=5 AND uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
+        if (is_array($indexCfgRec)) {
+            $refs = GeneralUtility::trimExplode(',', $indexCfgRec['indexcfgs']);
+            $list = array(-99);
+            // Default value to protect against empty array.
+            foreach ($refs as $ref) {
+                list($table, $uid) = GeneralUtility::revExplode('_', $ref, 2);
+                switch ($table) {
+                    case 'index_config':
+                        $idxRec = $this->databaseConnection->exec_SELECTgetSingleRow('uid', 'index_config', 'uid=' . (int)$uid . $this->cObj->enableFields('index_config'));
+                        if ($idxRec) {
+                            $list[] = $uid;
+                        }
+                        break;
+                    case 'pages':
+                        $indexCfgRecordsFromPid = $this->databaseConnection->exec_SELECTgetRows('uid', 'index_config', 'pid=' . (int)$uid . $this->cObj->enableFields('index_config'));
+                        foreach ($indexCfgRecordsFromPid as $idxRec) {
+                            $list[] = $idxRec['uid'];
+                        }
+                        break;
+                }
+            }
+            $list = array_unique($list);
+        } else {
+            $list = array((int)$freeIndexUid);
+        }
+        return ' AND IP.freeIndexUid IN (' . implode(',', $list) . ')';
+    }
+
+    /**
+     * Execute final query, based on phash integer list. The main point is sorting the result in the right order.
+     *
+     * @param string $list List of phash integers which match the search.
+     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
+     * @return bool|\mysqli_result Query result pointer
+     */
+    public function execFinalQuery($list, $freeIndexUid = -1)
+    {
+        // Setting up methods of filtering results based on page types, access, etc.
+        $page_join = '';
+        $page_where = '';
+        // Calling hook for alternative creation of page ID list
+        if ($hookObj = $this->hookRequest('execFinalQuery_idList')) {
+            $page_where = $hookObj->execFinalQuery_idList($list);
+        } elseif ($this->join_pages) {
+            // Alternative to getting all page ids by ->getTreeList() where "excludeSubpages" is NOT respected.
+            $page_join = ',
+                               pages';
+            $page_where = 'pages.uid = ISEC.page_id
+                               ' . $this->cObj->enableFields('pages') . '
+                               AND pages.no_search=0
+                               AND pages.doktype<200
+                       ';
+        } elseif ($this->wholeSiteIdList >= 0) {
+            // Collecting all pages IDs in which to search; filtering out ALL pages that are not accessible due to enableFields. Does NOT look for "no_search" field!
+            $siteIdNumbers = GeneralUtility::intExplode(',', $this->wholeSiteIdList);
+            $id_list = array();
+            foreach ($siteIdNumbers as $rootId) {
+                $id_list[] = $this->cObj->getTreeList(-1 * $rootId, 9999);
+            }
+            $page_where = 'ISEC.page_id IN (' . implode(',', $id_list) . ')';
+        } else {
+            // Disable everything... (select all)
+            $page_where = '1=1';
+        }
+        // Indexing configuration clause:
+        $freeIndexUidClause = $this->freeIndexUidWhere($freeIndexUid);
+        // If any of the ranking sortings are selected, we must make a join with the word/rel-table again, because we need to calculate ranking based on all search-words found.
+        if (substr($this->piVars['order'], 0, 5) == 'rank_') {
+            switch ($this->piVars['order']) {
+                case 'rank_flag':
+                    // This gives priority to word-position (max-value) so that words in title, keywords, description counts more than in content.
+                    // The ordering is refined with the frequency sum as well.
+                    $grsel = 'MAX(IR.flags) AS order_val1, SUM(IR.freq) AS order_val2';
+                    $orderBy = 'order_val1' . $this->isDescending() . ',order_val2' . $this->isDescending();
+                    break;
+                case 'rank_first':
+                    // Results in average position of search words on page. Must be inversely sorted (low numbers are closer to top)
+                    $grsel = 'AVG(IR.first) AS order_val';
+                    $orderBy = 'order_val' . $this->isDescending(1);
+                    break;
+                case 'rank_count':
+                    // Number of words found
+                    $grsel = 'SUM(IR.count) AS order_val';
+                    $orderBy = 'order_val' . $this->isDescending();
+                    break;
+                default:
+                    // Frequency sum. I'm not sure if this is the best way to do it (make a sum...). Or should it be the average?
+                    $grsel = 'SUM(IR.freq) AS order_val';
+                    $orderBy = 'order_val' . $this->isDescending();
+            }
+
+            // So, words are imploded into an OR statement (no "sentence search" should be done here - may deselect results)
+            $wordSel = '(' . implode(' OR ', $this->wSelClauses) . ') AND ';
+
+            $res = $this->databaseConnection->exec_SELECTquery(
+                'ISEC.*, IP.*, ' . $grsel,
+                'index_words IW,
+                                       index_rel IR,
+                                       index_section ISEC,
+                                       index_phash IP' . $page_join,
+                $wordSel .
+                'IP.phash IN (' . $list . ') ' .
+                    $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . '
+                                       AND IW.wid=IR.wid
+                                       AND ISEC.phash = IR.phash
+                                       AND IP.phash = IR.phash
+                                       AND ' . $page_where,
+                'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,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.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId',
+                $orderBy
+            );
+        } else {
+            // Otherwise, if sorting are done with the pages table or other fields, there is no need for joining with the rel/word tables:
+            $orderBy = '';
+            switch ((string)$this->piVars['order']) {
+                case 'title':
+                    $orderBy = 'IP.item_title' . $this->isDescending();
+                    break;
+                case 'crdate':
+                    $orderBy = 'IP.item_crdate' . $this->isDescending();
+                    break;
+                case 'mtime':
+                    $orderBy = 'IP.item_mtime' . $this->isDescending();
+                    break;
+            }
+            $res = $this->databaseConnection->exec_SELECTquery('ISEC.*, IP.*', 'index_phash IP,index_section ISEC' . $page_join, 'IP.phash IN (' . $list . ') ' . $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . '
+                                                       AND IP.phash = ISEC.phash
+                                                       AND ' . $page_where, 'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,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.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', $orderBy);
+        }
+        return $res;
+    }
+
+    /**
+     * Checking if the resume can be shown for the search result (depending on whether the rights are OK)
+     * ? Should it also check for gr_list "0,-1"?
+     *
+     * @param array $row Result row array.
+     * @return bool Returns TRUE if resume can safely be shown
+     */
+    public function checkResume($row)
+    {
+        // If the record is indexed by an indexing configuration, just show it.
+        // At least this is needed for external URLs and files.
+        // For records we might need to extend this - for instance block display if record is access restricted.
+        if ($row['freeIndexUid']) {
+            return true;
+        }
+        // Evaluate regularly indexed pages based on item_type:
+        if ($row['item_type']) {
+            // External media:
+            // For external media we will check the access of the parent page on which the media was linked from.
+            // "phash_t3" is the phash of the parent TYPO3 page row which initiated the indexing of the documents in this section.
+            // So, selecting for the grlist records belonging to the parent phash-row where the current users gr_list exists will help us to know.
+            // If this is NOT found, there is still a theoretical possibility that another user accessible page would display a link, so maybe the resume of such a document here may be unjustified hidden. But better safe than sorry.
+            if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
+                $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash_t3'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist'));
+            } else {
+                $res = false;
+            }
+            if ($res && $this->databaseConnection->sql_num_rows($res)) {
+                return true;
+            } else {
+                return false;
+            }
+        } else {
+            // Ordinary TYPO3 pages:
+            if ((string)$row['gr_list'] !== (string)$this->frontendController->gr_list) {
+                // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists. If it is found it is proof that this user has direct access to the phash-rows content although he did not himself initiate the indexing...
+                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
+                    $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist'));
+                } else {
+                    $res = false;
+                }
+                if ($res && $this->databaseConnection->sql_num_rows($res)) {
+                    return true;
+                } else {
+                    return false;
+                }
+            } else {
+                return true;
+            }
+        }
+    }
+
+    /**
+     * Returns "DESC" or "" depending on the settings of the incoming highest/lowest result order (piVars['desc']
+     *
+     * @param bool $inverse If TRUE, inverse the order which is defined by piVars['desc']
+     * @return string " DESC" or
+     */
+    public function isDescending($inverse = false)
+    {
+        $desc = $this->piVars['desc'];
+        if ($inverse) {
+            $desc = !$desc;
+        }
+        return !$desc ? ' DESC' : '';
+    }
+
+    /**
+     * Write statistics information to database for the search operation
+     *
+     * @param array $sWArr Search Word array
+     * @param int $count Number of hits
+     * @param int $pt Milliseconds the search took
+     * @return void
+     */
+    public function writeSearchStat($sWArr, $count, $pt)
+    {
+        $insertFields = array(
+            'searchstring' => $this->piVars['sword'],
+            'searchoptions' => serialize(array($this->piVars, $sWArr, $pt)),
+            'feuser_id' => (int)$GLOBALS['TSFE']->user['uid'],
+            // fe_user id, integer
+            'cookie' => (string)$GLOBALS['TSFE']->id,
+            // cookie as set or retrieve. If people has cookies disabled this will vary all the time...
+            'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'),
+            // Remote IP address
+            'hits' => (int)$count,
+            // Number of hits on the search.
+            'tstamp' => $GLOBALS['EXEC_TIME']
+        );
+        $this->databaseConnection->exec_INSERTquery('index_stat_search', $insertFields);
+        $newId = $this->databaseConnection->sql_insert_id();
+        if ($newId) {
+            foreach ($sWArr as $val) {
+                $insertFields = array(
+                    'word' => $val['sword'],
+                    'index_stat_search_id' => $newId,
+                    'tstamp' => $GLOBALS['EXEC_TIME'],
+                    // Time stamp
+                    'pageid' => $this->frontendController->id
+                );
+                $this->databaseConnection->exec_INSERTquery('index_stat_word', $insertFields);
+            }
+        }
+    }
+
+    /***********************************
+     *
+     * HTML output functions
+     *
+     ***********************************/
+    /**
+     * Make search form HTML
+     *
+     * @param array $optValues Value/Labels pairs for search form selector boxes.
+     * @return string Search form HTML
+     */
+    public function makeSearchForm($optValues)
+    {
+        $html = $this->cObj->getSubpart($this->templateCode, '###SEARCH_FORM###');
+        // Multilangual text
+        $substituteArray = array('legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid');
+        foreach ($substituteArray as $marker) {
+            $markerArray['###FORM_' . GeneralUtility::strtoupper($marker) . '###'] = $this->pi_getLL('form_' . $marker, '', true);
+        }
+        $markerArray['###FORM_SUBMIT###'] = $this->pi_getLL('submit_button_label', '', true);
+        // Adding search field value
+        $markerArray['###SWORD_VALUE###'] = '';
+        $markerArray['###PLACEHOLDER###'] = '';
+        if (!empty($this->piVars['sword'])) {
+            $markerArray['###SWORD_VALUE###'] = htmlspecialchars($this->piVars['sword']);
+        } else {
+            // Add a HTML5 placeholder attribute if the configured doctype allows it
+            if ($GLOBALS['TSFE']->config['config']['doctype'] === 'html5') {
+                $markerArray['###PLACEHOLDER###'] = 'placeholder="' . $this->pi_getLL('default_search_word_entry') . '"';
+            } else {
+                $markerArray['###SWORD_VALUE###'] = $this->pi_getLL('default_search_word_entry');
+            }
+        }
+        // Additonal keyword => "Add to current search words"
+        if ($this->conf['show.']['clearSearchBox'] && $this->conf['show.']['clearSearchBox.']['enableSubSearchCheckBox']) {
+            $markerArray['###SWORD_PREV_VALUE###'] = htmlspecialchars($this->conf['show.']['clearSearchBox'] ? '' : $this->piVars['sword']);
+            $markerArray['###SWORD_PREV_INCLUDE_CHECKED###'] = $this->piVars['sword_prev_include'] ? ' checked="checked"' : '';
+            $markerArray['###ADD_TO_CURRENT_SEARCH###'] = $this->pi_getLL('makerating_addToCurrentSearch', '', true);
+        } else {
+            $html = $this->cObj->substituteSubpart($html, '###ADDITONAL_KEYWORD###', '');
+        }
+        $markerArray['###ACTION_URL###'] = htmlspecialchars($this->getSearchFormActionURL());
+        $hiddenFieldCode = $this->cObj->getSubpart($this->templateCode, '###HIDDEN_FIELDS###');
+        $hiddenFieldCode = preg_replace('/^\\n\\t(.+)/ms', '$1', $hiddenFieldCode);
+        // Remove first newline and tab (cosmetical issue)
+        $hiddenFieldArr = array();
+        foreach (GeneralUtility::trimExplode(',', $this->hiddenFieldList) as $fieldName) {
+            $hiddenFieldMarkerArray = array();
+            $hiddenFieldMarkerArray['###HIDDEN_FIELDNAME###'] = $this->prefixId . '[' . $fieldName . ']';
+            $hiddenFieldMarkerArray['###HIDDEN_VALUE###'] = htmlspecialchars((string)$this->piVars[$fieldName]);
+            $hiddenFieldArr[$fieldName] = $this->cObj->substituteMarkerArrayCached($hiddenFieldCode, $hiddenFieldMarkerArray, array(), array());
+        }
+        // Extended search
+        if ($this->piVars['ext']) {
+            // Search for
+            if (!is_array($optValues['type']) && !is_array($optValues['defOp']) || $this->conf['blind.']['type'] && $this->conf['blind.']['defOp']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_FOR###', '');
+            } else {
+                if (is_array($optValues['type']) && !$this->conf['blind.']['type']) {
+                    unset($hiddenFieldArr['type']);
+                    $markerArray['###SELECTBOX_TYPE_VALUES###'] = $this->renderSelectBoxValues($this->piVars['type'], $optValues['type']);
+                } else {
+                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_TYPE###', '');
+                }
+                if (is_array($optValues['defOp']) || !$this->conf['blind.']['defOp']) {
+                    $markerArray['###SELECTBOX_DEFOP_VALUES###'] = $this->renderSelectBoxValues($this->piVars['defOp'], $optValues['defOp']);
+                } else {
+                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_DEFOP###', '');
+                }
+            }
+            // Search in
+            if (!is_array($optValues['media']) && !is_array($optValues['lang']) || $this->conf['blind.']['media'] && $this->conf['blind.']['lang']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_IN###', '');
+            } else {
+                if (is_array($optValues['media']) && !$this->conf['blind.']['media']) {
+                    unset($hiddenFieldArr['media']);
+                    $markerArray['###SELECTBOX_MEDIA_VALUES###'] = $this->renderSelectBoxValues($this->piVars['media'], $optValues['media']);
+                } else {
+                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_MEDIA###', '');
+                }
+                if (is_array($optValues['lang']) || !$this->conf['blind.']['lang']) {
+                    unset($hiddenFieldArr['lang']);
+                    $markerArray['###SELECTBOX_LANG_VALUES###'] = $this->renderSelectBoxValues($this->piVars['lang'], $optValues['lang']);
+                } else {
+                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_LANG###', '');
+                }
+            }
+            // Sections
+            if (!is_array($optValues['sections']) || $this->conf['blind.']['sections']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_SECTION###', '');
+            } else {
+                $markerArray['###SELECTBOX_SECTIONS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['sections'], $optValues['sections']);
+            }
+            // Free Indexing Configurations:
+            if (!is_array($optValues['freeIndexUid']) || $this->conf['blind.']['freeIndexUid']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_FREEINDEXUID###', '');
+            } else {
+                $markerArray['###SELECTBOX_FREEINDEXUIDS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['freeIndexUid'], $optValues['freeIndexUid']);
+            }
+            // Sorting
+            if (!is_array($optValues['order']) || !is_array($optValues['desc']) || $this->conf['blind.']['order']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_ORDER###', '');
+            } else {
+                unset($hiddenFieldArr['order']);
+                unset($hiddenFieldArr['desc']);
+                unset($hiddenFieldArr['results']);
+                $markerArray['###SELECTBOX_ORDER_VALUES###'] = $this->renderSelectBoxValues($this->piVars['order'], $optValues['order']);
+                $markerArray['###SELECTBOX_DESC_VALUES###'] = $this->renderSelectBoxValues($this->piVars['desc'], $optValues['desc']);
+                $markerArray['###SELECTBOX_RESULTS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['results'], $optValues['results']);
+            }
+            // Limits
+            if (!is_array($optValues['results']) || !is_array($optValues['results']) || $this->conf['blind.']['results']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_RESULTS###', '');
+            } else {
+                $markerArray['###SELECTBOX_RESULTS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['results'], $optValues['results']);
+            }
+            // Grouping
+            if (!is_array($optValues['group']) || $this->conf['blind.']['group']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_GROUP###', '');
+            } else {
+                unset($hiddenFieldArr['group']);
+                $markerArray['###SELECTBOX_GROUP_VALUES###'] = $this->renderSelectBoxValues($this->piVars['group'], $optValues['group']);
+            }
+            if ($this->conf['blind.']['extResume']) {
+                $html = $this->cObj->substituteSubpart($html, '###SELECT_EXTRESUME###', '');
+            } else {
+                $markerArray['###EXT_RESUME_CHECKED###'] = $this->piVars['extResume'] ? ' checked="checked"' : '';
+            }
+        } else {
+            // Extended search
+            $html = $this->cObj->substituteSubpart($html, '###SEARCH_FORM_EXTENDED###', '');
+        }
+        if ($this->conf['show.']['advancedSearchLink']) {
+            $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre) : $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre, array($this->prefixId . '[ext]' => 1));
+            $markerArray['###LINKTOOTHERMODE###'] = '<a href="' . htmlspecialchars($linkToOtherMode) . '">' . $this->pi_getLL(($this->piVars['ext'] ? 'link_regularSearch' : 'link_advancedSearch'), '', true) . '</a>';
+        } else {
+            $markerArray['###LINKTOOTHERMODE###'] = '';
+        }
+        // Write all hidden fields
+        $html = $this->cObj->substituteSubpart($html, '###HIDDEN_FIELDS###', implode('', $hiddenFieldArr));
+        $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
+        return $substitutedContent;
+    }
+
+    /**
+     * Function, rendering selector box values.
+     *
+     * @param string $value Current value
+     * @param array $optValues Array with the options as key=>value pairs
+     * @return string <options> imploded.
+     */
+    public function renderSelectBoxValues($value, $optValues)
+    {
+        if (!is_array($optValues)) {
+            return '';
+        }
+        $opt = array();
+        $isSelFlag = 0;
+        foreach ($optValues as $k => $v) {
+            $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
+            if ($sel) {
+                $isSelFlag++;
+            }
+            $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
+        }
+        return implode('', $opt);
+    }
+
+    /**
+     * Print the searching rules
+     *
+     * @return string Rules for the search
+     */
+    public function printRules()
+    {
+        if (!$this->conf['show.']['rules']) {
+            return '';
+        }
+        $html = $this->cObj->getSubpart($this->templateCode, '###RULES###');
+        $markerArray['###RULES_HEADER###'] = $this->pi_getLL('rules_header', '', true);
+        $markerArray['###RULES_TEXT###'] = nl2br(trim($this->pi_getLL('rules_text', '', true)));
+        $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
+        return $this->cObj->stdWrap($substitutedContent, $this->conf['rules_stdWrap.']);
+    }
+
+    /**
+     * Returns the anchor-links to the sections inside the displayed result rows.
+     *
+     * @return string
+     */
+    public function printResultSectionLinks()
+    {
+        if (empty($this->resultSections)) {
+            return '';
+        }
+        $links = array();
+        $html = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS###');
+        $item = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS_LINK###');
+        $anchorPrefix = $GLOBALS['TSFE']->baseUrl ? substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), strlen(GeneralUtility::getIndpEnv('TYPO3_SITE_URL'))) : '';
+        foreach ($this->resultSections as $id => $dat) {
+            $markerArray = array();
+            $aBegin = '<a href="' . htmlspecialchars($anchorPrefix . '#anchor_' . md5($id)) . '">';
+            $aContent = (trim($dat[0]) ? trim($dat[0]) : htmlspecialchars($this->pi_getLL('unnamedSection'))) . ' (' . $dat[1] . ' ' . $this->pi_getLL(($dat[1] > 1 ? 'word_pages' : 'word_page'), '', true) . ')';
+            $aEnd = '</a>';
+            $markerArray['###LINK###'] = $aBegin . $aContent . $aEnd;
+            $links[] = $this->cObj->substituteMarkerArrayCached($item, $markerArray, array(), array());
+        }
+        $html = $this->cObj->substituteMarkerArrayCached($html, array('###LINKS###' => implode('', $links)), array(), array());
+        return '<div' . $this->pi_classParam('sectionlinks') . '>' . $this->cObj->stdWrap($html, $this->conf['sectionlinks_stdWrap.']) . '</div>';
+    }
+
+    /**
+     * Returns the section header of the search result.
+     *
+     * @param string $id ID for the section (used for anchor link)
+     * @param string $sectionTitleLinked Section title with linked wrapped around
+     * @param int $countResultRows Number of results in section
+     * @return string HTML output
+     */
+    public function makeSectionHeader($id, $sectionTitleLinked, $countResultRows)
+    {
+        $html = $this->cObj->getSubpart($this->templateCode, '###SECTION_HEADER###');
+        $markerArray['###ANCHOR_URL###'] = 'anchor_' . md5($id);
+        $markerArray['###SECTION_TITLE###'] = $sectionTitleLinked;
+        $markerArray['###RESULT_COUNT###'] = $countResultRows;
+        $markerArray['###RESULT_NAME###'] = $this->pi_getLL('word_page' . ($countResultRows > 1 ? 's' : ''));
+        $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
+        return $substitutedContent;
+    }
+
+    /**
+     * This prints a single result row, including a recursive call for subrows.
+     *
+     * @param array $row Search result row
+     * @param int $headerOnly 1=Display only header (for sub-rows!), 2=nothing at all
+     * @return string HTML code
+     */
+    public function printResultRow($row, $headerOnly = 0)
+    {
+        // Get template content:
+        $tmplContent = $this->prepareResultRowTemplateData($row, $headerOnly);
+        if ($hookObj = $this->hookRequest('printResultRow')) {
+            return $hookObj->printResultRow($row, $headerOnly, $tmplContent);
+        } else {
+            $html = $this->cObj->getSubpart($this->templateCode, '###RESULT_OUTPUT###');
+            if (!is_array($row['_sub'])) {
+                $html = $this->cObj->substituteSubpart($html, '###ROW_SUB###', '');
+            }
+            if (!$headerOnly) {
+                $html = $this->cObj->substituteSubpart($html, '###ROW_SHORT###', '');
+            } elseif ($headerOnly == 1) {
+                $html = $this->cObj->substituteSubpart($html, '###ROW_LONG###', '');
+            } elseif ($headerOnly == 2) {
+                $html = $this->cObj->substituteSubpart($html, '###ROW_SHORT###', '');
+                $html = $this->cObj->substituteSubpart($html, '###ROW_LONG###', '');
+            }
+            if (is_array($tmplContent)) {
+                foreach ($tmplContent as $k => $v) {
+                    $markerArray['###' . GeneralUtility::strtoupper($k) . '###'] = $v;
+                }
+            }
+            // Description text
+            $markerArray['###TEXT_ITEM_SIZE###'] = $this->pi_getLL('res_size', '', true);
+            $markerArray['###TEXT_ITEM_CRDATE###'] = $this->pi_getLL('res_created', '', true);
+            $markerArray['###TEXT_ITEM_MTIME###'] = $this->pi_getLL('res_modified', '', true);
+            $markerArray['###TEXT_ITEM_PATH###'] = $this->pi_getLL('res_path', '', true);
+            $html = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
+            // If there are subrows (eg. subpages in a PDF-file or if a duplicate page is selected due to user-login (phash_grouping))
+            if (is_array($row['_sub'])) {
+                if ($this->multiplePagesType($row['item_type'])) {
+                    $html = str_replace('###TEXT_ROW_SUB###', $this->pi_getLL('res_otherMatching', '', true), $html);
+                    foreach ($row['_sub'] as $subRow) {
+                        $html .= $this->printResultRow($subRow, 1);
+                    }
+                } else {
+                    $markerArray['###TEXT_ROW_SUB###'] = $this->pi_getLL('res_otherMatching', '', true);
+                    $html = str_replace('###TEXT_ROW_SUB###', $this->pi_getLL('res_otherPageAsWell', '', true), $html);
+                }
+            }
+            return $html;
+        }
+    }
+
+    /**
+     * Returns a results browser, former method name: pi_list_browseresults
+     *
+     * @param bool $showResultCount Show result count
+     * @param string $addString String appended to "displaying results..." notice.
+     * @param string $addPart String appended after section "displaying results...
+     * @param string $freeIndexUid List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration!
+     * @return string HTML output
+     */
+    protected function renderPagination($showResultCount = true, $addString = '', $addPart = '', $freeIndexUid = -1)
+    {
+        // Initializing variables:
+        $pointer = (int)$this->piVars['pointer'];
+        $count = (int)$this->internal['res_count'];
+        $results_at_a_time = MathUtility::forceIntegerInRange($this->internal['results_at_a_time'], 1, 1000);
+        $pageCount = (int)ceil($count / $results_at_a_time);
+
+        $links = array();
+        // only show the result browser if more than one page is needed
+        if ($pageCount > 1) {
+            $maxPages = MathUtility::forceIntegerInRange($this->internal['maxPages'], 1, $pageCount);
+
+            // Make browse-table/links:
+            if ($pointer > 0) {
+                // all pages after the 1st one
+                $links[] = '<li>' . $this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_prev', '< Previous', true), $pointer - 1, $freeIndexUid) . '</li>';
+            }
+            $minPage = $pointer - (int)floor($maxPages / 2);
+            $maxPage = $minPage + $maxPages - 1;
+            // Check if the indexes are within the page limits
+            if ($minPage < 0) {
+                $maxPage -= $minPage;
+                $minPage = 0;
+            } elseif ($maxPage >= $pageCount) {
+                $minPage -= $maxPage - $pageCount + 1;
+                $maxPage = $pageCount - 1;
+            }
+            $pageLabel = $this->pi_getLL('pi_list_browseresults_page', 'Page', true);
+            for ($a = $minPage; $a <= $maxPage; $a++) {
+                $label = trim($pageLabel . ' ' . ($a + 1));
+                $link = $this->makePointerSelector_link($label, $a, $freeIndexUid);
+                if ($a === $pointer) {
+                    $links[] = '<li' . $this->pi_classParam('browselist-currentPage') . '><strong>' . $link . '</strong></li>';
+                } else {
+                    $links[] = '<li>' . $link . '</li>';
+                }
+            }
+            if ($pointer + 1 < $pageCount) {
+                $links[] = '<li>' . $this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_next', 'Next >', true), $pointer + 1, $freeIndexUid) . '</li>';
+            }
+        }
+        if (!empty($links)) {
+            $addPart .= '
+               <ul class="browsebox">
+                       ' . implode('', $links) . '
+               </ul>';
+        }
+        $label = str_replace(
+            array('###TAG_BEGIN###', '###TAG_END###'),
+            array('<strong>', '</strong>'),
+            $this->pi_getLL('pi_list_browseresults_display', 'Displaying results ###TAG_BEGIN###%1$s to %2$s###TAG_END### out of ###TAG_BEGIN###%3$s###TAG_END###')
+        );
+        $resultsFrom = $pointer * $results_at_a_time + 1;
+        $resultsTo = min($resultsFrom + $results_at_a_time - 1, $count);
+        $resultCountText = '';
+        if ($showResultCount) {
+            $resultCountText = '<p>' . sprintf($label, $resultsFrom, $resultsTo, $count) . $addString . '</p>';
+        }
+        $sTables = '<div' . $this->pi_classParam('browsebox') . '>'
+            . $resultCountText
+            . $addPart . '</div>';
+        return $sTables;
+    }
+
+    /***********************************
+     *
+     * Support functions for HTML output (with a minimum of fixed markup)
+     *
+     ***********************************/
+    /**
+     * Preparing template data for the result row output
+     *
+     * @param array $row Result row
+     * @param bool $headerOnly If set, display only header of result (for sub-results)
+     * @return array Array with data to insert in result row template
+     */
+    public function prepareResultRowTemplateData($row, $headerOnly)
+    {
+        // Initialize:
+        $specRowConf = $this->getSpecialConfigForRow($row);
+        $CSSsuffix = $specRowConf['CSSsuffix'] ? '-' . $specRowConf['CSSsuffix'] : '';
+        // If external media, link to the media-file instead.
+        if ($row['item_type']) {
+            // External media
+            if ($row['show_resume']) {
+                // Can link directly.
+                $targetAttribute = '';
+                if ($this->frontendController->config['config']['fileTarget']) {
+                    $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"';
+                }
+                $title = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($this->makeTitle($row)) . '</a>';
+            } else {
+                // Suspicious, so linking to page instead...
+                $copy_row = $row;
+                unset($copy_row['cHashParams']);
+                $title = $this->linkPage($row['page_id'], htmlspecialchars($this->makeTitle($row)), $copy_row);
+            }
+        } else {
+            // Else the page:
+            // Prepare search words for markup in content:
+            if ($this->conf['forwardSearchWordsInResultLink']) {
+                if ($this->conf['forwardSearchWordsInResultLink.']['no_cache']) {
+                    $markUpSwParams = array('no_cache' => 1);
+                } else {
+                    $markUpSwParams = array();
+                }
+                foreach ($this->sWArr as $d) {
+                    $markUpSwParams['sword_list'][] = $d['sword'];
+                }
+            } else {
+                $markUpSwParams = array();
+            }
+            $title = $this->linkPage($row['data_page_id'], htmlspecialchars($this->makeTitle($row)), $row, $markUpSwParams);
+        }
+        $tmplContent = array();
+        $tmplContent['title'] = $title;
+        $tmplContent['result_number'] = $this->conf['show.']['resultNumber'] ? $row['result_number'] . ': ' : '&nbsp;';
+        $tmplContent['icon'] = $this->makeItemTypeIcon($row['item_type'], '', $specRowConf);
+        $tmplContent['rating'] = $this->makeRating($row);
+        $tmplContent['description'] = $this->makeDescription(
+            $row,
+            !($this->piVars['extResume'] && !$headerOnly),
+            $this->conf['results.']['summaryCropAfter']
+        );
+        $tmplContent = $this->makeInfo($row, $tmplContent);
+        $tmplContent['access'] = $this->makeAccessIndication($row['page_id']);
+        $tmplContent['language'] = $this->makeLanguageIndication($row);
+        $tmplContent['CSSsuffix'] = $CSSsuffix;
+        // Post processing with hook.
+        if ($hookObj = $this->hookRequest('prepareResultRowTemplateData_postProc')) {
+            $tmplContent = $hookObj->prepareResultRowTemplateData_postProc($tmplContent, $row, $headerOnly);
+        }
+        return $tmplContent;
+    }
+
+    /**
+     * Returns a string that tells which search words are searched for.
+     *
+     * @param array Array of search words
+     * @return string HTML telling what is searched for.
+     */
+    public function tellUsWhatIsSeachedFor($sWArr)
+    {
+        // Init:
+        $searchingFor = '';
+        $c = 0;
+        // Traverse search words:
+        foreach ($sWArr as $k => $v) {
+            if ($c) {
+                switch ($v['oper']) {
+                    case 'OR':
+                        $searchingFor .= ' ' . $this->pi_getLL('searchFor_or', '', true) . ' ' . $this->wrapSW($v['sword']);
+                        break;
+                    case 'AND NOT':
+                        $searchingFor .= ' ' . $this->pi_getLL('searchFor_butNot', '', true) . ' ' . $this->wrapSW($v['sword']);
+                        break;
+                    default:
+                        // AND...
+                        $searchingFor .= ' ' . $this->pi_getLL('searchFor_and', '', true) . ' ' . $this->wrapSW($v['sword']);
+                }
+            } else {
+                $searchingFor = $this->pi_getLL('searchFor', '', true) . ' ' . $this->wrapSW($v['sword']);
+            }
+            $c++;
+        }
+        return $searchingFor;
+    }
+
+    /**
+     * Wraps the search words in the search-word list display (from ->tellUsWhatIsSeachedFor())
+     *
+     * @param string $str search word to wrap (in local charset!)
+     * @return string Search word wrapped in <span> tag.
+     */
+    public function wrapSW($str)
+    {
+        return '"<span' . $this->pi_classParam('sw') . '>' . htmlspecialchars($str) . '</span>"';
+    }
+
+    /**
+     * Makes a selector box
+     *
+     * @param string $name Name of selector box
+     * @param string $value Current value
+     * @param array $optValues Array of options in the selector box (value => label pairs)
+     * @return string HTML of selector box
+     */
+    public function renderSelectBox($name, $value, $optValues)
+    {
+        if (is_array($optValues)) {
+            $opt = array();
+            $isSelFlag = 0;
+            foreach ($optValues as $k => $v) {
+                $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
+                if ($sel) {
+                    $isSelFlag++;
+                }
+                $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
+            }
+            return '<select name="' . $name . '">' . implode('', $opt) . '</select>';
+        }
+    }
+
+    /**
+     * Used to make the link for the result-browser.
+     * Notice how the links must resubmit the form after setting the new pointer-value in a hidden formfield.
+     *
+     * @param string $str String to wrap in <a> tag
+     * @param int $p Pointer value
+     * @param string $freeIndexUid List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration!
+     * @return string Input string wrapped in <a> tag with onclick event attribute set.
+     */
+    public function makePointerSelector_link($str, $p, $freeIndexUid)
+    {
+        $onclick = 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId . '_pointer') . ').value=' . GeneralUtility::quoteJSvalue($p) . ';' . 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId . '_freeIndexUid') . ').value=' . GeneralUtility::quoteJSvalue($freeIndexUid) . ';' . 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId) . ').submit();return false;';
+        return '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $str . '</a>';
+    }
+
+    /**
+     * Return icon for file extension
+     *
+     * @param string $it File extension / item type
+     * @param string $alt Title attribute value in icon.
+     * @param array $specRowConf TypoScript configuration specifically for search result.
+     * @return string <img> tag for icon
+     */
+    public function makeItemTypeIcon($it, $alt = '', $specRowConf)
+    {
+        // Build compound key if item type is 0, iconRendering is not used
+        // and specConfs.[pid].pageIcon was set in TS
+        if ($it === '0' && $specRowConf['_pid'] && is_array($specRowConf['pageIcon.']) && !is_array($this->conf['iconRendering.'])) {
+            $it .= ':' . $specRowConf['_pid'];
+        }
+        if (!isset($this->iconFileNameCache[$it])) {
+            $this->iconFileNameCache[$it] = '';
+            // If TypoScript is used to render the icon:
+            if (is_array($this->conf['iconRendering.'])) {
+                $this->cObj->setCurrentVal($it);
+                $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle($this->conf['iconRendering'], $this->conf['iconRendering.']);
+            } else {
+                // Default creation / finding of icon:
+                $icon = '';
+                if ($it === '0' || substr($it, 0, 2) == '0:') {
+                    if (is_array($specRowConf['pageIcon.'])) {
+                        $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle('IMAGE', $specRowConf['pageIcon.']);
+                    } else {
+                        $icon = 'EXT:indexed_search/Resources/Public/Icons/FileTypes/pages.gif';
+                    }
+                } elseif ($this->external_parsers[$it]) {
+                    $icon = $this->external_parsers[$it]->getIcon($it);
+                }
+                if ($icon) {
+                    $fullPath = GeneralUtility::getFileAbsFileName($icon);
+                    if ($fullPath) {
+                        $info = @getimagesize($fullPath);
+                        $iconPath = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($fullPath);
+                        $this->iconFileNameCache[$it] = is_array($info) ? '<img src="' . $iconPath . '" ' . $info[3] . ' title="' . htmlspecialchars($alt) . '" alt="" />' : '';
+                    }
+                }
+            }
+        }
+        return $this->iconFileNameCache[$it];
+    }
+
+    /**
+     * Return the rating-HTML code for the result row. This makes use of the $this->firstRow
+     *
+     * @param array $row Result row array
+     * @return string String showing ranking value
+     */
+    public function makeRating($row)
+    {
+        switch ((string)$this->piVars['order']) {
+            case 'rank_count':
+                // Number of occurencies on page
+                return $row['order_val'] . ' ' . $this->pi_getLL('maketitle_matches');
+                break;
+            case 'rank_first':
+                // Close to top of page
+                return ceil(MathUtility::forceIntegerInRange((255 - $row['order_val']), 1, 255) / 255 * 100) . '%';
+                break;
+            case 'rank_flag':
+                // Based on priority assigned to <title> / <meta-keywords> / <meta-description> / <body>
+                if ($this->firstRow['order_val2']) {
+                    $base = $row['order_val1'] * 256;
+                    // (3 MSB bit, 224 is highest value of order_val1 currently)
+                    $freqNumber = $row['order_val2'] / $this->firstRow['order_val2'] * pow(2, 12);
+                    // 15-3 MSB = 12
+                    $total = MathUtility::forceIntegerInRange($base + $freqNumber, 0, 32767);
+                    return ceil(log($total) / log(32767) * 100) . '%';
+                }
+                break;
+            case 'rank_freq':
+                // Based on frequency
+                $max = 10000;
+                $total = MathUtility::forceIntegerInRange($row['order_val'], 0, $max);
+                return ceil(log($total) / log($max) * 100) . '%';
+                break;
+            case 'crdate':
+                // Based on creation date
+                return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_crdate'], 0);
+                break;
+            case 'mtime':
+                // Based on modification time
+                return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_mtime'], 0);
+                break;
+            default:
+                // fx. title
+                return '&nbsp;';
+        }
+    }
+
+    /**
+     * Returns the resume for the search-result.
+     *
+     * @param array $row Search result row
+     * @param bool $noMarkup If noMarkup is FALSE, then the index_fulltext table is used to select the content of the page, split it with regex to display the search words in the text.
+     * @param int $lgd String length
+     * @return string HTML string
+     */
+    public function makeDescription($row, $noMarkup = false, $lgd = 180)
+    {
+        if ($row['show_resume']) {
+            $markedSW = '';
+            $outputStr = '';
+            if (!$noMarkup) {
+                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_fulltext')) {
+                    $res = $this->databaseConnection->exec_SELECTquery('*', 'index_fulltext', 'phash=' . (int)$row['phash']);
+                } else {
+                    $res = false;
+                }
+                if ($res) {
+                    if ($ftdrow = $this->databaseConnection->sql_fetch_assoc($res)) {
+                        // Cut HTTP references after some length
+                        $content = preg_replace('/(http:\\/\\/[^ ]{' . $this->conf['results.']['hrefInSummaryCropAfter'] . '})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']);
+                        $markedSW = $this->markupSWpartsOfString($content);
+                    }
+                    $this->databaseConnection->sql_free_result($res);
+                }
+            }
+            if (!trim($markedSW)) {
+                $outputStr = $this->charsetConverter->crop('utf-8', $row['item_description'], $lgd, $this->conf['results.']['summaryCropSignifier']);
+                $outputStr = htmlspecialchars($outputStr);
+            }
+            $output = $outputStr ?: $markedSW;
+        } else {
+            $output = '<span class="noResume">' . $this->pi_getLL('res_noResume', '', true) . '</span>';
+        }
+        return $output;
+    }
+
+    /**
+     * Marks up the search words from $this->sWarr in the $str with a color.
+     *
+     * @param string $str Text in which to find and mark up search words. This text is assumed to be UTF-8 like the search words internally is.
+     * @return string Processed content.
+     */
+    public function markupSWpartsOfString($str)
+    {
+        $htmlParser = GeneralUtility::makeInstance(HtmlParser::class);
+        // Init:
+        $str = str_replace('&nbsp;', ' ', $htmlParser->bidir_htmlspecialchars($str, -1));
+        $str = preg_replace('/\\s\\s+/', ' ', $str);
+        $swForReg = array();
+        // Prepare search words for regex:
+        foreach ($this->sWArr as $d) {
+            $swForReg[] = preg_quote($d['sword'], '/');
+        }
+        $regExString = '(' . implode('|', $swForReg) . ')';
+        // Split and combine:
+        $parts = preg_split('/' . $regExString . '/ui', ' ' . $str . ' ', 20000, PREG_SPLIT_DELIM_CAPTURE);
+        // Constants:
+        $summaryMax = $this->conf['results.']['markupSW_summaryMax'];
+        $postPreLgd = $this->conf['results.']['markupSW_postPreLgd'];
+        $postPreLgd_offset = $this->conf['results.']['markupSW_postPreLgd_offset'];
+        $divider = $this->conf['results.']['markupSW_divider'];
+        $occurencies = (count($parts) - 1) / 2;
+        if ($occurencies) {
+            $postPreLgd = MathUtility::forceIntegerInRange($summaryMax / $occurencies, $postPreLgd, $summaryMax / 2);
+        }
+        // Variable:
+        $summaryLgd = 0;
+        $output = array();
+        // Shorten in-between strings:
+        foreach ($parts as $k => $strP) {
+            if ($k % 2 == 0) {
+                // Find length of the summary part:
+                $strLen = $this->charsetConverter->strlen('utf-8', $parts[$k]);
+                $output[$k] = $parts[$k];
+                // Possibly shorten string:
+                if (!$k) {
+                    // First entry at all (only cropped on the frontside)
+                    if ($strLen > $postPreLgd) {
+                        $output[$k] = $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->charsetConverter->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
+                    }
+                } elseif ($summaryLgd > $summaryMax || !isset($parts[$k + 1])) {
+                    // In case summary length is exceed OR if there are no more entries at all:
+                    if ($strLen > $postPreLgd) {
+                        $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->charsetConverter->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider;
+                    }
+                } else {
+                    // In-between search words:
+                    if ($strLen > $postPreLgd * 2) {
+                        $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->charsetConverter->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->charsetConverter->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
+                    }
+                }
+                $summaryLgd += $this->charsetConverter->strlen('utf-8', $output[$k]);
+                // Protect output:
+                $output[$k] = htmlspecialchars($output[$k]);
+                // If summary lgd is exceed, break the process:
+                if ($summaryLgd > $summaryMax) {
+                    break;
+                }
+            } else {
+                $summaryLgd += $this->charsetConverter->strlen('utf-8', $strP);
+                $output[$k] = '<strong class="tx-indexedsearch-redMarkup">' . htmlspecialchars($parts[$k]) . '</strong>';
+            }
+        }
+        // Return result:
+        return implode('', $output);
+    }
+
+    /**
+     * Returns the title of the search result row
+     *
+     * @param array $row Result row
+     * @return string Title from row
+     */
+    public function makeTitle($row)
+    {
+        $add = '';
+        if ($this->multiplePagesType($row['item_type'])) {
+            $dat = unserialize($row['cHashParams']);
+            $pp = explode('-', $dat['key']);
+            if ($pp[0] != $pp[1]) {
+                $add = ', ' . $this->pi_getLL('word_pages') . ' ' . $dat['key'];
+            } else {
+                $add = ', ' . $this->pi_getLL('word_page') . ' ' . $pp[0];
+            }
+        }
+        $outputString = $this->charsetConverter->crop('utf-8', $row['item_title'], $this->conf['results.']['titleCropAfter'], $this->conf['results.']['titleCropSignifier']);
+        return $outputString . $add;
+    }
+
+    /**
+     * Returns the info-string in the bottom of the result-row display (size, dates, path)
+     *
+     * @param array $row Result row
+     * @param array $tmplArray Template array to modify
+     * @return array Modified template array
+     */
+    public function makeInfo($row, $tmplArray)
+    {
+        $tmplArray['size'] = GeneralUtility::formatSize($row['item_size']);
+        $tmplArray['created'] = $this->formatCreatedDate($row['item_crdate']);
+        $tmplArray['modified'] = $this->formatModifiedDate($row['item_mtime']);
+        $pathId = $row['data_page_id'] ?: $row['page_id'];
+        $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
+        $pI = parse_url($row['data_filename']);
+        if ($pI['scheme']) {
+            $targetAttribute = '';
+            if ($this->frontendController->config['config']['fileTarget']) {
+                $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"';
+            }
+            $tmplArray['path'] = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($row['data_filename']) . '</a>';
+        } else {
+            $pathStr = $this->getPathFromPageId($pathId, $pathMP);
+            $tmplArray['path'] = $this->linkPage($pathId, $pathStr, array(
+                'cHashParams' => $row['cHashParams'],
+                'data_page_type' => $row['data_page_type'],
+                'data_page_mp' => $pathMP,
+                'sys_language_uid' => $row['sys_language_uid']
+            ));
+        }
+        return $tmplArray;
+    }
+
+    /**
+     * Returns configuration from TypoScript for result row based on ID / location in page tree!
+     *
+     * @param array $row Result row
+     * @return array Configuration array
+     */
+    public function getSpecialConfigForRow($row)
+    {
+        $pathId = $row['data_page_id'] ?: $row['page_id'];
+        $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
+        $rl = $this->getRootLine($pathId, $pathMP);
+        $specConf = $this->conf['specConfs.']['0.'];
+        if (is_array($rl)) {
+            foreach ($rl as $dat) {
+                if (is_array($this->conf['specConfs.'][$dat['uid'] . '.'])) {
+                    $specConf = $this->conf['specConfs.'][$dat['uid'] . '.'];
+                    $specConf['_pid'] = $dat['uid'];
+                    break;
+                }
+            }
+        }
+        return $specConf;
+    }
+
+    /**
+     * Returns the HTML code for language indication.
+     *
+     * @param array $row Result row
+     * @return string HTML code for result row.
+     */
+    public function makeLanguageIndication($row)
+    {
+        // If search result is a TYPO3 page:
+        if ((string)$row['item_type'] === '0') {
+            // If TypoScript is used to render the flag:
+            if (is_array($this->conf['flagRendering.'])) {
+                $this->cObj->setCurrentVal($row['sys_language_uid']);
+                return $this->cObj->cObjGetSingle($this->conf['flagRendering'], $this->conf['flagRendering.']);
+            }
+        }
+        return '&nbsp;';
+    }
+
+    /**
+     * Returns the HTML code for the locking symbol.
+     * NOTICE: Requires a call to ->getPathFromPageId() first in order to work (done in ->makeInfo() by calling that first)
+     *
+     * @param int $id Page id for which to find answer
+     * @return string <img> tag if access is limited.
+     */
+    public function makeAccessIndication($id)
+    {
+        if (is_array($this->fe_groups_required[$id]) && !empty($this->fe_groups_required[$id])) {
+            return '<img src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('indexed_search') . 'Resources/Public/Icons/FileTypes/locked.gif" width="12" height="15" vspace="5" title="' . sprintf($this->pi_getLL('res_memberGroups', '', true), implode(',', array_unique($this->fe_groups_required[$id]))) . '" alt="" />';
+        }
+
+        return '';
+    }
+
+    /**
+     * Links the $str to page $id
+     *
+     * @param int $id Page id
+     * @param string $str Title String to link
+     * @param array $row Result row
+     * @param array $markUpSwParams Additional parameters for marking up seach words
+     * @return string <A> tag wrapped title string.
+     */
+    public function linkPage($id, $str, $row = array(), $markUpSwParams = array())
+    {
+        // Parameters for link:
+        $urlParameters = (array)unserialize($row['cHashParams']);
+        // Add &type and &MP variable:
+        if ($row['data_page_type']) {
+            $urlParameters['type'] = $row['data_page_type'];
+        }
+        if ($row['data_page_mp']) {
+            $urlParameters['MP'] = $row['data_page_mp'];
+        }
+        if ($row['sys_language_uid']) {
+            $urlParameters['L'] = $row['sys_language_uid'];
+        }
+        // markup-GET vars:
+        $urlParameters = array_merge($urlParameters, $markUpSwParams);
+        // This will make sure that the path is retrieved if it hasn't been already. Used only for the sake of the domain_record thing...
+        if (!is_array($this->domain_records[$id])) {
+            $this->getPathFromPageId($id);
+        }
+        // If external domain, then link to that:
+        if (!empty($this->domain_records[$id])) {
+            reset($this->domain_records[$id]);
+            $firstDom = current($this->domain_records[$id]);
+            $scheme = GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
+            $addParams = '';
+            if (is_array($urlParameters) && !empty($urlParameters)) {
+                $addParams .= GeneralUtility::implodeArrayForUrl('', $urlParameters);
+            }
+            if ($target = $this->conf['search.']['detect_sys_domain_records.']['target']) {
+                $target = ' target="' . $target . '"';
+            }
+            return '<a href="' . htmlspecialchars(($scheme . $firstDom . '/index.php?id=' . $id . $addParams)) . '"' . $target . '>' . htmlspecialchars($str) . '</a>';
+        } else {
+            return $this->pi_linkToPage($str, $id, $this->conf['result_link_target'], $urlParameters);
+        }
+    }
+
+    /**
+     * Returns the path to the page $id
+     *
+     * @param int $id Page ID
+     * @param string $pathMP MP variable content.
+     * @return string Root line for result.
+     */
+    public function getRootLine($id, $pathMP = '')
+    {
+        $identStr = $id . '|' . $pathMP;
+        if (!isset($this->cache_path[$identStr])) {
+            $this->cache_rl[$identStr] = $this->frontendController->sys_page->getRootLine($id, $pathMP);
+        }
+        return $this->cache_rl[$identStr];
+    }
+
+    /**
+     * Gets the first sys_domain record for the page, $id
+     *
+     * @param int $id Page id
+     * @return string Domain name
+     */
+    public function getFirstSysDomainRecordForPage($id)
+    {
+        $res = $this->databaseConnection->exec_SELECTquery('domainName', 'sys_domain', 'pid=' . (int)$id . $this->cObj->enableFields('sys_domain'), '', 'sorting');
+        $row = $this->databaseConnection->sql_fetch_assoc($res);
+        return rtrim($row['domainName'], '/');
+    }
+
+    /**
+     * Returns the path to the page $id
+     *
+     * @param int $id Page ID
+     * @param string $pathMP MP variable content
+     * @return string Path (HTML-escaped)
+     */
+    public function getPathFromPageId($id, $pathMP = '')
+    {
+        $identStr = $id . '|' . $pathMP;
+        if (!isset($this->cache_path[$identStr])) {
+            $this->fe_groups_required[$id] = array();
+            $this->domain_records[$id] = array();
+            $rl = $this->getRootLine($id, $pathMP);
+            $path = '';
+            $pageCount = count($rl);
+            if (is_array($rl) && !empty($rl)) {
+                $index = 0;
+                $breadcrumbWrap = isset($this->conf['breadcrumbWrap']) ? $this->conf['breadcrumbWrap'] : '/';
+                $breadcrumbWraps = $GLOBALS['TSFE']->tmpl->splitConfArray(array('wrap' => $breadcrumbWrap), $pageCount);
+                foreach ($rl as $k => $v) {
+                    // Check fe_user
+                    if ($v['fe_group'] && ($v['uid'] == $id || $v['extendToSubpages'])) {
+                        $this->fe_groups_required[$id][] = $v['fe_group'];
+                    }
+                    // Check sys_domain.
+                    if ($this->conf['search.']['detect_sys_domain_records']) {
+                        $sysDName = $this->getFirstSysDomainRecordForPage($v['uid']);
+                        if ($sysDName) {
+                            $this->domain_records[$id][] = $sysDName;
+                            // Set path accordingly:
+                            $path = $sysDName . $path;
+                            break;
+                        }
+                    }
+                    // Stop, if we find that the current id is the current root page.
+                    if ($v['uid'] == $this->frontendController->config['rootLine'][0]['uid']) {
+                        array_pop($breadcrumbWraps);
+                        break;
+                    }
+                    $path = $this->cObj->wrap(htmlspecialchars($v['title']), array_pop($breadcrumbWraps)['wrap']) . $path;
+                }
+            }
+            $this->cache_path[$identStr] = $path;
+            if (is_array($this->conf['path_stdWrap.'])) {
+                $this->cache_path[$identStr] = $this->cObj->stdWrap($this->cache_path[$identStr], $this->conf['path_stdWrap.']);
+            }
+        }
+        return $this->cache_path[$identStr];
+    }
+
+    /**
+     * Return the menu of pages used for the selector.
+     *
+     * @param int $id Page ID for which to return menu
+     * @return array Menu items (for making the section selector box)
+     */
+    public function getMenu($id)
+    {
+        if ($this->conf['show.']['LxALLtypes']) {
+            $output = array();
+            $res = $this->databaseConnection->exec_SELECTquery('title,uid', 'pages', 'pid=' . (int)$id . $this->cObj->enableFields('pages'), '', 'sorting');
+            while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
+                $output[$row['uid']] = $this->frontendController->sys_page->getPageOverlay($row);
+            }
+            $this->databaseConnection->sql_free_result($res);
+            return $output;
+        } else {
+            return $this->frontendController->sys_page->getMenu($id);
+        }
+    }
+
+    /**
+     * Returns if an item type is a multipage item type
+     *
+     * @param string $item_type Item type
+     * @return bool TRUE if multipage capable
+     */
+    public function multiplePagesType($item_type)
+    {
+        return is_object($this->external_parsers[$item_type]) && $this->external_parsers[$item_type]->isMultiplePageExtension($item_type);
+    }
+
+    /**
+     * Converts the input string from utf-8 to the backend charset.
+     *
+     * @param string String to convert (utf-8)
+     * @return string Converted string (backend charset if different from utf-8)
+     * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
+     */
+    public function utf8_to_currentCharset($str)
+    {
+        GeneralUtility::logDeprecatedFunction();
+        return $this->frontendController->csConv($str, 'utf-8');
+    }
+
+    /**
+     * Returns an object reference to the hook object if any
+     *
+     * @param string $functionName Name of the function you want to call / hook key
+     * @return object|NULL Hook object, if any. Otherwise NULL.
+     */
+    public function hookRequest($functionName)
+    {
+        // Hook: menuConfig_preProcessModMenu
+        if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]) {
+            $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]);
+            if (method_exists($hookObj, $functionName)) {
+                $hookObj->pObj = $this;
+                return $hookObj;
+            }
+        }
+    }
+
+    /**
+     * Obtains the URL of the search target page
+     *
+     * @return string
+     */
+    protected function getSearchFormActionURL()
+    {
+        $targetUrlPid = $this->getSearchFormActionPidFromTS();
+        if ($targetUrlPid == 0) {
+            $targetUrlPid = $this->frontendController->id;
+        }
+        return $this->pi_getPageLink($targetUrlPid, $this->frontendController->sPre);
+    }
+
+    /**
+     * Obtains search form target pid from the TypoScript configuration
+     *
+     * @return int
+     */
+    protected function getSearchFormActionPidFromTS()
+    {
+        $result = 0;
+        if (isset($this->conf['search.']['targetPid']) || isset($this->conf['search.']['targetPid.'])) {
+            if (is_array($this->conf['search.']['targetPid.'])) {
+                $result = $this->cObj->stdWrap($this->conf['search.']['targetPid'], $this->conf['search.']['targetPid.']);
+            } else {
+                $result = $this->conf['search.']['targetPid'];
+            }
+            $result = (int)$result;
+        }
+        return $result;
+    }
+
+    /**
+     * Formats date as 'created' date
+     *
+     * @param int $date
+     * @return string
+     */
+    protected function formatCreatedDate($date)
+    {
+        $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
+        return $this->formatDate($date, 'created', $defaultFormat);
+    }
+
+    /**
+     * Formats date as 'modified' date
+     *
+     * @param int $date
+     * @return string
+     */
+    protected function formatModifiedDate($date)
+    {
+        $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
+        return $this->formatDate($date, 'modified', $defaultFormat);
+    }
+
+    /**
+     * Formats the date using format string from TypoScript or default format
+     * if TypoScript format is not set
+     *
+     * @param int $date
+     * @param string $tsKey
+     * @param string $defaultFormat
+     * @return string
+     */
+    protected function formatDate($date, $tsKey, $defaultFormat)
+    {
+        $strftimeFormat = $this->conf['dateFormat.'][$tsKey];
+        if ($strftimeFormat) {
+            $result = strftime($strftimeFormat, $date);
+        } else {
+            $result = date($defaultFormat, $date);
+        }
+        return $result;
+    }
+
+    /**
+     * Search type
+     * e.g. sentence (20), any part of the word (1)
+     *
+     * @return int
+     */
+    public function getSearchType()
+    {
+        return (int)$this->piVars['type'];
+    }
+
+    /**
+     * A list of integer which should be root-pages to search from
+     *
+     * @return int[]
+     */
+    public function getSearchRootPageIdList()
+    {
+        return \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->wholeSiteIdList);
+    }
+
+    /**
+     * Getter for join_pages flag
+     * enabled through $this->conf['search.']['skipExtendToSubpagesChecking']
+     *
+     * @return bool
+     */
+    public function getJoinPagesForQuery()
+    {
+        return (bool)$this->join_pages;
+    }
+
+    /**
+     * Load settings and apply stdWrap to them
+     */
+    protected function loadSettings()
+    {
+        if (!is_array($this->conf['results.'])) {
+            $this->conf['results.'] = array();
+        }
+        $this->conf['results.']['summaryCropAfter'] = MathUtility::forceIntegerInRange(
+            $this->cObj->stdWrap($this->conf['results.']['summaryCropAfter'], $this->conf['results.']['summaryCropAfter.']),
+            10, 5000, 180
+        );
+        $this->conf['results.']['summaryCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['summaryCropSignifier'], $this->conf['results.']['summaryCropSignifier.']);
+        $this->conf['results.']['titleCropAfter'] = MathUtility::forceIntegerInRange(
+            $this->cObj->stdWrap($this->conf['results.']['titleCropAfter'], $this->conf['results.']['titleCropAfter.']),
+            10, 500, 50
+        );
+        $this->conf['results.']['titleCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['titleCropSignifier'], $this->conf['results.']['titleCropSignifier.']);
+        $this->conf['results.']['markupSW_summaryMax'] = MathUtility::forceIntegerInRange(
+            $this->cObj->stdWrap($this->conf['results.']['markupSW_summaryMax'], $this->conf['results.']['markupSW_summaryMax.']),
+            10, 5000, 300
+        );
+        $this->conf['results.']['markupSW_postPreLgd'] = MathUtility::forceIntegerInRange(
+            $this->cObj->stdWrap($this->conf['results.']['markupSW_postPreLgd'], $this->conf['results.']['markupSW_postPreLgd.']),
+            1, 500, 60
+        );
+        $this->conf['results.']['markupSW_postPreLgd_offset'] = MathUtility::forceIntegerInRange(
+            $this->cObj->stdWrap($this->conf['results.']['markupSW_postPreLgd_offset'], $this->conf['results.']['markupSW_postPreLgd_offset.']),
+            1, 50, 5
+        );
+        $this->conf['results.']['markupSW_divider'] = $this->cObj->stdWrap($this->conf['results.']['markupSW_divider'], $this->conf['results.']['markupSW_divider.']);
+        $this->conf['results.']['hrefInSummaryCropAfter'] = MathUtility::forceIntegerInRange(
+            $this->cObj->stdWrap($this->conf['results.']['hrefInSummaryCropAfter'], $this->conf['results.']['hrefInSummaryCropAfter.']),
+            10, 400, 60
+        );
+        $this->conf['results.']['hrefInSummaryCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['hrefInSummaryCropSignifier'], $this->conf['results.']['hrefInSummaryCropSignifier.']);
+    }
+}
diff --git a/typo3/sysext/compatibility7/Configuration/TCA/tt_content.php b/typo3/sysext/compatibility7/Configuration/TCA/tt_content.php
new file mode 100644 (file)
index 0000000..836d769
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+// Register "old" FE plugin and hide layout, select_key and pages fields in BE
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
+    array('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:mod_indexed_search', 'indexed_search'),
+    'list_type',
+    'indexed_search'
+);
+$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['indexed_search'] = 'layout,select_key,pages';
diff --git a/typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php b/typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php
new file mode 100644 (file)
index 0000000..d5c76b5
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+return [
+    'TYPO3\\CMS\\IndexedSearch\\Controller\\SearchFormController' => \TYPO3\CMS\Compatibility7\Controller\SearchFormController::class
+];
diff --git a/typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php b/typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php
new file mode 100644 (file)
index 0000000..422da82
--- /dev/null
@@ -0,0 +1,36 @@
+<?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!
+ */
+
+/**
+ * Icon for plugin wizard
+ */
+class tx_indexed_search_pi_wizicon
+{
+    /**
+     * Adds the indexed_search pi1 wizard icon
+     *
+     * @param array $wizardItems Input array with wizard items for plugins
+     * @return array Modified input array, having the item for indexed_search pi1 added.
+     */
+    public function proc($wizardItems)
+    {
+        $wizardItems['plugins_tx_indexed_search'] = array(
+            'iconIdentifier' => 'content-special-indexed_search',
+            'title' => $GLOBALS['LANG']->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_title'),
+            'description' => $GLOBALS['LANG']->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_description'),
+            'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=indexed_search'
+        );
+        return $wizardItems;
+    }
+}
diff --git a/typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl b/typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl
new file mode 100644 (file)
index 0000000..4776dc7
--- /dev/null
@@ -0,0 +1,259 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>indexed_search template</title>
+</head>
+
+<body>
+
+<h1>Indexed Search: Default template</h1>
+
+
+<h2>TEMPLATE_SEARCH_FORM</h2>
+<p><em>Template for displaying the search form.</em></p>
+
+<!-- ###SEARCH_FORM### begin -->
+<div class="tx-indexedsearch-searchbox">
+<form action="###ACTION_URL###" method="post" id="tx_indexedsearch">
+       <input type="hidden" name="tx_indexedsearch[_sections]" value="0" />
+       <input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
+       <input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" />
+       <!-- ###HIDDEN_FIELDS### begin -->
+       <input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" />
+       <!-- ###HIDDEN_FIELDS### end -->
+
+       <table cellpadding="0" cellspacing="0" border="0" summary="Search form">
+               <tr>
+                       <td>###FORM_SEARCHFOR###</td>
+                       <td colspan="2"><input type="search" name="tx_indexedsearch[sword]" value="###SWORD_VALUE###" class="tx-indexedsearch-searchbox-sword sword" ###PLACEHOLDER### /></td>
+               </tr>
+
+               <!-- ###ADDITONAL_KEYWORD### begin -->
+               <tr>
+                       <td>&nbsp;</td>
+                       <td colspan="2"><input type="hidden" name="tx_indexedsearch[sword_prev]" value="###SWORD_PREV_VALUE###" /><input type="checkbox" name="tx_indexedsearch[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" ###SWORD_PREV_INCLUDE_CHECKED### /> <label for="tx_indexedsearch_sword_prev_include">###ADD_TO_CURRENT_SEARCH###</label>.</td>
+               </tr>
+               <!-- ###ADDITONAL_KEYWORD### end -->
+
+               <!-- ###SEARCH_FORM_EXTENDED### begin -->
+
+               <!-- ###SELECT_SEARCH_FOR### begin -->
+               <tr>
+                       <td>###FORM_MATCH###</td>
+                       <td>
+                               <!-- ###SELECT_SEARCH_TYPE### begin -->
+                               <select name="tx_indexedsearch[type]" class="tx-indexedsearch-selectbox-type type">
+                                       ###SELECTBOX_TYPE_VALUES###
+                               </select>
+                               <!-- ###SELECT_SEARCH_TYPE### end -->
+                       </td>
+                       <td>
+                               <!-- ###SELECT_SEARCH_DEFOP### begin -->
+                               <select name="tx_indexedsearch[defOp]" class="tx-indexedsearch-selectbox-defop defop">
+                                       ###SELECTBOX_DEFOP_VALUES###
+                               </select>
+                               <!-- ###SELECT_SEARCH_DEFOP### end -->
+                       </td>
+               </tr>
+               <!-- ###SELECT_SEARCH_FOR### end -->
+
+               <!-- ###SELECT_SEARCH_IN### begin -->
+               <tr>
+                       <td>###FORM_SEARCHIN###</td>
+                       <td>
+                               <!-- ###SELECT_SEARCH_MEDIA### begin -->
+                               <select name="tx_indexedsearch[media]" class="tx-indexedsearch-selectbox-media media">
+                                       ###SELECTBOX_MEDIA_VALUES###
+                               </select>
+                               <!-- ###SELECT_SEARCH_MEDIA### end -->
+                       </td>
+                       <td>
+                               <!-- ###SELECT_SEARCH_LANG### begin -->
+                               <select name="tx_indexedsearch[lang]" class="tx-indexedsearch-selectbox-lang lang">
+                                       ###SELECTBOX_LANG_VALUES###
+                               </select>
+                               <!-- ###SELECT_SEARCH_LANG### end -->
+                       </td>
+               </tr>
+               <!-- ###SELECT_SEARCH_IN### end -->
+
+               <!-- ###SELECT_SECTION### begin -->
+               <tr>
+                       <td>###FORM_FROMSECTION###</td>
+                       <td colspan="2">
+                               <select name="tx_indexedsearch[sections]" class="tx-indexedsearch-selectbox-sections sections">
+                                       ###SELECTBOX_SECTIONS_VALUES###
+                               </select>
+                       </td>
+               </tr>
+               <!-- ###SELECT_SECTION### end -->
+
+               <!-- ###SELECT_FREEINDEXUID### begin -->
+               <tr>
+                       <td valign="top">###FORM_FREEINDEXUID###</td>
+                       <td colspan="2">
+                               <select name="tx_indexedsearch[freeIndexUid]" class="tx-indexedsearch-selectbox-freeIndexUid freeIndexUid">
+                                       ###SELECTBOX_FREEINDEXUIDS_VALUES###
+                               </select>
+                       </td>
+               </tr>
+               <!-- ###SELECT_FREEINDEXUID### end -->
+
+               <!-- ###SELECT_ORDER### begin -->
+               <tr>
+                       <td valign="top">###FORM_ORDERBY###</td>
+                       <td colspan="2">
+                               <select name="tx_indexedsearch[order]" class="tx-indexedsearch-selectbox-order order">
+                                       ###SELECTBOX_ORDER_VALUES###
+                               </select>&nbsp;
+                               <select name="tx_indexedsearch[desc]" class="tx-indexedsearch-selectbox-desc desc">
+                                       ###SELECTBOX_DESC_VALUES###
+                               </select>
+                       </td>
+               </tr>
+               <!-- ###SELECT_ORDER### end -->
+
+               <!-- ###SELECT_RESULTS### begin -->
+               <tr>
+                       <td valign="top">###FORM_ATATIME###</td>
+                       <td colspan="2">
+                               <select name="tx_indexedsearch[results]" class="tx-indexedsearch-selectbox-results results">
+                                       ###SELECTBOX_RESULTS_VALUES###
+                               </select>
+                       </td>
+               </tr>
+               <!-- ###SELECT_RESULTS### end -->
+
+               <!-- ###SELECT_GROUP### begin -->
+               <tr>
+                       <td valign="top">###FORM_STYLE###</td>
+                       <td colspan="2">
+                               <select name="tx_indexedsearch[group]" class="tx-indexedsearch-selectbox-group group">
+                                       ###SELECTBOX_GROUP_VALUES###
+                               </select>&nbsp;&nbsp;
+
+                               <!-- ###SELECT_EXTRESUME### begin -->
+                               <br /><input type="hidden" name="tx_indexedsearch[extResume]" value="0" /><input type="checkbox" value="1" name="tx_indexedsearch[extResume]" id="tx_indexedsearch_extResume" ###EXT_RESUME_CHECKED### /> <label for="tx_indexedsearch_extResume">###FORM_EXTRESUME###</label>
+                               <!-- ###SELECT_EXTRESUME### end -->
+                       </td>
+               </tr>
+               <!-- ###SELECT_GROUP### end -->
+
+               <!-- ###SEARCH_FORM_EXTENDED### end -->
+               <tr>
+                       <td>&nbsp;</td>
+                       <td><input type="submit" name="tx_indexedsearch[submit_button]" value="###FORM_SUBMIT###" class="tx-indexedsearch-searchbox-button submit" /></td>
+               </tr>
+       </table>
+       <p>###LINKTOOTHERMODE###</p>
+</form>
+</div>
+<!-- ###SEARCH_FORM### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_RULES</h2>
+<p><em>Template for displaying the search rules.</em></p>
+
+<!-- ###RULES### begin -->
+       <div class="tx-indexedsearch-rules">
+               <h2>###RULES_HEADER###</h2>
+               <p>###RULES_TEXT###</p>
+       </div>
+<!-- ###RULES### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_RESULT_SECTION_LINKS</h2>
+<p><em>Template for the section links in section mode.</em></p>
+
+<!-- ###RESULT_SECTION_LINKS### begin -->
+       <div class="tx-indexedsearch-sec">
+               <table cellpadding="0" cellspacing="0" border="0" summary="Result links">
+                       ###LINKS###
+               </table>
+       </div>
+<!-- ###RESULT_SECTION_LINKS### end -->
+
+<!-- ###RESULT_SECTION_LINKS_LINK### begin -->
+                       <tr>
+                               <td width="100%">--&gt; ###LINK###</td>
+                       </tr>
+<!-- ###RESULT_SECTION_LINKS_LINK### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_SECTION_HEADER</h2>
+<p><em>Template for the section title in section mode.</em></p>
+<!-- ###SECTION_HEADER### begin -->
+       <div class="tx-indexedsearch-secHead"><a name="###ANCHOR_URL###"></a>
+               <table cellpadding="0" cellspacing="0" border="0" summary="Section header">
+                       <tr>
+                               <td class="tx-indexedsearch-title title" width="100%">###SECTION_TITLE###</td>
+                               <td class="tx-indexedsearch-result-count result-count" nowrap="nowrap">###RESULT_COUNT### ###RESULT_NAME###</td>
+                       </tr>
+               </table>
+       </div>
+
+<!-- ###SECTION_HEADER### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_RESULT_OUTPUT</h2>
+<p><em>Template for the search result list.</em></p>
+
+<!-- ###RESULT_OUTPUT### begin -->
+       <div class="tx-indexedsearch-res">
+               <table cellpadding="0" cellspacing="0" border="0" summary="Result row">
+                       <!-- ###HEADER_ROW### begin -->
+                       <tr>
+                               <td class="tx-indexedsearch-icon icon" nowrap="nowrap">###ICON###</td>
+                               <td class="tx-indexedsearch-result-number result-number" nowrap="nowrap">###RESULT_NUMBER###</td>
+                               <td class="tx-indexedsearch-title###CSSSUFFIX### title" width="100%">###TITLE###</td>
+                               <td class="tx-indexedsearch-percent percent" nowrap="nowrap">###RATING###</td>
+                       </tr>
+                       <!-- ###HEADER_ROW### end -->
+
+                       <!-- ###ROW_LONG### begin -->
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td class="tx-indexedsearch-descr descr" width="100%" colspan="3">###DESCRIPTION###</td>
+                       </tr>
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td class="tx-indexedsearch-info info" width="100%" colspan="3">###TEXT_ITEM_SIZE### ###SIZE### - ###TEXT_ITEM_CRDATE### ###CREATED### - ###TEXT_ITEM_MTIME### ###MODIFIED###<br />
+                                       ###TEXT_ITEM_PATH### <span class="tx-indexedsearch-path path">###PATH###</span></td>
+                       </tr>
+                       <!-- ###ROW_LONG### end -->
+
+                       <!-- ###ROW_SHORT### begin -->
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td class="tx-indexedsearch-descr descr" width="100%" colspan="3">###DESCRIPTION###</td>
+                       </tr>
+                       <!-- ###ROW_SHORT### end -->
+
+                       <!-- ###ROW_SUB### begin -->
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td class="tx-indexedsearch-list list" width="100%" colspan="3"><br />###TEXT_ROW_SUB###<br /><br /></td>
+                       </tr>
+                       <!-- ###ROW_SUB### end -->
+               </table>
+               <br />
+       </div>
+<!-- ###RESULT_OUTPUT### end -->
+<br /><br />
+
+
+</body>
+</html>
diff --git a/typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl b/typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl
new file mode 100644 (file)
index 0000000..2cb0f45
--- /dev/null
@@ -0,0 +1,211 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <title>indexed_search template</title>
+</head>
+
+<body>
+
+<h1>Indexed Search: Tableless template</h1>
+
+
+<h2>TEMPLATE_SEARCH_FORM</h2>
+<p><em>Template for displaying the search form.</em></p>
+
+<!-- ###SEARCH_FORM### begin -->
+<div class="tx-indexedsearch-searchbox searchbox-tmpl-css">
+<form action="###ACTION_URL###" method="post" id="tx_indexedsearch">
+       <div>
+               <input type="hidden" name="tx_indexedsearch[_sections]" value="0" />
+               <input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
+               <input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" />
+               <!-- ###HIDDEN_FIELDS### begin -->
+               <input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" />
+               <!-- ###HIDDEN_FIELDS### end -->
+       </div>
+
+       <fieldset>
+               <legend>###FORM_LEGEND###</legend>
+
+               <div class="tx-indexedsearch-form">
+                       <label for="tx-indexedsearch-searchbox-sword">###FORM_SEARCHFOR###</label>
+                       <input type="search" name="tx_indexedsearch[sword]" value="###SWORD_VALUE###" id="tx-indexedsearch-searchbox-sword" class="tx-indexedsearch-searchbox-sword sword" ###PLACEHOLDER### />&nbsp;
+               </div>
+
+               <!-- ###ADDITONAL_KEYWORD### begin -->
+               <input type="hidden" name="tx_indexedsearch[sword_prev]" value="###SWORD_PREV_VALUE###" />
+               <input type="checkbox" name="tx_indexedsearch[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" ###SWORD_PREV_INCLUDE_CHECKED### /> <label for="tx_indexedsearch_sword_prev_include">###ADD_TO_CURRENT_SEARCH###.</label>
+               <!-- ###ADDITONAL_KEYWORD### end -->
+
+               <!-- ###SEARCH_FORM_EXTENDED### begin -->
+
+               <!-- ###SELECT_SEARCH_FOR### begin -->
+               <div class="tx-indexedsearch-search-for">
+                       <label for="tx-indexedsearch-selectbox-type">###FORM_MATCH###</label>
+
+                       <!-- ###SELECT_SEARCH_TYPE### begin -->
+                       <select name="tx_indexedsearch[type]" id="tx-indexedsearch-selectbox-type" class="tx-indexedsearch-selectbox-type type">###SELECTBOX_TYPE_VALUES###</select>&nbsp;
+                       <!-- ###SELECT_SEARCH_TYPE### end -->
+
+                       <!-- ###SELECT_SEARCH_DEFOP### begin -->
+                       <select name="tx_indexedsearch[defOp]" id="tx-indexedsearch-selectbox-defop" class="tx-indexedsearch-selectbox-defop defop">###SELECTBOX_DEFOP_VALUES###</select>
+                       <!-- ###SELECT_SEARCH_DEFOP### end -->
+               </div>
+               <!-- ###SELECT_SEARCH_FOR### end -->
+
+               <!-- ###SELECT_SEARCH_IN### begin -->
+               <div class="tx-indexedsearch-search-in">
+                       <label for="tx-indexedsearch-selectbox-media">###FORM_SEARCHIN###</label>
+
+                       <!-- ###SELECT_SEARCH_MEDIA### begin -->
+                       <select name="tx_indexedsearch[media]" id="tx-indexedsearch-selectbox-media" class="tx-indexedsearch-selectbox-media media">###SELECTBOX_MEDIA_VALUES###</select>&nbsp;
+                       <!-- ###SELECT_SEARCH_MEDIA### end -->
+
+                       <!-- ###SELECT_SEARCH_LANG### begin -->
+                       <select name="tx_indexedsearch[lang]" id="tx-indexedsearch-selectbox-lang" class="tx-indexedsearch-selectbox-lang lang">###SELECTBOX_LANG_VALUES###</select>
+                       <!-- ###SELECT_SEARCH_LANG### end -->
+               </div>
+               <!-- ###SELECT_SEARCH_IN### end -->
+
+               <!-- ###SELECT_SECTION### begin -->
+               <div class="tx-indexedsearch-search-select-section">
+                       <label for="tx-indexedsearch-selectbox-sections">###FORM_FROMSECTION###</label>
+                       <select name="tx_indexedsearch[sections]" id="tx-indexedsearch-selectbox-sections" class="tx-indexedsearch-selectbox-sections sections">###SELECTBOX_SECTIONS_VALUES###</select>
+               </div>
+               <!-- ###SELECT_SECTION### end -->
+
+               <!-- ###SELECT_FREEINDEXUID### begin -->
+               <div class="tx-indexedsearch-search-freeindexuid">
+                       <label for="tx-indexedsearch-selectbox-freeIndexUid">###FORM_FREEINDEXUID###</label>
+                       <select name="tx_indexedsearch[freeIndexUid]" id="tx-indexedsearch-selectbox-freeIndexUid" class="tx-indexedsearch-selectbox-freeIndexUid freeIndexUid">###SELECTBOX_FREEINDEXUIDS_VALUES###</select>
+               </div>
+               <!-- ###SELECT_FREEINDEXUID### end -->
+
+               <!-- ###SELECT_ORDER### begin -->
+               <div class="tx-indexedsearch-search-select-order">
+                       <label for="tx-indexedsearch-selectbox-order">###FORM_ORDERBY###</label>
+                       <select name="tx_indexedsearch[order]" id="tx-indexedsearch-selectbox-order" class="tx-indexedsearch-selectbox-order order">###SELECTBOX_ORDER_VALUES###</select>&nbsp;
+                       <select name="tx_indexedsearch[desc]" id="tx-indexedsearch-selectbox-desc" class="tx-indexedsearch-selectbox-desc desc">###SELECTBOX_DESC_VALUES###</select>
+               </div>
+               <!-- ###SELECT_ORDER### end -->
+
+               <!-- ###SELECT_RESULTS### begin -->
+               <div class="tx-indexedsearch-search-select-results">
+                       <label for="tx-indexedsearch-selectbox-results">###FORM_ATATIME###</label>
+                       <select name="tx_indexedsearch[results]" id="tx-indexedsearch-selectbox-results" class="tx-indexedsearch-selectbox-results results">###SELECTBOX_RESULTS_VALUES###</select>
+               </div>
+               <!-- ###SELECT_RESULTS### end -->
+
+               <!-- ###SELECT_GROUP### begin -->
+               <div class="tx-indexedsearch-search-select-group">
+                       <label for="tx-indexedsearch-selectbox-group">###FORM_STYLE###</label>
+                       <select name="tx_indexedsearch[group]" id="tx-indexedsearch-selectbox-group" class="tx-indexedsearch-selectbox-group group">###SELECTBOX_GROUP_VALUES###</select>
+
+                       <!-- ###SELECT_EXTRESUME### begin -->
+                       <input type="hidden" name="tx_indexedsearch[extResume]" value="0" />
+                       <input type="checkbox" value="1" name="tx_indexedsearch[extResume]" id="tx_indexedsearch_extResume" ###EXT_RESUME_CHECKED### /> <label for="tx_indexedsearch_extResume">###FORM_EXTRESUME###</label>
+                       <!-- ###SELECT_EXTRESUME### end -->
+               </div>
+               <!-- ###SELECT_GROUP### end -->
+
+               <!-- ###SEARCH_FORM_EXTENDED### end -->
+               <div class="tx-indexedsearch-search-submit">
+                       <input type="submit" name="tx_indexedsearch[submit_button]" value="###FORM_SUBMIT###" id="tx-indexedsearch-searchbox-button-submit" class="tx-indexedsearch-searchbox-button submit" />
+               </div>
+       </fieldset>
+       <p>###LINKTOOTHERMODE###</p>
+</form>
+</div>
+<!-- ###SEARCH_FORM### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_RULES</h2>
+<p><em>Template for displaying the search rules.</em></p>
+
+<!-- ###RULES### begin -->
+       <div class="tx-indexedsearch-rules">
+               <h2>###RULES_HEADER###</h2>
+               <p>###RULES_TEXT###</p>
+       </div>
+<!-- ###RULES### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_RESULT_SECTION_LINKS</h2>
+<p><em>Template for the section links in section mode.</em></p>
+
+<!-- ###RESULT_SECTION_LINKS### begin -->
+       <div class="tx-indexedsearch-sec">
+               <ol>
+                       ###LINKS###
+               </ol>
+       </div>
+<!-- ###RESULT_SECTION_LINKS### end -->
+
+<!-- ###RESULT_SECTION_LINKS_LINK### begin -->
+                       <li>###LINK###</li>
+<!-- ###RESULT_SECTION_LINKS_LINK### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_SECTION_HEADER</h2>
+<p><em>Template for the section title in section mode.</em></p>
+<!-- ###SECTION_HEADER### begin -->
+       <div id="###ANCHOR_URL###" class="tx-indexedsearch-secHead secHead-tmpl-css">
+               <h2 class="tx-indexedsearch-title title">###SECTION_TITLE### <span class="tx-indexedsearch-result-count result-count result-count-tmpl-css">###RESULT_COUNT### ###RESULT_NAME###</span></h2>
+       </div>
+
+<!-- ###SECTION_HEADER### end -->
+<br /><br />
+
+
+
+
+<h2>TEMPLATE_RESULT_OUTPUT</h2>
+<p><em>Template for the search result list.</em></p>
+<!-- ###RESULT_OUTPUT### begin -->
+       <div class="tx-indexedsearch-res res res-tmpl-css">
+               <!-- ###HEADER_ROW### begin -->
+               <h3><span class="tx-indexedsearch-icon icon">###ICON###</span> <span class="tx-indexedsearch-result-number result-number">###RESULT_NUMBER###</span> <span class="tx-indexedsearch-title###CSSSUFFIX### title">###TITLE###</span> <span class="tx-indexedsearch-percent percent percent-tmpl-css">###RATING###</span></h3>
+               <!-- ###HEADER_ROW### end -->
+
+               <!-- ###ROW_LONG### begin -->
+               <p class="tx-indexedsearch-descr descr">###DESCRIPTION###</p>
+               <dl class="tx-indexedsearch-info info info-tmpl-css">
+                       <dt class="tx-indexedsearch-text-item-size item-size">###TEXT_ITEM_SIZE###&nbsp;</dt>
+                       <dd class="tx-indexedsearch-text-item-size item-size">###SIZE###,&nbsp;</dd>
+
+                       <dt class="tx-indexedsearch-text-item-crdate item-crdate">###TEXT_ITEM_CRDATE###&nbsp;</dt>
+                       <dd class="tx-indexedsearch-text-item-crdate item-crdate">###CREATED###,&nbsp;</dd>
+
+                       <dt class="tx-indexedsearch-text-item-mtime item-mtime">###TEXT_ITEM_MTIME###&nbsp;</dt>
+                       <dd class="tx-indexedsearch-text-item-mtime item-mtime">###MODIFIED###</dd>
+
+                       <dt class="tx-indexedsearch-text-item-path item-path">###TEXT_ITEM_PATH###&nbsp;</dt>
+                       <dd class="tx-indexedsearch-text-item-path item-path">###PATH###</dd>
+               </dl>
+               <!-- ###ROW_LONG### end -->
+
+               <!-- ###ROW_SHORT### begin -->
+               <p class="tx-indexedsearch-descr descr">###DESCRIPTION###</p>
+               <!-- ###ROW_SHORT### end -->
+
+               <!-- ###ROW_SUB### begin -->
+               <p class="tx-indexedsearch-list list">###TEXT_ROW_SUB###</p>
+               <!-- ###ROW_SUB### end -->
+       </div>
+<!-- ###RESULT_OUTPUT### end -->
+<br /><br />
+
+
+</body>
+</html>
diff --git a/typo3/sysext/compatibility7/composer.json b/typo3/sysext/compatibility7/composer.json
new file mode 100644 (file)
index 0000000..2e017d5
--- /dev/null
@@ -0,0 +1,26 @@
+{
+       "name": "typo3/cms-compatibility7",
+       "type": "typo3-cms-framework",
+       "description": "TYPO3 Core",
+       "homepage": "https://typo3.org",
+       "license": ["GPL-2.0+"],
+
+       "require": {
+               "typo3/cms-core": "*"
+       },
+       "replace": {
+               "compatibility7": "*"
+       },
+       "extra": {
+               "typo3/class-alias-loader": {
+                       "class-alias-maps": [
+                               "Migrations/Code/ClassAliasMap.php"
+                       ]
+               }
+       },
+       "autoload": {
+               "psr-4": {
+                       "TYPO3\\CMS\\Compatibility7\\": "Classes/"
+               }
+       }
+}
diff --git a/typo3/sysext/compatibility7/ext_emconf.php b/typo3/sysext/compatibility7/ext_emconf.php
new file mode 100644 (file)
index 0000000..7262e1e
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+$EM_CONF[$_EXTKEY] = array(
+    'title' => 'Compatibility Mode for TYPO3 CMS 7.x',
+    'description' => 'Provides an additional backwards-compatibility layer with legacy functionality for sites that haven\'t fully migrated to v8 yet.',
+    'category' => 'be',
+    'state' => 'stable',
+    'uploadfolder' => 0,
+    'createDirs' => '',
+    'clearCacheOnLoad' => 0,
+    'author' => 'TYPO3 CMS Team',
+    'author_email' => '',
+    'author_company' => '',
+    'version' => '8.1.0',
+    'constraints' => array(
+        'depends' => array(
+            'typo3' => '8.1.0-8.1.99',
+        ),
+        'conflicts' => array(),
+        'suggests' => array(
+            'indexed_search'
+        ),
+    ),
+);
diff --git a/typo3/sysext/compatibility7/ext_icon.png b/typo3/sysext/compatibility7/ext_icon.png
new file mode 100644 (file)
index 0000000..ef81ce2
Binary files /dev/null and b/typo3/sysext/compatibility7/ext_icon.png differ
diff --git a/typo3/sysext/compatibility7/ext_localconf.php b/typo3/sysext/compatibility7/ext_localconf.php
new file mode 100644 (file)
index 0000000..73e7cce
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('indexed_search')) {
+    // register pibase plugin
+    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
+        'indexed_search',
+        'setup',
+        trim('
+            plugin.tx_indexedsearch = USER_INT
+            plugin.tx_indexedsearch.userFunc = ' . \TYPO3\CMS\Compatibility7\Controller\SearchFormController::class . '->main
+        ')
+    );
+    // add default rendering for pibase plugin
+    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
+        'indexed_search',
+        'setup',
+        'tt_content.list.20.indexed_search =< plugin.tx_indexedsearch',
+        'defaultContentRendering'
+    );
+}
\ No newline at end of file
diff --git a/typo3/sysext/compatibility7/ext_tables.php b/typo3/sysext/compatibility7/ext_tables.php
new file mode 100644 (file)
index 0000000..4295971
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+
+if (TYPO3_MODE === 'BE') {
+    if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('indexed_search')) {
+        $GLOBALS['TBE_MODULES_EXT']['xMOD_db_new_content_el']['addElClasses']['tx_indexed_search_pi_wizicon'] =
+            \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Resources/PHP/class.tx_indexed_search_pi_wizicon.php';
+    }
+}
diff --git a/typo3/sysext/compatibility7/ext_typoscript_setup.txt b/typo3/sysext/compatibility7/ext_typoscript_setup.txt
new file mode 100644 (file)
index 0000000..5087405
--- /dev/null
@@ -0,0 +1,135 @@
+config.index_enable = 0
+config.index_externals = 0
+config.index_metatags = 1
+
+plugin.tx_indexedsearch {
+       templateFile = EXT:compatibility7/Resources/Private/Templates/indexed_search.tmpl
+
+       # Date formats for created/modified dates in search results. See PHP strftime() function. Leave blank for using system defaults
+       dateFormat {
+               created =
+               modified =
+       }
+
+       breadcrumbWrap = / || /
+
+       show {
+               rules = 1
+               parsetimes = 0
+               L2sections = 0
+               L1sections = 1
+               LxALLtypes = 0
+               clearSearchBox = 0
+               clearSearchBox.enableSubSearchCheckBox = 0
+               forbiddenRecords = 0
+               alwaysShowPageLinks = 0
+               advancedSearchLink = 1
+               resultNumber = 0
+               mediaList =
+       }
+
+       # Blinding of option-selectors / values in these (advanced search) (see $optValues array in source code for options + extResume checkbox)
+       blind {
+               type = 0
+               defOp = 0
+               sections = 0
+               freeIndexUid = 1
+               media = 0
+               order = 0
+               group = 0
+               lang = 0
+               desc = 0
+               results = 0
+               # defOp.1=1
+               # extResume=1
+       }
+       rules_stdWrap {
+       }
+       sectionlinks_stdWrap {
+       }
+       path_stdWrap {
+       }
+       resultlist_stdWrap {
+       }
+       search {
+               rootPidList =
+               page_links = 10
+               detect_sys_domain_records = 0
+               defaultFreeIndexUidList = -1
+               skipExtendToSubpagesChecking = 0
+               exactCount = 0
+               targetPid.data = TSFE:id
+       }
+
+       # various crop/offset settings for single result items
+       results {
+               titleCropAfter = 50
+               titleCropSignifier = ...
+               summaryCropAfter = 180
+               summaryCropSignifier =
+               hrefInSummaryCropAfter = 60
+               hrefInSummaryCropSignifier = ...
+               markupSW_summaryMax = 300
+               markupSW_postPreLgd = 60
+               markupSW_postPreLgd_offset = 5
+               markupSW_divider = ...
+               markupSW_divider.noTrimWrap = | | |
+       }
+       result_link_target =
+/*
+       flagRendering = CASE
+       flagRendering {
+               key.current = 1
+               2 = TEXT
+               2.value = German
+               default = TEXT
+               default.value = English
+       }
+*/
+/*
+       iconRendering = CASE
+       iconRendering {
+               key.current = 1
+               html = TEXT
+               html.value = HtmL
+               default = TEXT
+               default.value = TYPO3 pages
+       }
+*/
+       forwardSearchWordsInResultLink = 0
+       forwardSearchWordsInResultLink.no_cache = 1
+       linkSectionTitles = 1
+
+       # Setting default values for piVars (please see the source code for the form-field names which you can preset values for here)
+       _DEFAULT_PI_VARS {
+               extResume = 1
+               type = 1
+               group = flat
+       }
+       _CSS_DEFAULT_STYLE (
+               .tx-indexedsearch .tx-indexedsearch-browsebox LI { display:inline; margin-right:5px; }
+               .tx-indexedsearch .tx-indexedsearch-searchbox INPUT.tx-indexedsearch-searchbox-button { width:100px; }
+               .tx-indexedsearch .tx-indexedsearch-searchbox INPUT.tx-indexedsearch-searchbox-sword { width:150px; }
+               .tx-indexedsearch .tx-indexedsearch-whatis { margin-top:10px; margin-bottom:5px; }
+               .tx-indexedsearch .tx-indexedsearch-whatis .tx-indexedsearch-sw { font-weight:bold; font-style:italic; }
+               .tx-indexedsearch .tx-indexedsearch-noresults { text-align:center; font-weight:bold; }
+               .tx-indexedsearch .tx-indexedsearch-res TD.tx-indexedsearch-descr { font-style:italic; }
+               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-descr .tx-indexedsearch-redMarkup { color:red; }
+               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-info { background:#eeeeee; }
+               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead { margin-top:20px; margin-bottom:5px; }
+               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead H2 { margin-top:0px; margin-bottom:0px; }
+               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead TD { background:#cccccc; vertical-align:middle; }
+               .tx-indexedsearch .tx-indexedsearch-res .noResume { color:#666666; }
+               .tx-indexedsearch .tx-indexedsearch-category { background:#cccccc; font-size:16px; font-weight:bold; }
+
+               /* Additional styles, needed for the tableless template_css.tmpl (styles don't conflict with the original template) */
+               .tx-indexedsearch .res-tmpl-css { clear:both; margin-bottom:1em; }
+               .tx-indexedsearch .searchbox-tmpl-css LABEL { margin-right:1em; width:10em; float:left; }
+               .tx-indexedsearch .result-count-tmpl-css, .tx-indexedsearch .percent-tmpl-css { letter-spacing:0; font-weight:normal; margin-top:-1.2em; float:right; }
+               .tx-indexedsearch .info-tmpl-css dt, .tx-indexedsearch dl.info-tmpl-css dd { float:left; }
+               .tx-indexedsearch .info-tmpl-css dd.item-mtime { float:none; }
+               .tx-indexedsearch .info-tmpl-css dd.item-path { float:none; }
+       )
+       _LOCAL_LANG {
+       }
+}
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-75349-MoveIndexedSearchPi-basedPluginToCompatibility7.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-75349-MoveIndexedSearchPi-basedPluginToCompatibility7.rst
new file mode 100644 (file)
index 0000000..4a0404a
--- /dev/null
@@ -0,0 +1,27 @@
+========================================================================
+Breaking: #75349 - Move Indexed Search pi-based plugin to compatibility7
+========================================================================
+
+Description
+===========
+
+Indexed Search pi1 plugin (based on AbstractPlugin) has been moved to compatibility7 extension and will not be developed further. The compatibility7 extension will be moved to TER before the release of 8 LTS.
+Extbase plugin (pi2) stays in Indexed Search as before.
+
+
+Impact
+======
+
+Installation of the compatibility7 extension is required to continue using pi1 plugin. In the longer run migration to Extbase plugin is required.
+
+
+Affected Installations
+======================
+
+All installations using pi-based indexed search plugin.
+
+
+Migration
+=========
+
+Installations using pi1 should migrate to Extbase plugin or install compatibility7 extension.
\ No newline at end of file
diff --git a/typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php b/typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
deleted file mode 100755 (executable)
index 23246b9..0000000
+++ /dev/null
@@ -1,2485 +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\Charset\CharsetConverter;
-use TYPO3\CMS\Core\Html\HtmlParser;
-use TYPO3\CMS\Core\TimeTracker\TimeTracker;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
-use TYPO3\CMS\IndexedSearch\Utility;
-
-/**
- * Index search frontend
- *
- * Creates a searchform for indexed search. Indexing must be enabled
- * for this to make sense.
- */
-class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
-{
-    /**
-     * Used as fieldname prefix
-     *
-     * @var string
-     */
-    public $prefixId = 'tx_indexedsearch';
-
-    /**
-     * Extension key.
-     *
-     * @var string
-     */
-    public $extKey = 'indexed_search';
-
-    /**
-     * See document for info about this flag...
-     *
-     * @var int
-     */
-    public $join_pages = 0;
-
-    public $defaultResultNumber = 10;
-
-    /**
-     * Internal variable
-     *
-     * @var array
-     */
-    public $operator_translate_table = array(array('+', 'AND'), array('|', 'OR'), array('-', 'AND NOT'));
-
-    /**
-     * Root-page ids to search in (rl0 field where clause, see initialize() function)
-     *
-     * @var int|string id or comma separated list of ids
-     */
-    public $wholeSiteIdList = 0;
-
-    /**
-     * Search Words and operators
-     *
-     * @var array
-     */
-    public $sWArr = array();
-
-    /**
-     * Selector box values for search configuration form
-     *
-     * @var array
-     */
-    public $optValues = array();
-
-    /**
-     * Will hold the first row in result - used to calculate relative hit-ratings.
-     *
-     * @var array
-     */
-    public $firstRow = array();
-
-    /**
-     * Caching of page path
-     *
-     * @var array
-     */
-    public $cache_path = array();
-
-    /**
-     * Caching of root line data
-     *
-     * @var array
-     */
-    public $cache_rl = array();
-
-    /**
-     * Required fe_groups memberships for display of a result.
-     *
-     * @var array
-     */
-    public $fe_groups_required = array();
-
-    /**
-     * sys_domain records
-     *
-     * @var array
-     */
-    public $domain_records = array();
-
-    /**
-     * Select clauses for individual words
-     *
-     * @var array
-     */
-    public $wSelClauses = array();
-
-    /**
-     * Page tree sections for search result.
-     *
-     * @var array
-     */
-    public $resultSections = array();
-
-    /**
-     * External parser objects
-     * @var array
-     */
-    public $external_parsers = array();
-
-    /**
-     * Storage of icons....
-     *
-     * @var array
-     */
-    public $iconFileNameCache = array();
-
-    /**
-     * Will hold the content of $conf['templateFile']
-     *
-     * @var string
-     */
-    public $templateCode = '';
-
-    public $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results';
-
-    /**
-     * Indexer configuration, coming from $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']
-     *
-     * @var array
-     */
-    public $indexerConfig = array();
-
-    /**
-     * @var bool
-     */
-    public $enableMetaphoneSearch = false;
-
-    public $storeMetaphoneInfoAsWords;
-
-    /**
-     * Lexer object
-     *
-     * @var \TYPO3\CMS\IndexedSearch\Lexer
-     */
-    public $lexerObj;
-
-    /**
-     * @var TimeTracker
-     */
-    protected $timeTracker;
-
-    /**
-     * @var CharsetConverter
-     */
-    protected $charsetConverter;
-
-    /**
-     * Main function, called from TypoScript as a USER_INT object.
-     *
-     * @param string $content Content input, ignore (just put blank string)
-     * @param array $conf TypoScript configuration of the plugin!
-     * @return string HTML code for the search form / result display.
-     */
-    public function main($content, $conf)
-    {
-        // Initialize:
-        $this->charsetConverter = GeneralUtility::makeInstance(CharsetConverter::class);
-        $this->conf = $conf;
-        $this->pi_loadLL('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf');
-        $this->pi_setPiVarDefaults();
-        // Initialize:
-        $this->initialize();
-        // Do search:
-        // If there were any search words entered...
-        if (is_array($this->sWArr) && !empty($this->sWArr)) {
-            $content = $this->doSearch($this->sWArr);
-        }
-        // Finally compile all the content, form, messages and results:
-        $content = $this->makeSearchForm($this->optValues) . $this->printRules() . $content;
-        return $this->pi_wrapInBaseClass($content);
-    }
-
-    /**
-     * Initialize internal variables, especially selector box values for the search form and search words
-     *
-     * @return void
-     */
-    public function initialize()
-    {
-        // Indexer configuration from Extension Manager interface:
-        $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
-        $this->enableMetaphoneSearch = (bool)$this->indexerConfig['enableMetaphoneSearch'];
-        $this->storeMetaphoneInfoAsWords = !\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_words');
-        $this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class);
-        // Initialize external document parsers for icon display and other soft operations
-        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]);
-                }
-            }
-        }
-        // Init lexer (used to post-processing of search words)
-        $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class;
-        $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
-        // If "_sections" is set, this value overrides any existing value.
-        if ($this->piVars['_sections']) {
-            $this->piVars['sections'] = $this->piVars['_sections'];
-        }
-        // If "_sections" is set, this value overrides any existing value.
-        if ($this->piVars['_freeIndexUid'] !== '_') {
-            $this->piVars['freeIndexUid'] = $this->piVars['_freeIndexUid'];
-        }
-        // Add previous search words to current
-        if ($this->piVars['sword_prev_include'] && $this->piVars['sword_prev']) {
-            $this->piVars['sword'] = trim($this->piVars['sword_prev']) . ' ' . $this->piVars['sword'];
-        }
-        $this->piVars['results'] = MathUtility::forceIntegerInRange($this->piVars['results'], 1, 100, $this->defaultResultNumber);
-        // Make sure that some cropping and markup constants used later are defined
-        $this->loadSettings();
-
-        // Selector-box values defined here:
-        $this->optValues = array(
-            'type' => array(
-                '0' => $this->pi_getLL('opt_type_0'),
-                '1' => $this->pi_getLL('opt_type_1'),
-                '2' => $this->pi_getLL('opt_type_2'),
-                '3' => $this->pi_getLL('opt_type_3'),
-                '10' => $this->pi_getLL('opt_type_10'),
-                '20' => $this->pi_getLL('opt_type_20')
-            ),
-            'defOp' => array(
-                '0' => $this->pi_getLL('opt_defOp_0'),
-                '1' => $this->pi_getLL('opt_defOp_1')
-            ),
-            'sections' => array(
-                '0' => $this->pi_getLL('opt_sections_0'),
-                '-1' => $this->pi_getLL('opt_sections_-1'),
-                '-2' => $this->pi_getLL('opt_sections_-2'),
-                '-3' => $this->pi_getLL('opt_sections_-3')
-            ),
-            'freeIndexUid' => array(
-                '-1' => $this->pi_getLL('opt_freeIndexUid_-1'),
-                '-2' => $this->pi_getLL('opt_freeIndexUid_-2'),
-                '0' => $this->pi_getLL('opt_freeIndexUid_0')
-            ),
-            'media' => array(
-                '-1' => $this->pi_getLL('opt_media_-1'),
-                '0' => $this->pi_getLL('opt_media_0'),
-                '-2' => $this->pi_getLL('opt_media_-2')
-            ),
-            'order' => array(
-                'rank_flag' => $this->pi_getLL('opt_order_rank_flag'),
-                'rank_freq' => $this->pi_getLL('opt_order_rank_freq'),
-                'rank_first' => $this->pi_getLL('opt_order_rank_first'),
-                'rank_count' => $this->pi_getLL('opt_order_rank_count'),
-                'mtime' => $this->pi_getLL('opt_order_mtime'),
-                'title' => $this->pi_getLL('opt_order_title'),
-                'crdate' => $this->pi_getLL('opt_order_crdate')
-            ),
-            'group' => array(
-                'sections' => $this->pi_getLL('opt_group_sections'),
-                'flat' => $this->pi_getLL('opt_group_flat')
-            ),
-            'lang' => array(
-                -1 => $this->pi_getLL('opt_lang_-1'),
-                0 => $this->pi_getLL('opt_lang_0')
-            ),
-            'desc' => array(
-                '0' => $this->pi_getLL('opt_desc_0'),
-                '1' => $this->pi_getLL('opt_desc_1')
-            ),
-            'results' => array(
-                '10' => '10',
-                '20' => '20',
-                '50' => '50',
-                '100' => '100'
-            )
-        );
-        // Remove this option if metaphone search is disabled)
-        if (!$this->enableMetaphoneSearch) {
-            unset($this->optValues['type']['10']);
-        }
-        // Free Index Uid:
-        if ($this->conf['search.']['defaultFreeIndexUidList']) {
-            $uidList = GeneralUtility::intExplode(',', $this->conf['search.']['defaultFreeIndexUidList']);
-            $indexCfgRecords = $this->databaseConnection->exec_SELECTgetRows('uid,title', 'index_config', 'uid IN (' . implode(',', $uidList) . ')' . $this->cObj->enableFields('index_config'), '', '', '', 'uid');
-            foreach ($uidList as $uidValue) {
-                if (is_array($indexCfgRecords[$uidValue])) {
-                    $this->optValues['freeIndexUid'][$uidValue] = $indexCfgRecords[$uidValue]['title'];
-                }
-            }
-        }
-        // Should we use join_pages instead of long lists of uids?
-        if ($this->conf['search.']['skipExtendToSubpagesChecking']) {
-            $this->join_pages = 1;
-        }
-        // Add media to search in:
-        if (trim($this->conf['search.']['mediaList']) !== '') {
-            $mediaList = implode(',', GeneralUtility::trimExplode(',', $this->conf['search.']['mediaList'], true));
-        }
-        foreach ($this->external_parsers as $extension => $obj) {
-            // Skip unwanted extensions
-            if ($mediaList && !GeneralUtility::inList($mediaList, $extension)) {
-                continue;
-            }
-            if ($name = $obj->searchTypeMediaTitle($extension)) {
-                $this->optValues['media'][$extension] = $this->pi_getLL('opt_sections_' . $extension, $name);
-            }
-        }
-        // Add operators for various languages
-        // Converts the operators to lowercase
-        $this->operator_translate_table[] = array($this->charsetConverter->conv_case('utf-8', $this->pi_getLL('local_operator_AND'), 'toLower'), 'AND');
-        $this->operator_translate_table[] = array($this->charsetConverter->conv_case('utf-8', $this->pi_getLL('local_operator_OR'), 'toLower'), 'OR');
-        $this->operator_translate_table[] = array($this->charsetConverter->conv_case('utf-8', $this->pi_getLL('local_operator_NOT'), 'toLower'), 'AND NOT');
-        // This is the id of the site root. This value may be a commalist of integer (prepared for this)
-        $this->wholeSiteIdList = (int)$this->frontendController->config['rootLine'][0]['uid'];
-        // Creating levels for section menu:
-        // This selects the first and secondary menus for the "sections" selector - so we can search in sections and sub sections.
-        if ($this->conf['show.']['L1sections']) {
-            $firstLevelMenu = $this->getMenu($this->wholeSiteIdList);
-            foreach ($firstLevelMenu as $optionName => $mR) {
-                if (!$mR['nav_hide']) {
-                    $this->optValues['sections']['rl1_' . $mR['uid']] = trim($this->pi_getLL('opt_RL1') . ' ' . $mR['title']);
-                    if ($this->conf['show.']['L2sections']) {
-                        $secondLevelMenu = $this->getMenu($mR['uid']);
-                        foreach ($secondLevelMenu as $kk2 => $mR2) {
-                            if (!$mR2['nav_hide']) {
-                                $this->optValues['sections']['rl2_' . $mR2['uid']] = trim($this->pi_getLL('opt_RL2') . ' ' . $mR2['title']);
-                            } else {
-                                unset($secondLevelMenu[$kk2]);
-                            }
-                        }
-                        $this->optValues['sections']['rl2_' . implode(',', array_keys($secondLevelMenu))] = $this->pi_getLL('opt_RL2ALL');
-                    }
-                } else {
-                    unset($firstLevelMenu[$optionName]);
-                }
-            }
-            $this->optValues['sections']['rl1_' . implode(',', array_keys($firstLevelMenu))] = $this->pi_getLL('opt_RL1ALL');
-        }
-        // Setting the list of root IDs for the search. Notice, these page IDs MUST have a TypoScript template with root flag on them! Basically this list is used to select on the "rl0" field and page ids are registered as "rl0" only if a TypoScript template record with root flag is there.
-        // This happens AFTER the use of $this->wholeSiteIdList above because the above will then fetch the menu for the CURRENT site - regardless of this kind of searching here. Thus a general search will lookup in the WHOLE database while a specific section search will take the current sections...
-        if ($this->conf['search.']['rootPidList']) {
-            $this->wholeSiteIdList = implode(',', GeneralUtility::intExplode(',', $this->conf['search.']['rootPidList']));
-        }
-        // Load the template
-        $this->templateCode = $this->cObj->fileResource($this->conf['templateFile']);
-        // Add search languages:
-        $res = $this->databaseConnection->exec_SELECTquery('*', 'sys_language', '1=1' . $this->cObj->enableFields('sys_language'));
-        while (false !== ($data = $this->databaseConnection->sql_fetch_assoc($res))) {
-            $this->optValues['lang'][$data['uid']] = $data['title'];
-        }
-        $this->databaseConnection->sql_free_result($res);
-        // Calling hook for modification of initialized content
-        if ($hookObj = $this->hookRequest('initialize_postProc')) {
-            $hookObj->initialize_postProc();
-        }
-        // Default values set:
-        // Setting first values in optValues as default values IF there is not corresponding piVar value set already.
-        foreach ($this->optValues as $optionName => $optionValue) {
-            if (!isset($this->piVars[$optionName])) {
-                reset($optionValue);
-                $this->piVars[$optionName] = key($optionValue);
-            }
-        }
-        // Blind selectors:
-        if (is_array($this->conf['blind.'])) {
-            foreach ($this->conf['blind.'] as $optionName => $optionValue) {
-                if (is_array($optionValue)) {
-                    foreach ($optionValue as $optionValueSubKey => $optionValueSubValue) {
-                        if (!is_array($optionValueSubValue) && $optionValueSubValue && is_array($this->optValues[substr($optionName, 0, -1)])) {
-                            unset($this->optValues[substr($optionName, 0, -1)][$optionValueSubKey]);
-                        }
-                    }
-                } elseif ($optionValue) {
-                    // If value is not set, unset the option array
-                    unset($this->optValues[$optionName]);
-                }
-            }
-        }
-        // This gets the search-words into the $sWArr:
-        $this->sWArr = $this->getSearchWords($this->piVars['defOp']);
-    }
-
-    /**
-     * Splits the search word input into an array where each word is represented by an array with key "sword" holding the search word and key "oper" holding the SQL operator (eg. AND, OR)
-     *
-     * Only words with 2 or more characters are accepted
-     * Max 200 chars total
-     * Space is used to split words, "" can be used search for a whole string
-     * AND, OR and NOT are prefix words, overruling the default operator
-     * +/|/- equals AND, OR and NOT as operators.
-     * All search words are converted to lowercase.
-     *
-     * $defOp is the default operator. 1=OR, 0=AND
-     *
-     * @param bool $defOp If TRUE, the default operator will be OR, not AND
-     * @return array Returns array with search words if any found
-     */
-    public function getSearchWords($defOp)
-    {
-        // Shorten search-word string to max 200 bytes (does NOT take multibyte charsets into account - but never mind, shortening the string here is only a run-away feature!)
-        $inSW = substr($this->piVars['sword'], 0, 200);
-        // Convert to UTF-8 + conv. entities (was also converted during indexing!)
-        $inSW = $this->charsetConverter->conv($inSW, $this->frontendController->metaCharset, 'utf-8');
-        $inSW = $this->charsetConverter->entities_to_utf8($inSW);
-        $sWordArray = false;
-        if ($hookObj = $this->hookRequest('getSearchWords')) {
-            $sWordArray = $hookObj->getSearchWords_splitSWords($inSW, $defOp);
-        } else {
-            if ($this->piVars['type'] == 20) {
-                // type = Sentence
-                $sWordArray = array(array('sword' => trim($inSW), 'oper' => 'AND'));
-            } else {
-                $searchWords = \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::getExplodedSearchString($inSW, $defOp == 1 ? 'OR' : 'AND', $this->operator_translate_table);
-                if (is_array($searchWords)) {
-                    $sWordArray = $this->procSearchWordsByLexer($searchWords);
-                }
-            }
-        }
-        return $sWordArray;
-    }
-
-    /**
-     * Post-process the search word array so it will match the words that was indexed (including case-folding if any)
-     * If any words are split into multiple words (eg. CJK will be!) the operator of the main word will remain.
-     *
-     * @param array $SWArr Search word array
-     * @return array Search word array, processed through lexer
-     */
-    public function procSearchWordsByLexer($SWArr)
-    {
-        // Init output variable:
-        $newSWArr = array();
-        // Traverse the search word array:
-        foreach ($SWArr as $wordDef) {
-            if (!strstr($wordDef['sword'], ' ')) {
-                // No space in word (otherwise it might be a sentense in quotes like "there is").
-                // Split the search word by lexer:
-                $res = $this->lexerObj->split2Words($wordDef['sword']);
-                // Traverse lexer result and add all words again:
-                foreach ($res as $word) {
-                    $newSWArr[] = array('sword' => $word, 'oper' => $wordDef['oper']);
-                }
-            } else {
-                $newSWArr[] = $wordDef;
-            }
-        }
-        // Return result:
-        return $newSWArr;
-    }
-
-    /*****************************
-     *
-     * Main functions
-     *
-     *****************************/
-    /**
-     * Performs the search, the display and writing stats
-     *
-     * @param array $sWArr Search words in array, see ->getSearchWords() for details
-     * @return string HTML for result display.
-     */
-    public function doSearch($sWArr)
-    {
-        // Find free index uid:
-        $freeIndexUid = $this->piVars['freeIndexUid'];
-        if ($freeIndexUid == -2) {
-            $freeIndexUid = $this->conf['search.']['defaultFreeIndexUidList'];
-        }
-        $indexCfgs = GeneralUtility::intExplode(',', $freeIndexUid);
-        $accumulatedContent = '';
-        foreach ($indexCfgs as $freeIndexUid) {
-            // Get result rows:
-            $pt1 = GeneralUtility::milliseconds();
-            if ($hookObj = $this->hookRequest('getResultRows')) {
-                $resData = $hookObj->getResultRows($sWArr, $freeIndexUid);
-            } else {
-                $resData = $this->getResultRows($sWArr, $freeIndexUid);
-            }
-            // Display search results:
-            $pt2 = GeneralUtility::milliseconds();
-            if ($hookObj = $this->hookRequest('getDisplayResults')) {
-                $content = $hookObj->getDisplayResults($sWArr, $resData, $freeIndexUid);
-            } else {
-                $content = $this->getDisplayResults($sWArr, $resData, $freeIndexUid);
-            }
-            $pt3 = GeneralUtility::milliseconds();
-            // Create header if we are searching more than one indexing configuration:
-            if (count($indexCfgs) > 1) {
-                if ($freeIndexUid > 0) {
-                    $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('title', 'index_config', 'uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
-                    $titleString = $indexCfgRec['title'];
-                } else {
-                    $titleString = $this->pi_getLL('opt_freeIndexUid_header_' . $freeIndexUid);
-                }
-                $content = '<h1 class="tx-indexedsearch-category">' . htmlspecialchars($titleString) . '</h1>' . $content;
-            }
-            $accumulatedContent .= $content;
-        }
-        // Write search statistics
-        $this->writeSearchStat($sWArr, $resData['count'], array($pt1, $pt2, $pt3));
-        // Return content:
-        return $accumulatedContent;
-    }
-
-    /**
-     * Get search result rows / data from database. Returned as data in array.
-     *
-     * @param array $searchWordArray Search word array
-     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
-     * @return array False if no result, otherwise an array with keys for first row, result rows and total number of results found.
-     */
-    public function getResultRows($searchWordArray, $freeIndexUid = -1)
-    {
-        // Getting SQL result pointer. This fetches ALL results (1,000,000 if found)
-        $this->timeTracker->push('Searching result');
-        if ($hookObj = &$this->hookRequest('getResultRows_SQLpointer')) {
-            $res = $hookObj->getResultRows_SQLpointer($searchWordArray, $freeIndexUid);
-        } else {
-            $res = $this->getResultRows_SQLpointer($searchWordArray, $freeIndexUid);
-        }
-        $this->timeTracker->pull();
-        // Organize and process result:
-        $result = false;
-        if ($res) {
-            $totalSearchResultCount = $this->databaseConnection->sql_num_rows($res);
-            // Total search-result count
-            $currentPageNumber = MathUtility::forceIntegerInRange($this->piVars['pointer'], 0, floor($totalSearchResultCount / $this->piVars['results']));
-            // The pointer is set to the result page that is currently being viewed
-            // Initialize result accumulation variables:
-            $positionInSearchResults = 0;
-            $groupingPhashes = array();
-            // Used for filtering out duplicates
-            $groupingChashes = array();
-            // Used for filtering out duplicates BASED ON cHash
-            $firstRow = array();
-            // Will hold the first row in result - used to calculate relative hit-ratings.
-            $resultRows = array();
-            // Will hold the results rows for display.
-            // Should we continue counting and checking of results even if
-            // we are sure they are not displayed in this request?
-            // This will slow down your page rendering, but it allows
-            // precise search result counters.
-            $calculateExactCount = (bool)$this->conf['search.']['exactCount'];
-            $lastResultNumberOnPreviousPage = $currentPageNumber * $this->piVars['results'];
-            $firstResultNumberOnNextPage = ($currentPageNumber + 1) * $this->piVars['results'];
-            $lastResultNumberToAnalyze = ($currentPageNumber + 1) * $this->piVars['results'] + $this->piVars['results'];
-            // Now, traverse result and put the rows to be displayed into an array
-            // Each row should contain the fields from 'ISEC.*, IP.*' combined + artificial fields "show_resume" (bool) and "result_number" (counter)
-            while (false !== ($row = $this->databaseConnection->sql_fetch_assoc($res))) {
-                // Set first row:
-                if ($positionInSearchResults === 0) {
-                    $firstRow = $row;
-                }
-                $row['show_resume'] = $this->checkResume($row);
-                // Tells whether we can link directly to a document or not (depends on possible right problems)
-                $phashGr = !in_array($row['phash_grouping'], $groupingPhashes);
-                $chashGr = !in_array(($row['contentHash'] . '.' . $row['data_page_id']), $groupingChashes);
-                if ($phashGr && $chashGr) {
-                    if ($row['show_resume'] || $this->conf['show.']['forbiddenRecords']) {
-                        // Only if the resume may be shown are we going to filter out duplicates...
-                        if (!$this->multiplePagesType($row['item_type'])) {
-                            // Only on documents which are not multiple pages documents
-                            $groupingPhashes[] = $row['phash_grouping'];
-                        }
-                        $groupingChashes[] = $row['contentHash'] . '.' . $row['data_page_id'];
-                        $positionInSearchResults++;
-                        // Check if we are inside result range for current page
-                        if ($positionInSearchResults > $lastResultNumberOnPreviousPage && $positionInSearchResults <= $lastResultNumberToAnalyze) {
-                            // Collect results to display
-                            $row['result_number'] = $positionInSearchResults;
-                            $resultRows[] = $row;
-                            // This may lead to a problem: If the result
-                            // check is not stopped here, the search will
-                            // take longer. However the result counter
-                            // will not filter out grouped cHashes/pHashes
-                            // that were not processed yet. You can change
-                            // this behavior using the "search.exactCount"
-                            // property (see above).
-                            $nextResultPosition = $positionInSearchResults + 1;
-                            if (!$calculateExactCount && $nextResultPosition > $firstResultNumberOnNextPage) {
-                                break;
-                            }
-                        }
-                    } else {
-                        // Skip this row if the user cannot view it (missing permission)
-                        $totalSearchResultCount--;
-                    }
-                } else {
-                    // For each time a phash_grouping document is found
-                    // (which is thus not displayed) the search-result count
-                    // is reduced, so that it matches the number of rows displayed.
-                    $totalSearchResultCount--;
-                }
-            }
-            $this->databaseConnection->sql_free_result($res);
-            $result = array(
-                'resultRows' => $resultRows,
-                'firstRow' => $firstRow,
-                'count' => $totalSearchResultCount
-            );
-        }
-        return $result;
-    }
-
-    /**
-     * Gets a SQL result pointer to traverse for the search records.
-     *
-     * @param array $sWArr Search words
-     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
-     * @return bool|\mysqli_result Query result pointer
-     */
-    public function getResultRows_SQLpointer($sWArr, $freeIndexUid = -1)
-    {
-        // This SEARCHES for the searchwords in $sWArr AND returns a COMPLETE list of phash-integers of the matches.
-        $list = $this->getPhashList($sWArr);
-        // Perform SQL Search / collection of result rows array:
-        if ($list) {
-            // Do the search:
-            $this->timeTracker->push('execFinalQuery');
-            $res = $this->execFinalQuery($list, $freeIndexUid);
-            $this->timeTracker->pull();
-            return $res;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Compiles the HTML display of the incoming array of result rows.
-     *
-     * @param array $sWArr Search words array (for display of text describing what was searched for)
-     * @param array $resData Array with result rows, count, first row.
-     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
-     * @return string HTML content to display result.
-     */
-    public function getDisplayResults($sWArr, $resData, $freeIndexUid = -1)
-    {
-        $content = '';
-        // Perform display of result rows array:
-        if ($resData) {
-            $this->timeTracker->push('Display Final result');
-            // Set first selected row (for calculation of ranking later)
-            $this->firstRow = $resData['firstRow'];
-            // Result display here:
-            $rowcontent = '';
-            $rowcontent .= $this->compileResult($resData['resultRows'], $freeIndexUid);
-            // Browsing box:
-            if ($resData['count']) {
-                $this->internal['res_count'] = $resData['count'];
-                $this->internal['results_at_a_time'] = $this->piVars['results'];
-                $this->internal['maxPages'] = MathUtility::forceIntegerInRange($this->conf['search.']['page_links'], 1, 100, 10);
-                $resultSectionsCount = count($this->resultSections);
-                $addString = $resData['count'] && $this->piVars['group'] == 'sections' && $freeIndexUid <= 0 ? ' ' . sprintf($this->pi_getLL(($resultSectionsCount > 1 ? 'inNsections' : 'inNsection')), $resultSectionsCount) : '';
-                $browseBox1 = $this->renderPagination(1, $addString, $this->printResultSectionLinks(), $freeIndexUid);
-                $browseBox2 = $this->renderPagination(0, '', '', $freeIndexUid);
-                // Browsing nav, bottom.
-                $content = $browseBox1 . $rowcontent . $browseBox2;
-            } else {
-                $content = '<p' . $this->pi_classParam('noresults') . '>' . $this->pi_getLL('noResults', '', true) . '</p>';
-            }
-            $this->timeTracker->pull();
-        } else {
-            $content .= '<p' . $this->pi_classParam('noresults') . '>' . $this->pi_getLL('noResults', '', true) . '</p>';
-        }
-        // Print a message telling which words we searched for, and in which sections etc.
-        $what = $this->tellUsWhatIsSeachedFor($sWArr) . (substr($this->piVars['sections'], 0, 2) == 'rl' ? ' ' . $this->pi_getLL('inSection', '', true) . ' "' . $this->getPathFromPageId(substr($this->piVars['sections'], 4)) . '"' : '');
-        $what = '<div' . $this->pi_classParam('whatis') . '>' . $this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']) . '</div>';
-        $content = $what . $content;
-        // Return content:
-        return $content;
-    }
-
-    /**
-     * Takes the array with resultrows as input and returns the result-HTML-code
-     * Takes the "group" var into account: Makes a "section" or "flat" display.
-     *
-     * @param array $resultRows Result rows
-     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
-     * @return string HTML
-     */
-    public function compileResult($resultRows, $freeIndexUid = -1)
-    {
-        $content = '';
-        // Transfer result rows to new variable, performing some mapping of sub-results etc.
-        $newResultRows = array();
-        foreach ($resultRows as $row) {
-            $id = md5($row['phash_grouping']);
-            if (is_array($newResultRows[$id])) {
-                if (!$newResultRows[$id]['show_resume'] && $row['show_resume']) {
-                    // swapping:
-                    // Remove old
-                    $subrows = $newResultRows[$id]['_sub'];
-                    unset($newResultRows[$id]['_sub']);
-                    $subrows[] = $newResultRows[$id];
-                    // Insert new:
-                    $newResultRows[$id] = $row;
-                    $newResultRows[$id]['_sub'] = $subrows;
-                } else {
-                    $newResultRows[$id]['_sub'][] = $row;
-                }
-            } else {
-                $newResultRows[$id] = $row;
-            }
-        }
-        $resultRows = $newResultRows;
-        $this->resultSections = array();
-        if ($freeIndexUid <= 0) {
-            switch ($this->piVars['group']) {
-                case 'sections':
-                    $rl2flag = substr($this->piVars['sections'], 0, 2) == 'rl';
-                    $sections = array();
-                    foreach ($resultRows as $row) {
-                        $id = $row['rl0'] . '-' . $row['rl1'] . ($rl2flag ? '-' . $row['rl2'] : '');
-                        $sections[$id][] = $row;
-                    }
-                    $this->resultSections = array();
-                    foreach ($sections as $id => $resultRows) {
-                        $rlParts = explode('-', $id);
-                        $theId = $rlParts[2] ? $rlParts[2] : ($rlParts[1] ? $rlParts[1] : $rlParts[0]);
-                        $theRLid = $rlParts[2] ? 'rl2_' . $rlParts[2] : ($rlParts[1] ? 'rl1_' . $rlParts[1] : '0');
-                        $sectionName = $this->getPathFromPageId($theId);
-                        if ($sectionName[0] == '/') {
-                            $sectionName = substr($sectionName, 1);
-                        }
-                        if (!trim($sectionName)) {
-                            $sectionTitleLinked = $this->pi_getLL('unnamedSection', '', true) . ':';
-                        } elseif ($this->conf['linkSectionTitles']) {
-                            $quotedPrefix = GeneralUtility::quoteJSvalue($this->prefixId);
-                            $onclick = 'document.forms[' . $quotedPrefix . '][' . GeneralUtility::quoteJSvalue($this->prefixId . '[_sections]') . '].value=' . GeneralUtility::quoteJSvalue($theRLid) . ';document.forms[' . $quotedPrefix . '].submit();return false;';
-                            $sectionTitleLinked = '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $sectionName . ':</a>';
-                        } else {
-                            $sectionTitleLinked = $sectionName;
-                        }
-                        $resultRowsCount = count($resultRows);
-                        $this->resultSections[$id] = array($sectionName, $resultRowsCount);
-                        // Add content header:
-                        $content .= $this->makeSectionHeader($id, $sectionTitleLinked, $resultRowsCount);
-                        // Render result rows:
-                        $resultlist = '';
-                        foreach ($resultRows as $row) {
-                            $resultlist .= $this->printResultRow($row);
-                        }
-                        $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']);
-                    }
-                    break;
-                default:
-                    // flat:
-                    $resultlist = '';
-                    foreach ($resultRows as $row) {
-                        $resultlist .= $this->printResultRow($row);
-                    }
-                    $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']);
-            }
-        } else {
-            $resultlist = '';
-            foreach ($resultRows as $row) {
-                $resultlist .= $this->printResultRow($row);
-            }
-            $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']);
-        }
-        return '<div' . $this->pi_classParam('res') . '>' . $content . '</div>';
-    }
-
-    /***********************************
-     *
-     * Searching functions (SQL)
-     *
-     ***********************************/
-    /**
-     * Returns a COMPLETE list of phash-integers matching the search-result composed of the search-words in the sWArr array.
-     * The list of phash integers are unsorted and should be used for subsequent selection of index_phash records for display of the result.
-     *
-     * @param array $sWArr Search word array
-     * @return string List of integers
-     */
-    public function getPhashList($sWArr)
-    {
-        // Initialize variables:
-        $c = 0;
-        $totalHashList = array();
-        // This array accumulates the phash-values
-        // Traverse searchwords; for each, select all phash integers and merge/diff/intersect them with previous word (based on operator)
-        foreach ($sWArr as $k => $v) {
-            // Making the query for a single search word based on the search-type
-            $sWord = $v['sword'];
-            $theType = (string)$this->piVars['type'];
-            if (strstr($sWord, ' ')) {
-                // If there are spaces in the search-word, make a full text search instead.
-                $theType = 20;
-            }
-            $this->timeTracker->push('SearchWord "' . $sWord . '" - $theType=' . $theType);
-            // Perform search for word:
-            switch ($theType) {
-                case '1':
-                    // Part of word
-                    $res = $this->searchWord($sWord, Utility\LikeWildcard::BOTH);
-                    break;
-                case '2':
-                    // First part of word
-                    $res = $this->searchWord($sWord, Utility\LikeWildcard::RIGHT);
-                    break;
-                case '3':
-                    // Last part of word
-                    $res = $this->searchWord($sWord, Utility\LikeWildcard::LEFT);
-                    break;
-                case '10':
-                    // Sounds like
-                    /**
-                    * Indexer object
-                    *
-                    * @var \TYPO3\CMS\IndexedSearch\Indexer
-                    */
-                    // Initialize the indexer-class
-                    $indexerObj = GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class);
-                    // Perform metaphone search
-                    $res = $this->searchMetaphone($indexerObj->metaphone($sWord, $this->storeMetaphoneInfoAsWords));
-                    unset($indexerObj);
-                    break;
-                case '20':
-                    // Sentence
-                    $res = $this->searchSentence($sWord);
-                    $this->piVars['order'] = 'mtime';
-                    // If there is a fulltext search for a sentence there is a likeliness that sorting cannot be done by the rankings from the rel-table (because no relations will exist for the sentence in the word-table). So therefore mtime is used instead. It is not required, but otherwise some hits may be left out.
-                    break;
-                default:
-                    // Distinct word
-                    $res = $this->searchDistinct($sWord);
-            }
-            // If there was a query to do, then select all phash-integers which resulted from this.
-            if ($res) {
-                // Get phash list by searching for it:
-                $phashList = array();
-                while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
-                    $phashList[] = $row['phash'];
-                }
-                $this->databaseConnection->sql_free_result($res);
-                // Here the phash list are merged with the existing result based on whether we are dealing with OR, NOT or AND operations.
-                if ($c) {
-                    switch ($v['oper']) {
-                        case 'OR':
-                            $totalHashList = array_unique(array_merge($phashList, $totalHashList));
-                            break;
-                        case 'AND NOT':
-                            $totalHashList = array_diff($totalHashList, $phashList);
-                            break;
-                        default:
-                            // AND...
-                            $totalHashList = array_intersect($totalHashList, $phashList);
-                    }
-                } else {
-                    $totalHashList = $phashList;
-                }
-            }
-            $this->timeTracker->pull();
-            $c++;
-        }
-        return implode(',', $totalHashList);
-    }
-
-    /**
-     * Returns a query which selects the search-word from the word/rel tables.
-     *
-     * @param string $wordSel WHERE clause selecting the word from phash
-     * @param string $plusQ Additional AND clause in the end of the query.
-     * @return bool|\mysqli_result SQL result pointer
-     */
-    public function execPHashListQuery($wordSel, $plusQ = '')
-    {
-        return $this->databaseConnection->exec_SELECTquery('IR.phash', 'index_words IW,
-                                               index_rel IR,
-                                               index_section ISEC', $wordSel . '
-                                               AND IW.wid=IR.wid
-                                               AND ISEC.phash = IR.phash
-                                               ' . $this->sectionTableWhere() . '
-                                               ' . $plusQ, 'IR.phash');
-    }
-
-    /**
-     * Search for a word
-     *
-     * @param string $sWord Word to search for
-     * @param int $wildcard Bit-field of Utility\LikeWildcard
-     * @return bool|\mysqli_result SQL result pointer
-     */
-    public function searchWord($sWord, $wildcard)
-    {
-        $likeWildcard = Utility\LikeWildcard::cast($wildcard);
-        $wSel = $likeWildcard->getLikeQueryPart(
-            'index_words',
-            'IW.baseword',
-            $sWord
-        );
-
-        $this->wSelClauses[] = $wSel;
-        $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
-        return $res;
-    }
-
-    /**
-     * Search for one distinct word
-     *
-     * @param string $sWord Word to search for
-     * @return bool|\mysqli_result SQL result pointer
-     */
-    public function searchDistinct($sWord)
-    {
-        $wSel = 'IW.wid=' . \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash($sWord);
-        $this->wSelClauses[] = $wSel;
-        $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
-        return $res;
-    }
-
-    /**
-     * Search for a sentence
-     *
-     * @param string $sSentence Sentence to search for
-     * @return bool|\mysqli_result SQL result pointer
-     */
-    public function searchSentence($sSentence)
-    {
-        $this->wSelClauses[] = '1=1';
-        $likeWildcard = Utility\LikeWildcard::cast(Utility\LikeWildcard::BOTH);
-        $likePart = $likeWildcard->getLikeQueryPart(
-            'index_fulltext',
-            'IFT.fulltextdata',
-            $sSentence
-        );
-
-        return $this->databaseConnection->exec_SELECTquery('ISEC.phash',
-            'index_section ISEC, index_fulltext IFT',
-            $likePart . ' AND ISEC.phash = IFT.phash' . $this->sectionTableWhere(), 'ISEC.phash'
-        );
-    }
-
-    /**
-     * Search for a metaphone word
-     *
-     * @param string $sWord Word to search for
-     * @return \mysqli_result SQL result pointer
-     */
-    public function searchMetaphone($sWord)
-    {
-        $wSel = 'IW.metaphone=' . $sWord;
-        $this->wSelClauses[] = $wSel;
-        return $this->execPHashListQuery($wSel, ' AND is_stopword=0');
-    }
-
-    /**
-     * Returns AND statement for selection of section in database. (rootlevel 0-2 + page_id)
-     *
-     * @return string AND clause for selection of section in database.
-     */
-    public function sectionTableWhere()
-    {
-        $out = $this->wholeSiteIdList < 0 ? '' : ' AND ISEC.rl0 IN (' . $this->wholeSiteIdList . ')';
-        $match = '';
-        if (substr($this->piVars['sections'], 0, 4) == 'rl1_') {
-            $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], 4)));
-            $out .= ' AND ISEC.rl1 IN (' . $list . ')';
-            $match = true;
-        } elseif (substr($this->piVars['sections'], 0, 4) == 'rl2_') {
-            $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], 4)));
-            $out .= ' AND ISEC.rl2 IN (' . $list . ')';
-            $match = true;
-        } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) {
-            // Traversing user configured fields to see if any of those are used to limit search to a section:
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) {
-                if (substr($this->piVars['sections'], 0, strlen($fieldName) + 1) == $fieldName . '_') {
-                    $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], strlen($fieldName) + 1)));
-                    $out .= ' AND ISEC.' . $fieldName . ' IN (' . $list . ')';
-                    $match = true;
-                    break;
-                }
-            }
-        }
-        // If no match above, test the static types:
-        if (!$match) {
-            switch ((string)$this->piVars['sections']) {
-                case '-1':
-                    // '-1' => 'Only this page',
-                    $out .= ' AND ISEC.page_id=' . $this->frontendController->id;
-                    break;
-                case '-2':
-                    // '-2' => 'Top + level 1',
-                    $out .= ' AND ISEC.rl2=0';
-                    break;
-                case '-3':
-                    // '-3' => 'Level 2 and out',
-                    $out .= ' AND ISEC.rl2>0';
-                    break;
-            }
-        }
-        return $out;
-    }
-
-    /**
-     * Returns AND statement for selection of media type
-     *
-     * @return string AND statement for selection of media type
-     */
-    public function mediaTypeWhere()
-    {
-        switch ((string)$this->piVars['media']) {
-            case '0':
-                // '0' => 'Kun TYPO3 sider',
-                $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr('0', 'index_phash');
-                break;
-            case '-2':
-                // All external documents
-                $out = ' AND IP.item_type<>' . $this->databaseConnection->fullQuoteStr('0', 'index_phash');
-                break;
-            case '-1':
-                // All content
-                $out = '';
-                break;
-            default:
-                $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr($this->piVars['media'], 'index_phash');
-        }
-        return $out;
-    }
-
-    /**
-     * Returns AND statement for selection of language
-     *
-     * @return string AND statement for selection of language
-     */
-    public function languageWhere()
-    {
-        $languageWhere = '';
-        if ($this->piVars['lang'] >= 0) {
-            // -1 is the same as ALL language.
-            $languageWhere = 'AND IP.sys_language_uid=' . (int)$this->piVars['lang'];
-        }
-        return $languageWhere;
-    }
-
-    /**
-     * Where-clause for free index-uid value.
-     *
-     * @param int $freeIndexUid Free Index UID value to limit search to.
-     * @return string WHERE SQL clause part.
-     */
-    public function freeIndexUidWhere($freeIndexUid)
-    {
-        if ($freeIndexUid < 0) {
-            return '';
-        }
-        // First, look if the freeIndexUid is a meta configuration:
-        $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('indexcfgs', 'index_config', 'type=5 AND uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
-        if (is_array($indexCfgRec)) {
-            $refs = GeneralUtility::trimExplode(',', $indexCfgRec['indexcfgs']);
-            $list = array(-99);
-            // Default value to protect against empty array.
-            foreach ($refs as $ref) {
-                list($table, $uid) = GeneralUtility::revExplode('_', $ref, 2);
-                switch ($table) {
-                    case 'index_config':
-                        $idxRec = $this->databaseConnection->exec_SELECTgetSingleRow('uid', 'index_config', 'uid=' . (int)$uid . $this->cObj->enableFields('index_config'));
-                        if ($idxRec) {
-                            $list[] = $uid;
-                        }
-                        break;
-                    case 'pages':
-                        $indexCfgRecordsFromPid = $this->databaseConnection->exec_SELECTgetRows('uid', 'index_config', 'pid=' . (int)$uid . $this->cObj->enableFields('index_config'));
-                        foreach ($indexCfgRecordsFromPid as $idxRec) {
-                            $list[] = $idxRec['uid'];
-                        }
-                        break;
-                }
-            }
-            $list = array_unique($list);
-        } else {
-            $list = array((int)$freeIndexUid);
-        }
-        return ' AND IP.freeIndexUid IN (' . implode(',', $list) . ')';
-    }
-
-    /**
-     * Execute final query, based on phash integer list. The main point is sorting the result in the right order.
-     *
-     * @param string $list List of phash integers which match the search.
-     * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content.
-     * @return bool|\mysqli_result Query result pointer
-     */
-    public function execFinalQuery($list, $freeIndexUid = -1)
-    {
-        // Setting up methods of filtering results based on page types, access, etc.
-        $page_join = '';
-        $page_where = '';
-        // Calling hook for alternative creation of page ID list
-        if ($hookObj = $this->hookRequest('execFinalQuery_idList')) {
-            $page_where = $hookObj->execFinalQuery_idList($list);
-        } elseif ($this->join_pages) {
-            // Alternative to getting all page ids by ->getTreeList() where "excludeSubpages" is NOT respected.
-            $page_join = ',
-                               pages';
-            $page_where = 'pages.uid = ISEC.page_id
-                               ' . $this->cObj->enableFields('pages') . '
-                               AND pages.no_search=0
-                               AND pages.doktype<200
-                       ';
-        } elseif ($this->wholeSiteIdList >= 0) {
-            // Collecting all pages IDs in which to search; filtering out ALL pages that are not accessible due to enableFields. Does NOT look for "no_search" field!
-            $siteIdNumbers = GeneralUtility::intExplode(',', $this->wholeSiteIdList);
-            $id_list = array();
-            foreach ($siteIdNumbers as $rootId) {
-                $id_list[] = $this->cObj->getTreeList(-1 * $rootId, 9999);
-            }
-            $page_where = 'ISEC.page_id IN (' . implode(',', $id_list) . ')';
-        } else {
-            // Disable everything... (select all)
-            $page_where = '1=1';
-        }
-        // Indexing configuration clause:
-        $freeIndexUidClause = $this->freeIndexUidWhere($freeIndexUid);
-        // If any of the ranking sortings are selected, we must make a join with the word/rel-table again, because we need to calculate ranking based on all search-words found.
-        if (substr($this->piVars['order'], 0, 5) == 'rank_') {
-            switch ($this->piVars['order']) {
-                case 'rank_flag':
-                    // This gives priority to word-position (max-value) so that words in title, keywords, description counts more than in content.
-                    // The ordering is refined with the frequency sum as well.
-                    $grsel = 'MAX(IR.flags) AS order_val1, SUM(IR.freq) AS order_val2';
-                    $orderBy = 'order_val1' . $this->isDescending() . ',order_val2' . $this->isDescending();
-                    break;
-                case 'rank_first':
-                    // Results in average position of search words on page. Must be inversely sorted (low numbers are closer to top)
-                    $grsel = 'AVG(IR.first) AS order_val';
-                    $orderBy = 'order_val' . $this->isDescending(1);
-                    break;
-                case 'rank_count':
-                    // Number of words found
-                    $grsel = 'SUM(IR.count) AS order_val';
-                    $orderBy = 'order_val' . $this->isDescending();
-                    break;
-                default:
-                    // Frequency sum. I'm not sure if this is the best way to do it (make a sum...). Or should it be the average?
-                    $grsel = 'SUM(IR.freq) AS order_val';
-                    $orderBy = 'order_val' . $this->isDescending();
-            }
-
-            // So, words are imploded into an OR statement (no "sentence search" should be done here - may deselect results)
-            $wordSel = '(' . implode(' OR ', $this->wSelClauses) . ') AND ';
-
-            $res = $this->databaseConnection->exec_SELECTquery(
-                'ISEC.*, IP.*, ' . $grsel,
-                'index_words IW,
-                                       index_rel IR,
-                                       index_section ISEC,
-                                       index_phash IP' . $page_join,
-                $wordSel .
-                'IP.phash IN (' . $list . ') ' .
-                    $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . '
-                                       AND IW.wid=IR.wid
-                                       AND ISEC.phash = IR.phash
-                                       AND IP.phash = IR.phash
-                                       AND ' . $page_where,
-                'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,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.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId',
-                $orderBy
-            );
-        } else {
-            // Otherwise, if sorting are done with the pages table or other fields, there is no need for joining with the rel/word tables:
-            $orderBy = '';
-            switch ((string)$this->piVars['order']) {
-                case 'title':
-                    $orderBy = 'IP.item_title' . $this->isDescending();
-                    break;
-                case 'crdate':
-                    $orderBy = 'IP.item_crdate' . $this->isDescending();
-                    break;
-                case 'mtime':
-                    $orderBy = 'IP.item_mtime' . $this->isDescending();
-                    break;
-            }
-            $res = $this->databaseConnection->exec_SELECTquery('ISEC.*, IP.*', 'index_phash IP,index_section ISEC' . $page_join, 'IP.phash IN (' . $list . ') ' . $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . '
-                                                       AND IP.phash = ISEC.phash
-                                                       AND ' . $page_where, 'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,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.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', $orderBy);
-        }
-        return $res;
-    }
-
-    /**
-     * Checking if the resume can be shown for the search result (depending on whether the rights are OK)
-     * ? Should it also check for gr_list "0,-1"?
-     *
-     * @param array $row Result row array.
-     * @return bool Returns TRUE if resume can safely be shown
-     */
-    public function checkResume($row)
-    {
-        // If the record is indexed by an indexing configuration, just show it.
-        // At least this is needed for external URLs and files.
-        // For records we might need to extend this - for instance block display if record is access restricted.
-        if ($row['freeIndexUid']) {
-            return true;
-        }
-        // Evaluate regularly indexed pages based on item_type:
-        if ($row['item_type']) {
-            // External media:
-            // For external media we will check the access of the parent page on which the media was linked from.
-            // "phash_t3" is the phash of the parent TYPO3 page row which initiated the indexing of the documents in this section.
-            // So, selecting for the grlist records belonging to the parent phash-row where the current users gr_list exists will help us to know.
-            // If this is NOT found, there is still a theoretical possibility that another user accessible page would display a link, so maybe the resume of such a document here may be unjustified hidden. But better safe than sorry.
-            if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
-                $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash_t3'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist'));
-            } else {
-                $res = false;
-            }
-            if ($res && $this->databaseConnection->sql_num_rows($res)) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            // Ordinary TYPO3 pages:
-            if ((string)$row['gr_list'] !== (string)$this->frontendController->gr_list) {
-                // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists. If it is found it is proof that this user has direct access to the phash-rows content although he did not himself initiate the indexing...
-                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
-                    $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist'));
-                } else {
-                    $res = false;
-                }
-                if ($res && $this->databaseConnection->sql_num_rows($res)) {
-                    return true;
-                } else {
-                    return false;
-                }
-            } else {
-                return true;
-            }
-        }
-    }
-
-    /**
-     * Returns "DESC" or "" depending on the settings of the incoming highest/lowest result order (piVars['desc']
-     *
-     * @param bool $inverse If TRUE, inverse the order which is defined by piVars['desc']
-     * @return string " DESC" or
-     */
-    public function isDescending($inverse = false)
-    {
-        $desc = $this->piVars['desc'];
-        if ($inverse) {
-            $desc = !$desc;
-        }
-        return !$desc ? ' DESC' : '';
-    }
-
-    /**
-     * Write statistics information to database for the search operation
-     *
-     * @param array $sWArr Search Word array
-     * @param int $count Number of hits
-     * @param int $pt Milliseconds the search took
-     * @return void
-     */
-    public function writeSearchStat($sWArr, $count, $pt)
-    {
-        $insertFields = array(
-            'searchstring' => $this->piVars['sword'],
-            'searchoptions' => serialize(array($this->piVars, $sWArr, $pt)),
-            'feuser_id' => (int)$GLOBALS['TSFE']->user['uid'],
-            // fe_user id, integer
-            'cookie' => (string)$GLOBALS['TSFE']->id,
-            // cookie as set or retrieve. If people has cookies disabled this will vary all the time...
-            'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'),
-            // Remote IP address
-            'hits' => (int)$count,
-            // Number of hits on the search.
-            'tstamp' => $GLOBALS['EXEC_TIME']
-        );
-        $this->databaseConnection->exec_INSERTquery('index_stat_search', $insertFields);
-        $newId = $this->databaseConnection->sql_insert_id();
-        if ($newId) {
-            foreach ($sWArr as $val) {
-                $insertFields = array(
-                    'word' => $val['sword'],
-                    'index_stat_search_id' => $newId,
-                    'tstamp' => $GLOBALS['EXEC_TIME'],
-                    // Time stamp
-                    'pageid' => $this->frontendController->id
-                );
-                $this->databaseConnection->exec_INSERTquery('index_stat_word', $insertFields);
-            }
-        }
-    }
-
-    /***********************************
-     *
-     * HTML output functions
-     *
-     ***********************************/
-    /**
-     * Make search form HTML
-     *
-     * @param array $optValues Value/Labels pairs for search form selector boxes.
-     * @return string Search form HTML
-     */
-    public function makeSearchForm($optValues)
-    {
-        $html = $this->cObj->getSubpart($this->templateCode, '###SEARCH_FORM###');
-        // Multilangual text
-        $substituteArray = array('legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid');
-        foreach ($substituteArray as $marker) {
-            $markerArray['###FORM_' . GeneralUtility::strtoupper($marker) . '###'] = $this->pi_getLL('form_' . $marker, '', true);
-        }
-        $markerArray['###FORM_SUBMIT###'] = $this->pi_getLL('submit_button_label', '', true);
-        // Adding search field value
-        $markerArray['###SWORD_VALUE###'] = '';
-        $markerArray['###PLACEHOLDER###'] = '';
-        if (!empty($this->piVars['sword'])) {
-            $markerArray['###SWORD_VALUE###'] = htmlspecialchars($this->piVars['sword']);
-        } else {
-            // Add a HTML5 placeholder attribute if the configured doctype allows it
-            if ($GLOBALS['TSFE']->config['config']['doctype'] === 'html5') {
-                $markerArray['###PLACEHOLDER###'] = 'placeholder="' . $this->pi_getLL('default_search_word_entry') . '"';
-            } else {
-                $markerArray['###SWORD_VALUE###'] = $this->pi_getLL('default_search_word_entry');
-            }
-        }
-        // Additonal keyword => "Add to current search words"
-        if ($this->conf['show.']['clearSearchBox'] && $this->conf['show.']['clearSearchBox.']['enableSubSearchCheckBox']) {
-            $markerArray['###SWORD_PREV_VALUE###'] = htmlspecialchars($this->conf['show.']['clearSearchBox'] ? '' : $this->piVars['sword']);
-            $markerArray['###SWORD_PREV_INCLUDE_CHECKED###'] = $this->piVars['sword_prev_include'] ? ' checked="checked"' : '';
-            $markerArray['###ADD_TO_CURRENT_SEARCH###'] = $this->pi_getLL('makerating_addToCurrentSearch', '', true);
-        } else {
-            $html = $this->cObj->substituteSubpart($html, '###ADDITONAL_KEYWORD###', '');
-        }
-        $markerArray['###ACTION_URL###'] = htmlspecialchars($this->getSearchFormActionURL());
-        $hiddenFieldCode = $this->cObj->getSubpart($this->templateCode, '###HIDDEN_FIELDS###');
-        $hiddenFieldCode = preg_replace('/^\\n\\t(.+)/ms', '$1', $hiddenFieldCode);
-        // Remove first newline and tab (cosmetical issue)
-        $hiddenFieldArr = array();
-        foreach (GeneralUtility::trimExplode(',', $this->hiddenFieldList) as $fieldName) {
-            $hiddenFieldMarkerArray = array();
-            $hiddenFieldMarkerArray['###HIDDEN_FIELDNAME###'] = $this->prefixId . '[' . $fieldName . ']';
-            $hiddenFieldMarkerArray['###HIDDEN_VALUE###'] = htmlspecialchars((string)$this->piVars[$fieldName]);
-            $hiddenFieldArr[$fieldName] = $this->cObj->substituteMarkerArrayCached($hiddenFieldCode, $hiddenFieldMarkerArray, array(), array());
-        }
-        // Extended search
-        if ($this->piVars['ext']) {
-            // Search for
-            if (!is_array($optValues['type']) && !is_array($optValues['defOp']) || $this->conf['blind.']['type'] && $this->conf['blind.']['defOp']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_FOR###', '');
-            } else {
-                if (is_array($optValues['type']) && !$this->conf['blind.']['type']) {
-                    unset($hiddenFieldArr['type']);
-                    $markerArray['###SELECTBOX_TYPE_VALUES###'] = $this->renderSelectBoxValues($this->piVars['type'], $optValues['type']);
-                } else {
-                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_TYPE###', '');
-                }
-                if (is_array($optValues['defOp']) || !$this->conf['blind.']['defOp']) {
-                    $markerArray['###SELECTBOX_DEFOP_VALUES###'] = $this->renderSelectBoxValues($this->piVars['defOp'], $optValues['defOp']);
-                } else {
-                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_DEFOP###', '');
-                }
-            }
-            // Search in
-            if (!is_array($optValues['media']) && !is_array($optValues['lang']) || $this->conf['blind.']['media'] && $this->conf['blind.']['lang']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_IN###', '');
-            } else {
-                if (is_array($optValues['media']) && !$this->conf['blind.']['media']) {
-                    unset($hiddenFieldArr['media']);
-                    $markerArray['###SELECTBOX_MEDIA_VALUES###'] = $this->renderSelectBoxValues($this->piVars['media'], $optValues['media']);
-                } else {
-                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_MEDIA###', '');
-                }
-                if (is_array($optValues['lang']) || !$this->conf['blind.']['lang']) {
-                    unset($hiddenFieldArr['lang']);
-                    $markerArray['###SELECTBOX_LANG_VALUES###'] = $this->renderSelectBoxValues($this->piVars['lang'], $optValues['lang']);
-                } else {
-                    $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_LANG###', '');
-                }
-            }
-            // Sections
-            if (!is_array($optValues['sections']) || $this->conf['blind.']['sections']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_SECTION###', '');
-            } else {
-                $markerArray['###SELECTBOX_SECTIONS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['sections'], $optValues['sections']);
-            }
-            // Free Indexing Configurations:
-            if (!is_array($optValues['freeIndexUid']) || $this->conf['blind.']['freeIndexUid']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_FREEINDEXUID###', '');
-            } else {
-                $markerArray['###SELECTBOX_FREEINDEXUIDS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['freeIndexUid'], $optValues['freeIndexUid']);
-            }
-            // Sorting
-            if (!is_array($optValues['order']) || !is_array($optValues['desc']) || $this->conf['blind.']['order']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_ORDER###', '');
-            } else {
-                unset($hiddenFieldArr['order']);
-                unset($hiddenFieldArr['desc']);
-                unset($hiddenFieldArr['results']);
-                $markerArray['###SELECTBOX_ORDER_VALUES###'] = $this->renderSelectBoxValues($this->piVars['order'], $optValues['order']);
-                $markerArray['###SELECTBOX_DESC_VALUES###'] = $this->renderSelectBoxValues($this->piVars['desc'], $optValues['desc']);
-                $markerArray['###SELECTBOX_RESULTS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['results'], $optValues['results']);
-            }
-            // Limits
-            if (!is_array($optValues['results']) || !is_array($optValues['results']) || $this->conf['blind.']['results']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_RESULTS###', '');
-            } else {
-                $markerArray['###SELECTBOX_RESULTS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['results'], $optValues['results']);
-            }
-            // Grouping
-            if (!is_array($optValues['group']) || $this->conf['blind.']['group']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_GROUP###', '');
-            } else {
-                unset($hiddenFieldArr['group']);
-                $markerArray['###SELECTBOX_GROUP_VALUES###'] = $this->renderSelectBoxValues($this->piVars['group'], $optValues['group']);
-            }
-            if ($this->conf['blind.']['extResume']) {
-                $html = $this->cObj->substituteSubpart($html, '###SELECT_EXTRESUME###', '');
-            } else {
-                $markerArray['###EXT_RESUME_CHECKED###'] = $this->piVars['extResume'] ? ' checked="checked"' : '';
-            }
-        } else {
-            // Extended search
-            $html = $this->cObj->substituteSubpart($html, '###SEARCH_FORM_EXTENDED###', '');
-        }
-        if ($this->conf['show.']['advancedSearchLink']) {
-            $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre) : $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre, array($this->prefixId . '[ext]' => 1));
-            $markerArray['###LINKTOOTHERMODE###'] = '<a href="' . htmlspecialchars($linkToOtherMode) . '">' . $this->pi_getLL(($this->piVars['ext'] ? 'link_regularSearch' : 'link_advancedSearch'), '', true) . '</a>';
-        } else {
-            $markerArray['###LINKTOOTHERMODE###'] = '';
-        }
-        // Write all hidden fields
-        $html = $this->cObj->substituteSubpart($html, '###HIDDEN_FIELDS###', implode('', $hiddenFieldArr));
-        $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
-        return $substitutedContent;
-    }
-
-    /**
-     * Function, rendering selector box values.
-     *
-     * @param string $value Current value
-     * @param array $optValues Array with the options as key=>value pairs
-     * @return string <options> imploded.
-     */
-    public function renderSelectBoxValues($value, $optValues)
-    {
-        if (!is_array($optValues)) {
-            return '';
-        }
-        $opt = array();
-        $isSelFlag = 0;
-        foreach ($optValues as $k => $v) {
-            $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
-            if ($sel) {
-                $isSelFlag++;
-            }
-            $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
-        }
-        return implode('', $opt);
-    }
-
-    /**
-     * Print the searching rules
-     *
-     * @return string Rules for the search
-     */
-    public function printRules()
-    {
-        if (!$this->conf['show.']['rules']) {
-            return '';
-        }
-        $html = $this->cObj->getSubpart($this->templateCode, '###RULES###');
-        $markerArray['###RULES_HEADER###'] = $this->pi_getLL('rules_header', '', true);
-        $markerArray['###RULES_TEXT###'] = nl2br(trim($this->pi_getLL('rules_text', '', true)));
-        $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
-        return $this->cObj->stdWrap($substitutedContent, $this->conf['rules_stdWrap.']);
-    }
-
-    /**
-     * Returns the anchor-links to the sections inside the displayed result rows.
-     *
-     * @return string
-     */
-    public function printResultSectionLinks()
-    {
-        if (empty($this->resultSections)) {
-            return '';
-        }
-        $links = array();
-        $html = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS###');
-        $item = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS_LINK###');
-        $anchorPrefix = $GLOBALS['TSFE']->baseUrl ? substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), strlen(GeneralUtility::getIndpEnv('TYPO3_SITE_URL'))) : '';
-        foreach ($this->resultSections as $id => $dat) {
-            $markerArray = array();
-            $aBegin = '<a href="' . htmlspecialchars($anchorPrefix . '#anchor_' . md5($id)) . '">';
-            $aContent = (trim($dat[0]) ? trim($dat[0]) : htmlspecialchars($this->pi_getLL('unnamedSection'))) . ' (' . $dat[1] . ' ' . $this->pi_getLL(($dat[1] > 1 ? 'word_pages' : 'word_page'), '', true) . ')';
-            $aEnd = '</a>';
-            $markerArray['###LINK###'] = $aBegin . $aContent . $aEnd;
-            $links[] = $this->cObj->substituteMarkerArrayCached($item, $markerArray, array(), array());
-        }
-        $html = $this->cObj->substituteMarkerArrayCached($html, array('###LINKS###' => implode('', $links)), array(), array());
-        return '<div' . $this->pi_classParam('sectionlinks') . '>' . $this->cObj->stdWrap($html, $this->conf['sectionlinks_stdWrap.']) . '</div>';
-    }
-
-    /**
-     * Returns the section header of the search result.
-     *
-     * @param string $id ID for the section (used for anchor link)
-     * @param string $sectionTitleLinked Section title with linked wrapped around
-     * @param int $countResultRows Number of results in section
-     * @return string HTML output
-     */
-    public function makeSectionHeader($id, $sectionTitleLinked, $countResultRows)
-    {
-        $html = $this->cObj->getSubpart($this->templateCode, '###SECTION_HEADER###');
-        $markerArray['###ANCHOR_URL###'] = 'anchor_' . md5($id);
-        $markerArray['###SECTION_TITLE###'] = $sectionTitleLinked;
-        $markerArray['###RESULT_COUNT###'] = $countResultRows;
-        $markerArray['###RESULT_NAME###'] = $this->pi_getLL('word_page' . ($countResultRows > 1 ? 's' : ''));
-        $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
-        return $substitutedContent;
-    }
-
-    /**
-     * This prints a single result row, including a recursive call for subrows.
-     *
-     * @param array $row Search result row
-     * @param int $headerOnly 1=Display only header (for sub-rows!), 2=nothing at all
-     * @return string HTML code
-     */
-    public function printResultRow($row, $headerOnly = 0)
-    {
-        // Get template content:
-        $tmplContent = $this->prepareResultRowTemplateData($row, $headerOnly);
-        if ($hookObj = $this->hookRequest('printResultRow')) {
-            return $hookObj->printResultRow($row, $headerOnly, $tmplContent);
-        } else {
-            $html = $this->cObj->getSubpart($this->templateCode, '###RESULT_OUTPUT###');
-            if (!is_array($row['_sub'])) {
-                $html = $this->cObj->substituteSubpart($html, '###ROW_SUB###', '');
-            }
-            if (!$headerOnly) {
-                $html = $this->cObj->substituteSubpart($html, '###ROW_SHORT###', '');
-            } elseif ($headerOnly == 1) {
-                $html = $this->cObj->substituteSubpart($html, '###ROW_LONG###', '');
-            } elseif ($headerOnly == 2) {
-                $html = $this->cObj->substituteSubpart($html, '###ROW_SHORT###', '');
-                $html = $this->cObj->substituteSubpart($html, '###ROW_LONG###', '');
-            }
-            if (is_array($tmplContent)) {
-                foreach ($tmplContent as $k => $v) {
-                    $markerArray['###' . GeneralUtility::strtoupper($k) . '###'] = $v;
-                }
-            }
-            // Description text
-            $markerArray['###TEXT_ITEM_SIZE###'] = $this->pi_getLL('res_size', '', true);
-            $markerArray['###TEXT_ITEM_CRDATE###'] = $this->pi_getLL('res_created', '', true);
-            $markerArray['###TEXT_ITEM_MTIME###'] = $this->pi_getLL('res_modified', '', true);
-            $markerArray['###TEXT_ITEM_PATH###'] = $this->pi_getLL('res_path', '', true);
-            $html = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
-            // If there are subrows (eg. subpages in a PDF-file or if a duplicate page is selected due to user-login (phash_grouping))
-            if (is_array($row['_sub'])) {
-                if ($this->multiplePagesType($row['item_type'])) {
-                    $html = str_replace('###TEXT_ROW_SUB###', $this->pi_getLL('res_otherMatching', '', true), $html);
-                    foreach ($row['_sub'] as $subRow) {
-                        $html .= $this->printResultRow($subRow, 1);
-                    }
-                } else {
-                    $markerArray['###TEXT_ROW_SUB###'] = $this->pi_getLL('res_otherMatching', '', true);
-                    $html = str_replace('###TEXT_ROW_SUB###', $this->pi_getLL('res_otherPageAsWell', '', true), $html);
-                }
-            }
-            return $html;
-        }
-    }
-
-    /**
-     * Returns a results browser, former method name: pi_list_browseresults
-     *
-     * @param bool $showResultCount Show result count
-     * @param string $addString String appended to "displaying results..." notice.
-     * @param string $addPart String appended after section "displaying results...
-     * @param string $freeIndexUid List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration!
-     * @return string HTML output
-     */
-    protected function renderPagination($showResultCount = true, $addString = '', $addPart = '', $freeIndexUid = -1)
-    {
-        // Initializing variables:
-        $pointer = (int)$this->piVars['pointer'];
-        $count = (int)$this->internal['res_count'];
-        $results_at_a_time = MathUtility::forceIntegerInRange($this->internal['results_at_a_time'], 1, 1000);
-        $pageCount = (int)ceil($count / $results_at_a_time);
-
-        $links = array();
-        // only show the result browser if more than one page is needed
-        if ($pageCount > 1) {
-            $maxPages = MathUtility::forceIntegerInRange($this->internal['maxPages'], 1, $pageCount);
-
-            // Make browse-table/links:
-            if ($pointer > 0) {
-                // all pages after the 1st one
-                $links[] = '<li>' . $this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_prev', '< Previous', true), $pointer - 1, $freeIndexUid) . '</li>';
-            }
-            $minPage = $pointer - (int)floor($maxPages / 2);
-            $maxPage = $minPage + $maxPages - 1;
-            // Check if the indexes are within the page limits
-            if ($minPage < 0) {
-                $maxPage -= $minPage;
-                $minPage = 0;
-            } elseif ($maxPage >= $pageCount) {
-                $minPage -= $maxPage - $pageCount + 1;
-                $maxPage = $pageCount - 1;
-            }
-            $pageLabel = $this->pi_getLL('pi_list_browseresults_page', 'Page', true);
-            for ($a = $minPage; $a <= $maxPage; $a++) {
-                $label = trim($pageLabel . ' ' . ($a + 1));
-                $link = $this->makePointerSelector_link($label, $a, $freeIndexUid);
-                if ($a === $pointer) {
-                    $links[] = '<li' . $this->pi_classParam('browselist-currentPage') . '><strong>' . $link . '</strong></li>';
-                } else {
-                    $links[] = '<li>' . $link . '</li>';
-                }
-            }
-            if ($pointer + 1 < $pageCount) {
-                $links[] = '<li>' . $this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_next', 'Next >', true), $pointer + 1, $freeIndexUid) . '</li>';
-            }
-        }
-        if (!empty($links)) {
-            $addPart .= '
-               <ul class="browsebox">
-                       ' . implode('', $links) . '
-               </ul>';
-        }
-        $label = str_replace(
-            array('###TAG_BEGIN###', '###TAG_END###'),
-            array('<strong>', '</strong>'),
-            $this->pi_getLL('pi_list_browseresults_display', 'Displaying results ###TAG_BEGIN###%1$s to %2$s###TAG_END### out of ###TAG_BEGIN###%3$s###TAG_END###')
-        );
-        $resultsFrom = $pointer * $results_at_a_time + 1;
-        $resultsTo = min($resultsFrom + $results_at_a_time - 1, $count);
-        $resultCountText = '';
-        if ($showResultCount) {
-            $resultCountText = '<p>' . sprintf($label, $resultsFrom, $resultsTo, $count) . $addString . '</p>';
-        }
-        $sTables = '<div' . $this->pi_classParam('browsebox') . '>'
-            . $resultCountText
-            . $addPart . '</div>';
-        return $sTables;
-    }
-
-    /***********************************
-     *
-     * Support functions for HTML output (with a minimum of fixed markup)
-     *
-     ***********************************/
-    /**
-     * Preparing template data for the result row output
-     *
-     * @param array $row Result row
-     * @param bool $headerOnly If set, display only header of result (for sub-results)
-     * @return array Array with data to insert in result row template
-     */
-    public function prepareResultRowTemplateData($row, $headerOnly)
-    {
-        // Initialize:
-        $specRowConf = $this->getSpecialConfigForRow($row);
-        $CSSsuffix = $specRowConf['CSSsuffix'] ? '-' . $specRowConf['CSSsuffix'] : '';
-        // If external media, link to the media-file instead.
-        if ($row['item_type']) {
-            // External media
-            if ($row['show_resume']) {
-                // Can link directly.
-                $targetAttribute = '';
-                if ($this->frontendController->config['config']['fileTarget']) {
-                    $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"';
-                }
-                $title = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($this->makeTitle($row)) . '</a>';
-            } else {
-                // Suspicious, so linking to page instead...
-                $copy_row = $row;
-                unset($copy_row['cHashParams']);
-                $title = $this->linkPage($row['page_id'], htmlspecialchars($this->makeTitle($row)), $copy_row);
-            }
-        } else {
-            // Else the page:
-            // Prepare search words for markup in content:
-            if ($this->conf['forwardSearchWordsInResultLink']) {
-                if ($this->conf['forwardSearchWordsInResultLink.']['no_cache']) {
-                    $markUpSwParams = array('no_cache' => 1);
-                } else {
-                    $markUpSwParams = array();
-                }
-                foreach ($this->sWArr as $d) {
-                    $markUpSwParams['sword_list'][] = $d['sword'];
-                }
-            } else {
-                $markUpSwParams = array();
-            }
-            $title = $this->linkPage($row['data_page_id'], htmlspecialchars($this->makeTitle($row)), $row, $markUpSwParams);
-        }
-        $tmplContent = array();
-        $tmplContent['title'] = $title;
-        $tmplContent['result_number'] = $this->conf['show.']['resultNumber'] ? $row['result_number'] . ': ' : '&nbsp;';
-        $tmplContent['icon'] = $this->makeItemTypeIcon($row['item_type'], '', $specRowConf);
-        $tmplContent['rating'] = $this->makeRating($row);
-        $tmplContent['description'] = $this->makeDescription(
-            $row,
-            !($this->piVars['extResume'] && !$headerOnly),
-            $this->conf['results.']['summaryCropAfter']
-        );
-        $tmplContent = $this->makeInfo($row, $tmplContent);
-        $tmplContent['access'] = $this->makeAccessIndication($row['page_id']);
-        $tmplContent['language'] = $this->makeLanguageIndication($row);
-        $tmplContent['CSSsuffix'] = $CSSsuffix;
-        // Post processing with hook.
-        if ($hookObj = $this->hookRequest('prepareResultRowTemplateData_postProc')) {
-            $tmplContent = $hookObj->prepareResultRowTemplateData_postProc($tmplContent, $row, $headerOnly);
-        }
-        return $tmplContent;
-    }
-
-    /**
-     * Returns a string that tells which search words are searched for.
-     *
-     * @param array Array of search words
-     * @return string HTML telling what is searched for.
-     */
-    public function tellUsWhatIsSeachedFor($sWArr)
-    {
-        // Init:
-        $searchingFor = '';
-        $c = 0;
-        // Traverse search words:
-        foreach ($sWArr as $k => $v) {
-            if ($c) {
-                switch ($v['oper']) {
-                    case 'OR':
-                        $searchingFor .= ' ' . $this->pi_getLL('searchFor_or', '', true) . ' ' . $this->wrapSW($v['sword']);
-                        break;
-                    case 'AND NOT':
-                        $searchingFor .= ' ' . $this->pi_getLL('searchFor_butNot', '', true) . ' ' . $this->wrapSW($v['sword']);
-                        break;
-                    default:
-                        // AND...
-                        $searchingFor .= ' ' . $this->pi_getLL('searchFor_and', '', true) . ' ' . $this->wrapSW($v['sword']);
-                }
-            } else {
-                $searchingFor = $this->pi_getLL('searchFor', '', true) . ' ' . $this->wrapSW($v['sword']);
-            }
-            $c++;
-        }
-        return $searchingFor;
-    }
-
-    /**
-     * Wraps the search words in the search-word list display (from ->tellUsWhatIsSeachedFor())
-     *
-     * @param string $str search word to wrap (in local charset!)
-     * @return string Search word wrapped in <span> tag.
-     */
-    public function wrapSW($str)
-    {
-        return '"<span' . $this->pi_classParam('sw') . '>' . htmlspecialchars($str) . '</span>"';
-    }
-
-    /**
-     * Makes a selector box
-     *
-     * @param string $name Name of selector box
-     * @param string $value Current value
-     * @param array $optValues Array of options in the selector box (value => label pairs)
-     * @return string HTML of selector box
-     */
-    public function renderSelectBox($name, $value, $optValues)
-    {
-        if (is_array($optValues)) {
-            $opt = array();
-            $isSelFlag = 0;
-            foreach ($optValues as $k => $v) {
-                $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
-                if ($sel) {
-                    $isSelFlag++;
-                }
-                $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
-            }
-            return '<select name="' . $name . '">' . implode('', $opt) . '</select>';
-        }
-    }
-
-    /**
-     * Used to make the link for the result-browser.
-     * Notice how the links must resubmit the form after setting the new pointer-value in a hidden formfield.
-     *
-     * @param string $str String to wrap in <a> tag
-     * @param int $p Pointer value
-     * @param string $freeIndexUid List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration!
-     * @return string Input string wrapped in <a> tag with onclick event attribute set.
-     */
-    public function makePointerSelector_link($str, $p, $freeIndexUid)
-    {
-        $onclick = 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId . '_pointer') . ').value=' . GeneralUtility::quoteJSvalue($p) . ';' . 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId . '_freeIndexUid') . ').value=' . GeneralUtility::quoteJSvalue($freeIndexUid) . ';' . 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId) . ').submit();return false;';
-        return '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $str . '</a>';
-    }
-
-    /**
-     * Return icon for file extension
-     *
-     * @param string $it File extension / item type
-     * @param string $alt Title attribute value in icon.
-     * @param array $specRowConf TypoScript configuration specifically for search result.
-     * @return string <img> tag for icon
-     */
-    public function makeItemTypeIcon($it, $alt = '', $specRowConf)
-    {
-        // Build compound key if item type is 0, iconRendering is not used
-        // and specConfs.[pid].pageIcon was set in TS
-        if ($it === '0' && $specRowConf['_pid'] && is_array($specRowConf['pageIcon.']) && !is_array($this->conf['iconRendering.'])) {
-            $it .= ':' . $specRowConf['_pid'];
-        }
-        if (!isset($this->iconFileNameCache[$it])) {
-            $this->iconFileNameCache[$it] = '';
-            // If TypoScript is used to render the icon:
-            if (is_array($this->conf['iconRendering.'])) {
-                $this->cObj->setCurrentVal($it);
-                $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle($this->conf['iconRendering'], $this->conf['iconRendering.']);
-            } else {
-                // Default creation / finding of icon:
-                $icon = '';
-                if ($it === '0' || substr($it, 0, 2) == '0:') {
-                    if (is_array($specRowConf['pageIcon.'])) {
-                        $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle('IMAGE', $specRowConf['pageIcon.']);
-                    } else {
-                        $icon = 'EXT:indexed_search/Resources/Public/Icons/FileTypes/pages.gif';
-                    }
-                } elseif ($this->external_parsers[$it]) {
-                    $icon = $this->external_parsers[$it]->getIcon($it);
-                }
-                if ($icon) {
-                    $fullPath = GeneralUtility::getFileAbsFileName($icon);
-                    if ($fullPath) {
-                        $info = @getimagesize($fullPath);
-                        $iconPath = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($fullPath);
-                        $this->iconFileNameCache[$it] = is_array($info) ? '<img src="' . $iconPath . '" ' . $info[3] . ' title="' . htmlspecialchars($alt) . '" alt="" />' : '';
-                    }
-                }
-            }
-        }
-        return $this->iconFileNameCache[$it];
-    }
-
-    /**
-     * Return the rating-HTML code for the result row. This makes use of the $this->firstRow
-     *
-     * @param array $row Result row array
-     * @return string String showing ranking value
-     */
-    public function makeRating($row)
-    {
-        switch ((string)$this->piVars['order']) {
-            case 'rank_count':
-                // Number of occurencies on page
-                return $row['order_val'] . ' ' . $this->pi_getLL('maketitle_matches');
-                break;
-            case 'rank_first':
-                // Close to top of page
-                return ceil(MathUtility::forceIntegerInRange((255 - $row['order_val']), 1, 255) / 255 * 100) . '%';
-                break;
-            case 'rank_flag':
-                // Based on priority assigned to <title> / <meta-keywords> / <meta-description> / <body>
-                if ($this->firstRow['order_val2']) {
-                    $base = $row['order_val1'] * 256;
-                    // (3 MSB bit, 224 is highest value of order_val1 currently)
-                    $freqNumber = $row['order_val2'] / $this->firstRow['order_val2'] * pow(2, 12);
-                    // 15-3 MSB = 12
-                    $total = MathUtility::forceIntegerInRange($base + $freqNumber, 0, 32767);
-                    return ceil(log($total) / log(32767) * 100) . '%';
-                }
-                break;
-            case 'rank_freq':
-                // Based on frequency
-                $max = 10000;
-                $total = MathUtility::forceIntegerInRange($row['order_val'], 0, $max);
-                return ceil(log($total) / log($max) * 100) . '%';
-                break;
-            case 'crdate':
-                // Based on creation date
-                return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_crdate'], 0);
-                break;
-            case 'mtime':
-                // Based on modification time
-                return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_mtime'], 0);
-                break;
-            default:
-                // fx. title
-                return '&nbsp;';
-        }
-    }
-
-    /**
-     * Returns the resume for the search-result.
-     *
-     * @param array $row Search result row
-     * @param bool $noMarkup If noMarkup is FALSE, then the index_fulltext table is used to select the content of the page, split it with regex to display the search words in the text.
-     * @param int $lgd String length
-     * @return string HTML string
-     */
-    public function makeDescription($row, $noMarkup = false, $lgd = 180)
-    {
-        if ($row['show_resume']) {
-            $markedSW = '';
-            $outputStr = '';
-            if (!$noMarkup) {
-                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_fulltext')) {
-                    $res = $this->databaseConnection->exec_SELECTquery('*', 'index_fulltext', 'phash=' . (int)$row['phash']);
-                } else {
-                    $res = false;
-                }
-                if ($res) {
-                    if ($ftdrow = $this->databaseConnection->sql_fetch_assoc($res)) {
-                        // Cut HTTP references after some length
-                        $content = preg_replace('/(http:\\/\\/[^ ]{' . $this->conf['results.']['hrefInSummaryCropAfter'] . '})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']);
-                        $markedSW = $this->markupSWpartsOfString($content);
-                    }
-                    $this->databaseConnection->sql_free_result($res);
-                }
-            }
-            if (!trim($markedSW)) {
-                $outputStr = $this->charsetConverter->crop('utf-8', $row['item_description'], $lgd, $this->conf['results.']['summaryCropSignifier']);
-                $outputStr = htmlspecialchars($outputStr);
-            }
-            $output = $outputStr ?: $markedSW;
-        } else {
-            $output = '<span class="noResume">' . $this->pi_getLL('res_noResume', '', true) . '</span>';
-        }
-        return $output;
-    }
-
-    /**
-     * Marks up the search words from $this->sWarr in the $str with a color.
-     *
-     * @param string $str Text in which to find and mark up search words. This text is assumed to be UTF-8 like the search words internally is.
-     * @return string Processed content.
-     */
-    public function markupSWpartsOfString($str)
-    {
-        $htmlParser = GeneralUtility::makeInstance(HtmlParser::class);
-        // Init:
-        $str = str_replace('&nbsp;', ' ', $htmlParser->bidir_htmlspecialchars($str, -1));
-        $str = preg_replace('/\\s\\s+/', ' ', $str);
-        $swForReg = array();
-        // Prepare search words for regex:
-        foreach ($this->sWArr as $d) {
-            $swForReg[] = preg_quote($d['sword'], '/');
-        }
-        $regExString = '(' . implode('|', $swForReg) . ')';
-        // Split and combine:
-        $parts = preg_split('/' . $regExString . '/ui', ' ' . $str . ' ', 20000, PREG_SPLIT_DELIM_CAPTURE);
-        // Constants:
-        $summaryMax = $this->conf['results.']['markupSW_summaryMax'];
-        $postPreLgd = $this->conf['results.']['markupSW_postPreLgd'];
-        $postPreLgd_offset = $this->conf['results.']['markupSW_postPreLgd_offset'];
-        $divider = $this->conf['results.']['markupSW_divider'];
-        $occurencies = (count($parts) - 1) / 2;
-        if ($occurencies) {
-            $postPreLgd = MathUtility::forceIntegerInRange($summaryMax / $occurencies, $postPreLgd, $summaryMax / 2);
-        }
-        // Variable:
-        $summaryLgd = 0;
-        $output = array();
-        // Shorten in-between strings:
-        foreach ($parts as $k => $strP) {
-            if ($k % 2 == 0) {
-                // Find length of the summary part:
-                $strLen = $this->charsetConverter->strlen('utf-8', $parts[$k]);
-                $output[$k] = $parts[$k];
-                // Possibly shorten string:
-                if (!$k) {
-                    // First entry at all (only cropped on the frontside)
-                    if ($strLen > $postPreLgd) {
-                        $output[$k] = $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->charsetConverter->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
-                    }
-                } elseif ($summaryLgd > $summaryMax || !isset($parts[$k + 1])) {
-                    // In case summary length is exceed OR if there are no more entries at all:
-                    if ($strLen > $postPreLgd) {
-                        $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->charsetConverter->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider;
-                    }
-                } else {
-                    // In-between search words:
-                    if ($strLen > $postPreLgd * 2) {
-                        $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->charsetConverter->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->charsetConverter->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
-                    }
-                }
-                $summaryLgd += $this->charsetConverter->strlen('utf-8', $output[$k]);
-                // Protect output:
-                $output[$k] = htmlspecialchars($output[$k]);
-                // If summary lgd is exceed, break the process:
-                if ($summaryLgd > $summaryMax) {
-                    break;
-                }
-            } else {
-                $summaryLgd += $this->charsetConverter->strlen('utf-8', $strP);
-                $output[$k] = '<strong class="tx-indexedsearch-redMarkup">' . htmlspecialchars($parts[$k]) . '</strong>';
-            }
-        }
-        // Return result:
-        return implode('', $output);
-    }
-
-    /**
-     * Returns the title of the search result row
-     *
-     * @param array $row Result row
-     * @return string Title from row
-     */
-    public function makeTitle($row)
-    {
-        $add = '';
-        if ($this->multiplePagesType($row['item_type'])) {
-            $dat = unserialize($row['cHashParams']);
-            $pp = explode('-', $dat['key']);
-            if ($pp[0] != $pp[1]) {
-                $add = ', ' . $this->pi_getLL('word_pages') . ' ' . $dat['key'];
-            } else {
-                $add = ', ' . $this->pi_getLL('word_page') . ' ' . $pp[0];
-            }
-        }
-        $outputString = $this->charsetConverter->crop('utf-8', $row['item_title'], $this->conf['results.']['titleCropAfter'], $this->conf['results.']['titleCropSignifier']);
-        return $outputString . $add;
-    }
-
-    /**
-     * Returns the info-string in the bottom of the result-row display (size, dates, path)
-     *
-     * @param array $row Result row
-     * @param array $tmplArray Template array to modify
-     * @return array Modified template array
-     */
-    public function makeInfo($row, $tmplArray)
-    {
-        $tmplArray['size'] = GeneralUtility::formatSize($row['item_size']);
-        $tmplArray['created'] = $this->formatCreatedDate($row['item_crdate']);
-        $tmplArray['modified'] = $this->formatModifiedDate($row['item_mtime']);
-        $pathId = $row['data_page_id'] ?: $row['page_id'];
-        $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
-        $pI = parse_url($row['data_filename']);
-        if ($pI['scheme']) {
-            $targetAttribute = '';
-            if ($this->frontendController->config['config']['fileTarget']) {
-                $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"';
-            }
-            $tmplArray['path'] = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($row['data_filename']) . '</a>';
-        } else {
-            $pathStr = $this->getPathFromPageId($pathId, $pathMP);
-            $tmplArray['path'] = $this->linkPage($pathId, $pathStr, array(
-                'cHashParams' => $row['cHashParams'],
-                'data_page_type' => $row['data_page_type'],
-                'data_page_mp' => $pathMP,
-                'sys_language_uid' => $row['sys_language_uid']
-            ));
-        }
-        return $tmplArray;
-    }
-
-    /**
-     * Returns configuration from TypoScript for result row based on ID / location in page tree!
-     *
-     * @param array $row Result row
-     * @return array Configuration array
-     */
-    public function getSpecialConfigForRow($row)
-    {
-        $pathId = $row['data_page_id'] ?: $row['page_id'];
-        $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
-        $rl = $this->getRootLine($pathId, $pathMP);
-        $specConf = $this->conf['specConfs.']['0.'];
-        if (is_array($rl)) {
-            foreach ($rl as $dat) {
-                if (is_array($this->conf['specConfs.'][$dat['uid'] . '.'])) {
-                    $specConf = $this->conf['specConfs.'][$dat['uid'] . '.'];
-                    $specConf['_pid'] = $dat['uid'];
-                    break;
-                }
-            }
-        }
-        return $specConf;
-    }
-
-    /**
-     * Returns the HTML code for language indication.
-     *
-     * @param array $row Result row
-     * @return string HTML code for result row.
-     */
-    public function makeLanguageIndication($row)
-    {
-        // If search result is a TYPO3 page:
-        if ((string)$row['item_type'] === '0') {
-            // If TypoScript is used to render the flag:
-            if (is_array($this->conf['flagRendering.'])) {
-                $this->cObj->setCurrentVal($row['sys_language_uid']);
-                return $this->cObj->cObjGetSingle($this->conf['flagRendering'], $this->conf['flagRendering.']);
-            }
-        }
-        return '&nbsp;';
-    }
-
-    /**
-     * Returns the HTML code for the locking symbol.
-     * NOTICE: Requires a call to ->getPathFromPageId() first in order to work (done in ->makeInfo() by calling that first)
-     *
-     * @param int $id Page id for which to find answer
-     * @return string <img> tag if access is limited.
-     */
-    public function makeAccessIndication($id)
-    {
-        if (is_array($this->fe_groups_required[$id]) && !empty($this->fe_groups_required[$id])) {
-            return '<img src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('indexed_search') . 'Resources/Public/Icons/FileTypes/locked.gif" width="12" height="15" vspace="5" title="' . sprintf($this->pi_getLL('res_memberGroups', '', true), implode(',', array_unique($this->fe_groups_required[$id]))) . '" alt="" />';
-        }
-
-        return '';
-    }
-
-    /**
-     * Links the $str to page $id
-     *
-     * @param int $id Page id
-     * @param string $str Title String to link
-     * @param array $row Result row
-     * @param array $markUpSwParams Additional parameters for marking up seach words
-     * @return string <A> tag wrapped title string.
-     */
-    public function linkPage($id, $str, $row = array(), $markUpSwParams = array())
-    {
-        // Parameters for link:
-        $urlParameters = (array)unserialize($row['cHashParams']);
-        // Add &type and &MP variable:
-        if ($row['data_page_type']) {
-            $urlParameters['type'] = $row['data_page_type'];
-        }
-        if ($row['data_page_mp']) {
-            $urlParameters['MP'] = $row['data_page_mp'];
-        }
-        if ($row['sys_language_uid']) {
-            $urlParameters['L'] = $row['sys_language_uid'];
-        }
-        // markup-GET vars:
-        $urlParameters = array_merge($urlParameters, $markUpSwParams);
-        // This will make sure that the path is retrieved if it hasn't been already. Used only for the sake of the domain_record thing...
-        if (!is_array($this->domain_records[$id])) {
-            $this->getPathFromPageId($id);
-        }
-        // If external domain, then link to that:
-        if (!empty($this->domain_records[$id])) {
-            reset($this->domain_records[$id]);
-            $firstDom = current($this->domain_records[$id]);
-            $scheme = GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
-            $addParams = '';
-            if (is_array($urlParameters) && !empty($urlParameters)) {
-                $addParams .= GeneralUtility::implodeArrayForUrl('', $urlParameters);
-            }
-            if ($target = $this->conf['search.']['detect_sys_domain_records.']['target']) {
-                $target = ' target="' . $target . '"';
-            }
-            return '<a href="' . htmlspecialchars(($scheme . $firstDom . '/index.php?id=' . $id . $addParams)) . '"' . $target . '>' . htmlspecialchars($str) . '</a>';
-        } else {
-            return $this->pi_linkToPage($str, $id, $this->conf['result_link_target'], $urlParameters);
-        }
-    }
-
-    /**
-     * Returns the path to the page $id
-     *
-     * @param int $id Page ID
-     * @param string $pathMP MP variable content.
-     * @return string Root line for result.
-     */
-    public function getRootLine($id, $pathMP = '')
-    {
-        $identStr = $id . '|' . $pathMP;
-        if (!isset($this->cache_path[$identStr])) {
-            $this->cache_rl[$identStr] = $this->frontendController->sys_page->getRootLine($id, $pathMP);
-        }
-        return $this->cache_rl[$identStr];
-    }
-
-    /**
-     * Gets the first sys_domain record for the page, $id
-     *
-     * @param int $id Page id
-     * @return string Domain name
-     */
-    public function getFirstSysDomainRecordForPage($id)
-    {
-        $res = $this->databaseConnection->exec_SELECTquery('domainName', 'sys_domain', 'pid=' . (int)$id . $this->cObj->enableFields('sys_domain'), '', 'sorting');
-        $row = $this->databaseConnection->sql_fetch_assoc($res);
-        return rtrim($row['domainName'], '/');
-    }
-
-    /**
-     * Returns the path to the page $id
-     *
-     * @param int $id Page ID
-     * @param string $pathMP MP variable content
-     * @return string Path (HTML-escaped)
-     */
-    public function getPathFromPageId($id, $pathMP = '')
-    {
-        $identStr = $id . '|' . $pathMP;
-        if (!isset($this->cache_path[$identStr])) {
-            $this->fe_groups_required[$id] = array();
-            $this->domain_records[$id] = array();
-            $rl = $this->getRootLine($id, $pathMP);
-            $path = '';
-            $pageCount = count($rl);
-            if (is_array($rl) && !empty($rl)) {
-                $index = 0;
-                $breadcrumbWrap = isset($this->conf['breadcrumbWrap']) ? $this->conf['breadcrumbWrap'] : '/';
-                $breadcrumbWraps = $GLOBALS['TSFE']->tmpl->splitConfArray(array('wrap' => $breadcrumbWrap), $pageCount);
-                foreach ($rl as $k => $v) {
-                    // Check fe_user
-                    if ($v['fe_group'] && ($v['uid'] == $id || $v['extendToSubpages'])) {
-                        $this->fe_groups_required[$id][] = $v['fe_group'];
-                    }
-                    // Check sys_domain.
-                    if ($this->conf['search.']['detect_sys_domain_records']) {
-                        $sysDName = $this->getFirstSysDomainRecordForPage($v['uid']);
-                        if ($sysDName) {
-                            $this->domain_records[$id][] = $sysDName;
-                            // Set path accordingly:
-                            $path = $sysDName . $path;
-                            break;
-                        }
-                    }
-                    // Stop, if we find that the current id is the current root page.
-                    if ($v['uid'] == $this->frontendController->config['rootLine'][0]['uid']) {
-                        array_pop($breadcrumbWraps);
-                        break;
-                    }
-                    $path = $this->cObj->wrap(htmlspecialchars($v['title']), array_pop($breadcrumbWraps)['wrap']) . $path;
-                }
-            }
-            $this->cache_path[$identStr] = $path;
-            if (is_array($this->conf['path_stdWrap.'])) {
-                $this->cache_path[$identStr] = $this->cObj->stdWrap($this->cache_path[$identStr], $this->conf['path_stdWrap.']);
-            }
-        }
-        return $this->cache_path[$identStr];
-    }
-
-    /**
-     * Return the menu of pages used for the selector.
-     *
-     * @param int $id Page ID for which to return menu
-     * @return array Menu items (for making the section selector box)
-     */
-    public function getMenu($id)
-    {
-        if ($this->conf['show.']['LxALLtypes']) {
-            $output = array();
-            $res = $this->databaseConnection->exec_SELECTquery('title,uid', 'pages', 'pid=' . (int)$id . $this->cObj->enableFields('pages'), '', 'sorting');
-            while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
-                $output[$row['uid']] = $this->frontendController->sys_page->getPageOverlay($row);
-            }
-            $this->databaseConnection->sql_free_result($res);
-            return $output;
-        } else {
-            return $this->frontendController->sys_page->getMenu($id);
-        }
-    }
-
-    /**
-     * Returns if an item type is a multipage item type
-     *
-     * @param string $item_type Item type
-     * @return bool TRUE if multipage capable
-     */
-    public function multiplePagesType($item_type)
-    {
-        return is_object($this->external_parsers[$item_type]) && $this->external_parsers[$item_type]->isMultiplePageExtension($item_type);
-    }
-
-    /**
-     * Converts the input string from utf-8 to the backend charset.
-     *
-     * @param string String to convert (utf-8)
-     * @return string Converted string (backend charset if different from utf-8)
-     * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
-     */
-    public function utf8_to_currentCharset($str)
-    {
-        GeneralUtility::logDeprecatedFunction();
-        return $this->frontendController->csConv($str, 'utf-8');
-    }
-
-    /**
-     * Returns an object reference to the hook object if any
-     *
-     * @param string $functionName Name of the function you want to call / hook key
-     * @return object|NULL Hook object, if any. Otherwise NULL.
-     */
-    public function hookRequest($functionName)
-    {
-        // Hook: menuConfig_preProcessModMenu
-        if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]) {
-            $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]);
-            if (method_exists($hookObj, $functionName)) {
-                $hookObj->pObj = $this;
-                return $hookObj;
-            }
-        }
-    }
-
-    /**
-     * Obtains the URL of the search target page
-     *
-     * @return string
-     */
-    protected function getSearchFormActionURL()
-    {
-        $targetUrlPid = $this->getSearchFormActionPidFromTS();
-        if ($targetUrlPid == 0) {
-            $targetUrlPid = $this->frontendController->id;
-        }
-        return $this->pi_getPageLink($targetUrlPid, $this->frontendController->sPre);
-    }
-
-    /**
-     * Obtains search form target pid from the TypoScript configuration
-     *
-     * @return int
-     */
-    protected function getSearchFormActionPidFromTS()
-    {
-        $result = 0;
-        if (isset($this->conf['search.']['targetPid']) || isset($this->conf['search.']['targetPid.'])) {
-            if (is_array($this->conf['search.']['targetPid.'])) {
-                $result = $this->cObj->stdWrap($this->conf['search.']['targetPid'], $this->conf['search.']['targetPid.']);
-            } else {
-                $result = $this->conf['search.']['targetPid'];
-            }
-            $result = (int)$result;
-        }
-        return $result;
-    }
-
-    /**
-     * Formats date as 'created' date
-     *
-     * @param int $date
-     * @return string
-     */
-    protected function formatCreatedDate($date)
-    {
-        $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
-        return $this->formatDate($date, 'created', $defaultFormat);
-    }
-
-    /**
-     * Formats date as 'modified' date
-     *
-     * @param int $date
-     * @return string
-     */
-    protected function formatModifiedDate($date)
-    {
-        $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
-        return $this->formatDate($date, 'modified', $defaultFormat);
-    }
-
-    /**
-     * Formats the date using format string from TypoScript or default format
-     * if TypoScript format is not set
-     *
-     * @param int $date
-     * @param string $tsKey
-     * @param string $defaultFormat
-     * @return string
-     */
-    protected function formatDate($date, $tsKey, $defaultFormat)
-    {
-        $strftimeFormat = $this->conf['dateFormat.'][$tsKey];
-        if ($strftimeFormat) {
-            $result = strftime($strftimeFormat, $date);
-        } else {
-            $result = date($defaultFormat, $date);
-        }
-        return $result;
-    }
-
-    /**
-     * Search type
-     * e.g. sentence (20), any part of the word (1)
-     *
-     * @return int
-     */
-    public function getSearchType()
-    {
-        return (int)$this->piVars['type'];
-    }
-
-    /**
-     * A list of integer which should be root-pages to search from
-     *
-     * @return int[]
-     */
-    public function getSearchRootPageIdList()
-    {
-        return \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->wholeSiteIdList);
-    }
-
-    /**
-     * Getter for join_pages flag
-     * enabled through $this->conf['search.']['skipExtendToSubpagesChecking']
-     *
-     * @return bool
-     */
-    public function getJoinPagesForQuery()
-    {
-        return (bool)$this->join_pages;
-    }
-
-    /**
-     * Load settings and apply stdWrap to them
-     */
-    protected function loadSettings()
-    {
-        if (!is_array($this->conf['results.'])) {
-            $this->conf['results.'] = array();
-        }
-        $this->conf['results.']['summaryCropAfter'] = MathUtility::forceIntegerInRange(
-            $this->cObj->stdWrap($this->conf['results.']['summaryCropAfter'], $this->conf['results.']['summaryCropAfter.']),
-            10, 5000, 180
-        );
-        $this->conf['results.']['summaryCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['summaryCropSignifier'], $this->conf['results.']['summaryCropSignifier.']);
-        $this->conf['results.']['titleCropAfter'] = MathUtility::forceIntegerInRange(
-            $this->cObj->stdWrap($this->conf['results.']['titleCropAfter'], $this->conf['results.']['titleCropAfter.']),
-            10, 500, 50
-        );
-        $this->conf['results.']['titleCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['titleCropSignifier'], $this->conf['results.']['titleCropSignifier.']);
-        $this->conf['results.']['markupSW_summaryMax'] = MathUtility::forceIntegerInRange(
-            $this->cObj->stdWrap($this->conf['results.']['markupSW_summaryMax'], $this->conf['results.']['markupSW_summaryMax.']),
-            10, 5000, 300
-        );
-        $this->conf['results.']['markupSW_postPreLgd'] = MathUtility::forceIntegerInRange(
-            $this->cObj->stdWrap($this->conf['results.']['markupSW_postPreLgd'], $this->conf['results.']['markupSW_postPreLgd.']),
-            1, 500, 60
-        );
-        $this->conf['results.']['markupSW_postPreLgd_offset'] = MathUtility::forceIntegerInRange(
-            $this->cObj->stdWrap($this->conf['results.']['markupSW_postPreLgd_offset'], $this->conf['results.']['markupSW_postPreLgd_offset.']),
-            1, 50, 5
-        );
-        $this->conf['results.']['markupSW_divider'] = $this->cObj->stdWrap($this->conf['results.']['markupSW_divider'], $this->conf['results.']['markupSW_divider.']);
-        $this->conf['results.']['hrefInSummaryCropAfter'] = MathUtility::forceIntegerInRange(
-            $this->cObj->stdWrap($this->conf['results.']['hrefInSummaryCropAfter'], $this->conf['results.']['hrefInSummaryCropAfter.']),
-            10, 400, 60
-        );
-        $this->conf['results.']['hrefInSummaryCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['hrefInSummaryCropSignifier'], $this->conf['results.']['hrefInSummaryCropSignifier.']);
-    }
-}
index e9ecfb1..724107d 100644 (file)
@@ -1,14 +1,6 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-// Register "old" FE plugin and hide layout, select_key and pages fields in BE
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
-    array('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:mod_indexed_search', 'indexed_search'),
-    'list_type',
-    'indexed_search'
-);
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['indexed_search'] = 'layout,select_key,pages';
-
 // Registers "new" extbase based FE plugin and hide layout, select_key, pages and recursive fields in BE
 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
     'TYPO3.CMS.IndexedSearch',
diff --git a/typo3/sysext/indexed_search/Resources/PHP/class.tx_indexed_search_pi_wizicon.php b/typo3/sysext/indexed_search/Resources/PHP/class.tx_indexed_search_pi_wizicon.php
deleted file mode 100644 (file)
index 422da82..0000000
+++ /dev/null
@@ -1,36 +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!
- */
-
-/**
- * Icon for plugin wizard
- */
-class tx_indexed_search_pi_wizicon
-{
-    /**
-     * Adds the indexed_search pi1 wizard icon
-     *
-     * @param array $wizardItems Input array with wizard items for plugins
-     * @return array Modified input array, having the item for indexed_search pi1 added.
-     */
-    public function proc($wizardItems)
-    {
-        $wizardItems['plugins_tx_indexed_search'] = array(
-            'iconIdentifier' => 'content-special-indexed_search',
-            'title' => $GLOBALS['LANG']->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_title'),
-            'description' => $GLOBALS['LANG']->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_description'),
-            'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=indexed_search'
-        );
-        return $wizardItems;
-    }
-}
diff --git a/typo3/sysext/indexed_search/Resources/Private/Templates/indexed_search.tmpl b/typo3/sysext/indexed_search/Resources/Private/Templates/indexed_search.tmpl
deleted file mode 100644 (file)
index 4776dc7..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-       <title>indexed_search template</title>
-</head>
-
-<body>
-
-<h1>Indexed Search: Default template</h1>
-
-
-<h2>TEMPLATE_SEARCH_FORM</h2>
-<p><em>Template for displaying the search form.</em></p>
-
-<!-- ###SEARCH_FORM### begin -->
-<div class="tx-indexedsearch-searchbox">
-<form action="###ACTION_URL###" method="post" id="tx_indexedsearch">
-       <input type="hidden" name="tx_indexedsearch[_sections]" value="0" />
-       <input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
-       <input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" />
-       <!-- ###HIDDEN_FIELDS### begin -->
-       <input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" />
-       <!-- ###HIDDEN_FIELDS### end -->
-
-       <table cellpadding="0" cellspacing="0" border="0" summary="Search form">
-               <tr>
-                       <td>###FORM_SEARCHFOR###</td>
-                       <td colspan="2"><input type="search" name="tx_indexedsearch[sword]" value="###SWORD_VALUE###" class="tx-indexedsearch-searchbox-sword sword" ###PLACEHOLDER### /></td>
-               </tr>
-
-               <!-- ###ADDITONAL_KEYWORD### begin -->
-               <tr>
-                       <td>&nbsp;</td>
-                       <td colspan="2"><input type="hidden" name="tx_indexedsearch[sword_prev]" value="###SWORD_PREV_VALUE###" /><input type="checkbox" name="tx_indexedsearch[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" ###SWORD_PREV_INCLUDE_CHECKED### /> <label for="tx_indexedsearch_sword_prev_include">###ADD_TO_CURRENT_SEARCH###</label>.</td>
-               </tr>
-               <!-- ###ADDITONAL_KEYWORD### end -->
-
-               <!-- ###SEARCH_FORM_EXTENDED### begin -->
-
-               <!-- ###SELECT_SEARCH_FOR### begin -->
-               <tr>
-                       <td>###FORM_MATCH###</td>
-                       <td>
-                               <!-- ###SELECT_SEARCH_TYPE### begin -->
-                               <select name="tx_indexedsearch[type]" class="tx-indexedsearch-selectbox-type type">
-                                       ###SELECTBOX_TYPE_VALUES###
-                               </select>
-                               <!-- ###SELECT_SEARCH_TYPE### end -->
-                       </td>
-                       <td>
-                               <!-- ###SELECT_SEARCH_DEFOP### begin -->
-                               <select name="tx_indexedsearch[defOp]" class="tx-indexedsearch-selectbox-defop defop">
-                                       ###SELECTBOX_DEFOP_VALUES###
-                               </select>
-                               <!-- ###SELECT_SEARCH_DEFOP### end -->
-                       </td>
-               </tr>
-               <!-- ###SELECT_SEARCH_FOR### end -->
-
-               <!-- ###SELECT_SEARCH_IN### begin -->
-               <tr>
-                       <td>###FORM_SEARCHIN###</td>
-                       <td>
-                               <!-- ###SELECT_SEARCH_MEDIA### begin -->
-                               <select name="tx_indexedsearch[media]" class="tx-indexedsearch-selectbox-media media">
-                                       ###SELECTBOX_MEDIA_VALUES###
-                               </select>
-                               <!-- ###SELECT_SEARCH_MEDIA### end -->
-                       </td>
-                       <td>
-                               <!-- ###SELECT_SEARCH_LANG### begin -->
-                               <select name="tx_indexedsearch[lang]" class="tx-indexedsearch-selectbox-lang lang">
-                                       ###SELECTBOX_LANG_VALUES###
-                               </select>
-                               <!-- ###SELECT_SEARCH_LANG### end -->
-                       </td>
-               </tr>
-               <!-- ###SELECT_SEARCH_IN### end -->
-
-               <!-- ###SELECT_SECTION### begin -->
-               <tr>
-                       <td>###FORM_FROMSECTION###</td>
-                       <td colspan="2">
-                               <select name="tx_indexedsearch[sections]" class="tx-indexedsearch-selectbox-sections sections">
-                                       ###SELECTBOX_SECTIONS_VALUES###
-                               </select>
-                       </td>
-               </tr>
-               <!-- ###SELECT_SECTION### end -->
-
-               <!-- ###SELECT_FREEINDEXUID### begin -->
-               <tr>
-                       <td valign="top">###FORM_FREEINDEXUID###</td>
-                       <td colspan="2">
-                               <select name="tx_indexedsearch[freeIndexUid]" class="tx-indexedsearch-selectbox-freeIndexUid freeIndexUid">
-                                       ###SELECTBOX_FREEINDEXUIDS_VALUES###
-                               </select>
-                       </td>
-               </tr>
-               <!-- ###SELECT_FREEINDEXUID### end -->
-
-               <!-- ###SELECT_ORDER### begin -->
-               <tr>
-                       <td valign="top">###FORM_ORDERBY###</td>
-                       <td colspan="2">
-                               <select name="tx_indexedsearch[order]" class="tx-indexedsearch-selectbox-order order">
-                                       ###SELECTBOX_ORDER_VALUES###
-                               </select>&nbsp;
-                               <select name="tx_indexedsearch[desc]" class="tx-indexedsearch-selectbox-desc desc">
-                                       ###SELECTBOX_DESC_VALUES###
-                               </select>
-                       </td>
-               </tr>
-               <!-- ###SELECT_ORDER### end -->
-
-               <!-- ###SELECT_RESULTS### begin -->
-               <tr>
-                       <td valign="top">###FORM_ATATIME###</td>
-                       <td colspan="2">
-                               <select name="tx_indexedsearch[results]" class="tx-indexedsearch-selectbox-results results">
-                                       ###SELECTBOX_RESULTS_VALUES###
-                               </select>
-                       </td>
-               </tr>
-               <!-- ###SELECT_RESULTS### end -->
-
-               <!-- ###SELECT_GROUP### begin -->
-               <tr>
-                       <td valign="top">###FORM_STYLE###</td>
-                       <td colspan="2">
-                               <select name="tx_indexedsearch[group]" class="tx-indexedsearch-selectbox-group group">
-                                       ###SELECTBOX_GROUP_VALUES###
-                               </select>&nbsp;&nbsp;
-
-                               <!-- ###SELECT_EXTRESUME### begin -->
-                               <br /><input type="hidden" name="tx_indexedsearch[extResume]" value="0" /><input type="checkbox" value="1" name="tx_indexedsearch[extResume]" id="tx_indexedsearch_extResume" ###EXT_RESUME_CHECKED### /> <label for="tx_indexedsearch_extResume">###FORM_EXTRESUME###</label>
-                               <!-- ###SELECT_EXTRESUME### end -->
-                       </td>
-               </tr>
-               <!-- ###SELECT_GROUP### end -->
-
-               <!-- ###SEARCH_FORM_EXTENDED### end -->
-               <tr>
-                       <td>&nbsp;</td>
-                       <td><input type="submit" name="tx_indexedsearch[submit_button]" value="###FORM_SUBMIT###" class="tx-indexedsearch-searchbox-button submit" /></td>
-               </tr>
-       </table>
-       <p>###LINKTOOTHERMODE###</p>
-</form>
-</div>
-<!-- ###SEARCH_FORM### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_RULES</h2>
-<p><em>Template for displaying the search rules.</em></p>
-
-<!-- ###RULES### begin -->
-       <div class="tx-indexedsearch-rules">
-               <h2>###RULES_HEADER###</h2>
-               <p>###RULES_TEXT###</p>
-       </div>
-<!-- ###RULES### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_RESULT_SECTION_LINKS</h2>
-<p><em>Template for the section links in section mode.</em></p>
-
-<!-- ###RESULT_SECTION_LINKS### begin -->
-       <div class="tx-indexedsearch-sec">
-               <table cellpadding="0" cellspacing="0" border="0" summary="Result links">
-                       ###LINKS###
-               </table>
-       </div>
-<!-- ###RESULT_SECTION_LINKS### end -->
-
-<!-- ###RESULT_SECTION_LINKS_LINK### begin -->
-                       <tr>
-                               <td width="100%">--&gt; ###LINK###</td>
-                       </tr>
-<!-- ###RESULT_SECTION_LINKS_LINK### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_SECTION_HEADER</h2>
-<p><em>Template for the section title in section mode.</em></p>
-<!-- ###SECTION_HEADER### begin -->
-       <div class="tx-indexedsearch-secHead"><a name="###ANCHOR_URL###"></a>
-               <table cellpadding="0" cellspacing="0" border="0" summary="Section header">
-                       <tr>
-                               <td class="tx-indexedsearch-title title" width="100%">###SECTION_TITLE###</td>
-                               <td class="tx-indexedsearch-result-count result-count" nowrap="nowrap">###RESULT_COUNT### ###RESULT_NAME###</td>
-                       </tr>
-               </table>
-       </div>
-
-<!-- ###SECTION_HEADER### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_RESULT_OUTPUT</h2>
-<p><em>Template for the search result list.</em></p>
-
-<!-- ###RESULT_OUTPUT### begin -->
-       <div class="tx-indexedsearch-res">
-               <table cellpadding="0" cellspacing="0" border="0" summary="Result row">
-                       <!-- ###HEADER_ROW### begin -->
-                       <tr>
-                               <td class="tx-indexedsearch-icon icon" nowrap="nowrap">###ICON###</td>
-                               <td class="tx-indexedsearch-result-number result-number" nowrap="nowrap">###RESULT_NUMBER###</td>
-                               <td class="tx-indexedsearch-title###CSSSUFFIX### title" width="100%">###TITLE###</td>
-                               <td class="tx-indexedsearch-percent percent" nowrap="nowrap">###RATING###</td>
-                       </tr>
-                       <!-- ###HEADER_ROW### end -->
-
-                       <!-- ###ROW_LONG### begin -->
-                       <tr>
-                               <td>&nbsp;</td>
-                               <td class="tx-indexedsearch-descr descr" width="100%" colspan="3">###DESCRIPTION###</td>
-                       </tr>
-                       <tr>
-                               <td>&nbsp;</td>
-                               <td class="tx-indexedsearch-info info" width="100%" colspan="3">###TEXT_ITEM_SIZE### ###SIZE### - ###TEXT_ITEM_CRDATE### ###CREATED### - ###TEXT_ITEM_MTIME### ###MODIFIED###<br />
-                                       ###TEXT_ITEM_PATH### <span class="tx-indexedsearch-path path">###PATH###</span></td>
-                       </tr>
-                       <!-- ###ROW_LONG### end -->
-
-                       <!-- ###ROW_SHORT### begin -->
-                       <tr>
-                               <td>&nbsp;</td>
-                               <td class="tx-indexedsearch-descr descr" width="100%" colspan="3">###DESCRIPTION###</td>
-                       </tr>
-                       <!-- ###ROW_SHORT### end -->
-
-                       <!-- ###ROW_SUB### begin -->
-                       <tr>
-                               <td>&nbsp;</td>
-                               <td class="tx-indexedsearch-list list" width="100%" colspan="3"><br />###TEXT_ROW_SUB###<br /><br /></td>
-                       </tr>
-                       <!-- ###ROW_SUB### end -->
-               </table>
-               <br />
-       </div>
-<!-- ###RESULT_OUTPUT### end -->
-<br /><br />
-
-
-</body>
-</html>
diff --git a/typo3/sysext/indexed_search/Resources/Private/Templates/template_css.tmpl b/typo3/sysext/indexed_search/Resources/Private/Templates/template_css.tmpl
deleted file mode 100644 (file)
index 2cb0f45..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-       <title>indexed_search template</title>
-</head>
-
-<body>
-
-<h1>Indexed Search: Tableless template</h1>
-
-
-<h2>TEMPLATE_SEARCH_FORM</h2>
-<p><em>Template for displaying the search form.</em></p>
-
-<!-- ###SEARCH_FORM### begin -->
-<div class="tx-indexedsearch-searchbox searchbox-tmpl-css">
-<form action="###ACTION_URL###" method="post" id="tx_indexedsearch">
-       <div>
-               <input type="hidden" name="tx_indexedsearch[_sections]" value="0" />
-               <input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
-               <input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" />
-               <!-- ###HIDDEN_FIELDS### begin -->
-               <input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" />
-               <!-- ###HIDDEN_FIELDS### end -->
-       </div>
-
-       <fieldset>
-               <legend>###FORM_LEGEND###</legend>
-
-               <div class="tx-indexedsearch-form">
-                       <label for="tx-indexedsearch-searchbox-sword">###FORM_SEARCHFOR###</label>
-                       <input type="search" name="tx_indexedsearch[sword]" value="###SWORD_VALUE###" id="tx-indexedsearch-searchbox-sword" class="tx-indexedsearch-searchbox-sword sword" ###PLACEHOLDER### />&nbsp;
-               </div>
-
-               <!-- ###ADDITONAL_KEYWORD### begin -->
-               <input type="hidden" name="tx_indexedsearch[sword_prev]" value="###SWORD_PREV_VALUE###" />
-               <input type="checkbox" name="tx_indexedsearch[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" ###SWORD_PREV_INCLUDE_CHECKED### /> <label for="tx_indexedsearch_sword_prev_include">###ADD_TO_CURRENT_SEARCH###.</label>
-               <!-- ###ADDITONAL_KEYWORD### end -->
-
-               <!-- ###SEARCH_FORM_EXTENDED### begin -->
-
-               <!-- ###SELECT_SEARCH_FOR### begin -->
-               <div class="tx-indexedsearch-search-for">
-                       <label for="tx-indexedsearch-selectbox-type">###FORM_MATCH###</label>
-
-                       <!-- ###SELECT_SEARCH_TYPE### begin -->
-                       <select name="tx_indexedsearch[type]" id="tx-indexedsearch-selectbox-type" class="tx-indexedsearch-selectbox-type type">###SELECTBOX_TYPE_VALUES###</select>&nbsp;
-                       <!-- ###SELECT_SEARCH_TYPE### end -->
-
-                       <!-- ###SELECT_SEARCH_DEFOP### begin -->
-                       <select name="tx_indexedsearch[defOp]" id="tx-indexedsearch-selectbox-defop" class="tx-indexedsearch-selectbox-defop defop">###SELECTBOX_DEFOP_VALUES###</select>
-                       <!-- ###SELECT_SEARCH_DEFOP### end -->
-               </div>
-               <!-- ###SELECT_SEARCH_FOR### end -->
-
-               <!-- ###SELECT_SEARCH_IN### begin -->
-               <div class="tx-indexedsearch-search-in">
-                       <label for="tx-indexedsearch-selectbox-media">###FORM_SEARCHIN###</label>
-
-                       <!-- ###SELECT_SEARCH_MEDIA### begin -->
-                       <select name="tx_indexedsearch[media]" id="tx-indexedsearch-selectbox-media" class="tx-indexedsearch-selectbox-media media">###SELECTBOX_MEDIA_VALUES###</select>&nbsp;
-                       <!-- ###SELECT_SEARCH_MEDIA### end -->
-
-                       <!-- ###SELECT_SEARCH_LANG### begin -->
-                       <select name="tx_indexedsearch[lang]" id="tx-indexedsearch-selectbox-lang" class="tx-indexedsearch-selectbox-lang lang">###SELECTBOX_LANG_VALUES###</select>
-                       <!-- ###SELECT_SEARCH_LANG### end -->
-               </div>
-               <!-- ###SELECT_SEARCH_IN### end -->
-
-               <!-- ###SELECT_SECTION### begin -->
-               <div class="tx-indexedsearch-search-select-section">
-                       <label for="tx-indexedsearch-selectbox-sections">###FORM_FROMSECTION###</label>
-                       <select name="tx_indexedsearch[sections]" id="tx-indexedsearch-selectbox-sections" class="tx-indexedsearch-selectbox-sections sections">###SELECTBOX_SECTIONS_VALUES###</select>
-               </div>
-               <!-- ###SELECT_SECTION### end -->
-
-               <!-- ###SELECT_FREEINDEXUID### begin -->
-               <div class="tx-indexedsearch-search-freeindexuid">
-                       <label for="tx-indexedsearch-selectbox-freeIndexUid">###FORM_FREEINDEXUID###</label>
-                       <select name="tx_indexedsearch[freeIndexUid]" id="tx-indexedsearch-selectbox-freeIndexUid" class="tx-indexedsearch-selectbox-freeIndexUid freeIndexUid">###SELECTBOX_FREEINDEXUIDS_VALUES###</select>
-               </div>
-               <!-- ###SELECT_FREEINDEXUID### end -->
-
-               <!-- ###SELECT_ORDER### begin -->
-               <div class="tx-indexedsearch-search-select-order">
-                       <label for="tx-indexedsearch-selectbox-order">###FORM_ORDERBY###</label>
-                       <select name="tx_indexedsearch[order]" id="tx-indexedsearch-selectbox-order" class="tx-indexedsearch-selectbox-order order">###SELECTBOX_ORDER_VALUES###</select>&nbsp;
-                       <select name="tx_indexedsearch[desc]" id="tx-indexedsearch-selectbox-desc" class="tx-indexedsearch-selectbox-desc desc">###SELECTBOX_DESC_VALUES###</select>
-               </div>
-               <!-- ###SELECT_ORDER### end -->
-
-               <!-- ###SELECT_RESULTS### begin -->
-               <div class="tx-indexedsearch-search-select-results">
-                       <label for="tx-indexedsearch-selectbox-results">###FORM_ATATIME###</label>
-                       <select name="tx_indexedsearch[results]" id="tx-indexedsearch-selectbox-results" class="tx-indexedsearch-selectbox-results results">###SELECTBOX_RESULTS_VALUES###</select>
-               </div>
-               <!-- ###SELECT_RESULTS### end -->
-
-               <!-- ###SELECT_GROUP### begin -->
-               <div class="tx-indexedsearch-search-select-group">
-                       <label for="tx-indexedsearch-selectbox-group">###FORM_STYLE###</label>
-                       <select name="tx_indexedsearch[group]" id="tx-indexedsearch-selectbox-group" class="tx-indexedsearch-selectbox-group group">###SELECTBOX_GROUP_VALUES###</select>
-
-                       <!-- ###SELECT_EXTRESUME### begin -->
-                       <input type="hidden" name="tx_indexedsearch[extResume]" value="0" />
-                       <input type="checkbox" value="1" name="tx_indexedsearch[extResume]" id="tx_indexedsearch_extResume" ###EXT_RESUME_CHECKED### /> <label for="tx_indexedsearch_extResume">###FORM_EXTRESUME###</label>
-                       <!-- ###SELECT_EXTRESUME### end -->
-               </div>
-               <!-- ###SELECT_GROUP### end -->
-
-               <!-- ###SEARCH_FORM_EXTENDED### end -->
-               <div class="tx-indexedsearch-search-submit">
-                       <input type="submit" name="tx_indexedsearch[submit_button]" value="###FORM_SUBMIT###" id="tx-indexedsearch-searchbox-button-submit" class="tx-indexedsearch-searchbox-button submit" />
-               </div>
-       </fieldset>
-       <p>###LINKTOOTHERMODE###</p>
-</form>
-</div>
-<!-- ###SEARCH_FORM### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_RULES</h2>
-<p><em>Template for displaying the search rules.</em></p>
-
-<!-- ###RULES### begin -->
-       <div class="tx-indexedsearch-rules">
-               <h2>###RULES_HEADER###</h2>
-               <p>###RULES_TEXT###</p>
-       </div>
-<!-- ###RULES### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_RESULT_SECTION_LINKS</h2>
-<p><em>Template for the section links in section mode.</em></p>
-
-<!-- ###RESULT_SECTION_LINKS### begin -->
-       <div class="tx-indexedsearch-sec">
-               <ol>
-                       ###LINKS###
-               </ol>
-       </div>
-<!-- ###RESULT_SECTION_LINKS### end -->
-
-<!-- ###RESULT_SECTION_LINKS_LINK### begin -->
-                       <li>###LINK###</li>
-<!-- ###RESULT_SECTION_LINKS_LINK### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_SECTION_HEADER</h2>
-<p><em>Template for the section title in section mode.</em></p>
-<!-- ###SECTION_HEADER### begin -->
-       <div id="###ANCHOR_URL###" class="tx-indexedsearch-secHead secHead-tmpl-css">
-               <h2 class="tx-indexedsearch-title title">###SECTION_TITLE### <span class="tx-indexedsearch-result-count result-count result-count-tmpl-css">###RESULT_COUNT### ###RESULT_NAME###</span></h2>
-       </div>
-
-<!-- ###SECTION_HEADER### end -->
-<br /><br />
-
-
-
-
-<h2>TEMPLATE_RESULT_OUTPUT</h2>
-<p><em>Template for the search result list.</em></p>
-<!-- ###RESULT_OUTPUT### begin -->
-       <div class="tx-indexedsearch-res res res-tmpl-css">
-               <!-- ###HEADER_ROW### begin -->
-               <h3><span class="tx-indexedsearch-icon icon">###ICON###</span> <span class="tx-indexedsearch-result-number result-number">###RESULT_NUMBER###</span> <span class="tx-indexedsearch-title###CSSSUFFIX### title">###TITLE###</span> <span class="tx-indexedsearch-percent percent percent-tmpl-css">###RATING###</span></h3>
-               <!-- ###HEADER_ROW### end -->
-
-               <!-- ###ROW_LONG### begin -->
-               <p class="tx-indexedsearch-descr descr">###DESCRIPTION###</p>
-               <dl class="tx-indexedsearch-info info info-tmpl-css">
-                       <dt class="tx-indexedsearch-text-item-size item-size">###TEXT_ITEM_SIZE###&nbsp;</dt>
-                       <dd class="tx-indexedsearch-text-item-size item-size">###SIZE###,&nbsp;</dd>
-
-                       <dt class="tx-indexedsearch-text-item-crdate item-crdate">###TEXT_ITEM_CRDATE###&nbsp;</dt>
-                       <dd class="tx-indexedsearch-text-item-crdate item-crdate">###CREATED###,&nbsp;</dd>
-
-                       <dt class="tx-indexedsearch-text-item-mtime item-mtime">###TEXT_ITEM_MTIME###&nbsp;</dt>
-                       <dd class="tx-indexedsearch-text-item-mtime item-mtime">###MODIFIED###</dd>
-
-                       <dt class="tx-indexedsearch-text-item-path item-path">###TEXT_ITEM_PATH###&nbsp;</dt>
-                       <dd class="tx-indexedsearch-text-item-path item-path">###PATH###</dd>
-               </dl>
-               <!-- ###ROW_LONG### end -->
-
-               <!-- ###ROW_SHORT### begin -->
-               <p class="tx-indexedsearch-descr descr">###DESCRIPTION###</p>
-               <!-- ###ROW_SHORT### end -->
-
-               <!-- ###ROW_SUB### begin -->
-               <p class="tx-indexedsearch-list list">###TEXT_ROW_SUB###</p>
-               <!-- ###ROW_SUB### end -->
-       </div>
-<!-- ###RESULT_OUTPUT### end -->
-<br /><br />
-
-
-</body>
-</html>
index a27e89e..e77fa77 100644 (file)
@@ -1,23 +1,6 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-// register pibase plugin
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
-    'indexed_search',
-    'setup',
-    trim('
-plugin.tx_indexedsearch = USER_INT
-plugin.tx_indexedsearch.userFunc = ' . \TYPO3\CMS\IndexedSearch\Controller\SearchFormController::class . '->main
-       ')
-);
-
-// add default rendering for pibase plugin
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
-    'indexed_search',
-    'setup',
-    'tt_content.list.20.indexed_search =< plugin.tx_indexedsearch',
-    'defaultContentRendering'
-);
 
 // register extbase plugin
 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('TYPO3.CMS.IndexedSearch', 'Pi2', array('Search' => 'form,search'), array('Search' => 'form,search'));
index 227004c..bba4b0b 100644 (file)
@@ -19,8 +19,6 @@ if (TYPO3_MODE === 'BE') {
         )
     );
 
-    $GLOBALS['TBE_MODULES_EXT']['xMOD_db_new_content_el']['addElClasses']['tx_indexed_search_pi_wizicon'] =
-        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Resources/PHP/class.tx_indexed_search_pi_wizicon.php';
 }
 
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('index_config');
diff --git a/typo3/sysext/indexed_search/ext_typoscript_setup.txt b/typo3/sysext/indexed_search/ext_typoscript_setup.txt
deleted file mode 100644 (file)
index c21352f..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-config.index_enable = 0
-config.index_externals = 0
-config.index_metatags = 1
-
-plugin.tx_indexedsearch {
-       templateFile = EXT:indexed_search/Resources/Private/Templates/indexed_search.tmpl
-
-       # Date formats for created/modified dates in search results. See PHP strftime() function. Leave blank for using system defaults
-       dateFormat {
-               created =
-               modified =
-       }
-
-       breadcrumbWrap = / || /
-
-       show {
-               rules = 1
-               parsetimes = 0
-               L2sections = 0
-               L1sections = 1
-               LxALLtypes = 0
-               clearSearchBox = 0
-               clearSearchBox.enableSubSearchCheckBox = 0
-               forbiddenRecords = 0
-               alwaysShowPageLinks = 0
-               advancedSearchLink = 1
-               resultNumber = 0
-               mediaList =
-       }
-
-       # Blinding of option-selectors / values in these (advanced search) (see $optValues array in source code for options + extResume checkbox)
-       blind {
-               type = 0
-               defOp = 0
-               sections = 0
-               freeIndexUid = 1
-               media = 0
-               order = 0
-               group = 0
-               lang = 0
-               desc = 0
-               results = 0
-               # defOp.1=1
-               # extResume=1
-       }
-       rules_stdWrap {
-       }
-       sectionlinks_stdWrap {
-       }
-       path_stdWrap {
-       }
-       resultlist_stdWrap {
-       }
-       search {
-               rootPidList =
-               page_links = 10
-               detect_sys_domain_records = 0
-               defaultFreeIndexUidList = -1
-               skipExtendToSubpagesChecking = 0
-               exactCount = 0
-               targetPid.data = TSFE:id
-       }
-
-       # various crop/offset settings for single result items
-       results {
-               titleCropAfter = 50
-               titleCropSignifier = ...
-               summaryCropAfter = 180
-               summaryCropSignifier =
-               hrefInSummaryCropAfter = 60
-               hrefInSummaryCropSignifier = ...
-               markupSW_summaryMax = 300
-               markupSW_postPreLgd = 60
-               markupSW_postPreLgd_offset = 5
-               markupSW_divider = ...
-               markupSW_divider.noTrimWrap = | | |
-       }
-       result_link_target =
-/*
-       flagRendering = CASE
-       flagRendering {
-               key.current = 1
-               2 = TEXT
-               2.value = German
-               default = TEXT
-               default.value = English
-       }
-*/
-/*
-       iconRendering = CASE
-       iconRendering {
-               key.current = 1
-               html = TEXT
-               html.value = HtmL
-               default = TEXT
-               default.value = TYPO3 pages
-       }
-*/
-       forwardSearchWordsInResultLink = 0
-       forwardSearchWordsInResultLink.no_cache = 1
-       linkSectionTitles = 1
-
-       # Setting default values for piVars (please see the source code for the form-field names which you can preset values for here)
-       _DEFAULT_PI_VARS {
-               extResume = 1
-               type = 1
-               group = flat
-       }
-       _CSS_DEFAULT_STYLE (
-               .tx-indexedsearch .tx-indexedsearch-browsebox LI { display:inline; margin-right:5px; }
-               .tx-indexedsearch .tx-indexedsearch-searchbox INPUT.tx-indexedsearch-searchbox-button { width:100px; }
-               .tx-indexedsearch .tx-indexedsearch-searchbox INPUT.tx-indexedsearch-searchbox-sword { width:150px; }
-               .tx-indexedsearch .tx-indexedsearch-whatis { margin-top:10px; margin-bottom:5px; }
-               .tx-indexedsearch .tx-indexedsearch-whatis .tx-indexedsearch-sw { font-weight:bold; font-style:italic; }
-               .tx-indexedsearch .tx-indexedsearch-noresults { text-align:center; font-weight:bold; }
-               .tx-indexedsearch .tx-indexedsearch-res TD.tx-indexedsearch-descr { font-style:italic; }
-               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-descr .tx-indexedsearch-redMarkup { color:red; }
-               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-info { background:#eeeeee; }
-               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead { margin-top:20px; margin-bottom:5px; }
-               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead H2 { margin-top:0px; margin-bottom:0px; }
-               .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead TD { background:#cccccc; vertical-align:middle; }
-               .tx-indexedsearch .tx-indexedsearch-res .noResume { color:#666666; }
-               .tx-indexedsearch .tx-indexedsearch-category { background:#cccccc; font-size:16px; font-weight:bold; }
-
-               /* Additional styles, needed for the tableless template_css.tmpl (styles don't conflict with the original template) */
-               .tx-indexedsearch .res-tmpl-css { clear:both; margin-bottom:1em; }
-               .tx-indexedsearch .searchbox-tmpl-css LABEL { margin-right:1em; width:10em; float:left; }
-               .tx-indexedsearch .result-count-tmpl-css, .tx-indexedsearch .percent-tmpl-css { letter-spacing:0; font-weight:normal; margin-top:-1.2em; float:right; }
-               .tx-indexedsearch .info-tmpl-css dt, .tx-indexedsearch dl.info-tmpl-css dd { float:left; }
-               .tx-indexedsearch .info-tmpl-css dd.item-mtime { float:none; }
-               .tx-indexedsearch .info-tmpl-css dd.item-path { float:none; }
-       )
-       _LOCAL_LANG {
-       }
-}