[!!!][TASK] Move legacy "search" CType to compatibility6 26/36526/3
authorBenjamin Mack <benni@typo3.org>
Sat, 31 Jan 2015 16:24:58 +0000 (17:24 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 31 Jan 2015 18:12:53 +0000 (19:12 +0100)
The primitive search, which is loaded via
"Search" CType contains a cObject called
"SEARCHRESULTS". The search is based on
a form based on FORM (old functionality already
moved to compatibility6), is moved to
compatibility6.

The following parts are moved:
- New Content Element Wizard
- cObject SEARCHRESULTS
- TypoScript from CSS Styled Content
- The TCA configuration

Due to the limited possibility to
add a CType (select item in general)
at a specific position (e.g. as first item
of an item group divided with --div--),
the patch also provides compatibility
for EXT:felogin and EXT:form by doing
TCA overrides for the CType element.

This also fixes some sideffects that came
with the previous patches for "mailform".

Releases: master
Resolves: #64696
Change-Id: I722e3bd7d3b7fad7d198e61d8ad1abde4dfdba2b
Reviewed-on: http://review.typo3.org/36526
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
21 files changed:
typo3/sysext/cms/ext_localconf.php
typo3/sysext/compatibility6/Classes/ContentObject/SearchResultContentObject.php [new file with mode: 0644]
typo3/sysext/compatibility6/Configuration/TCA/Overrides/tt_content.php
typo3/sysext/compatibility6/Configuration/TypoScript/Search/constants.txt [new file with mode: 0644]
typo3/sysext/compatibility6/Configuration/TypoScript/Search/setup.txt [new file with mode: 0644]
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/compatibility6/ext_localconf.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-64696-MoveSearchCTypeToLegacyExtension.rst [new file with mode: 0644]
typo3/sysext/css_styled_content/static/constants.txt
typo3/sysext/css_styled_content/static/setup.txt
typo3/sysext/felogin/Configuration/TCA/Overrides/tt_content.php
typo3/sysext/felogin/ext_localconf.php
typo3/sysext/form/Configuration/TCA/Overrides/tt_content.php
typo3/sysext/form/Configuration/TypoScript/setup.txt
typo3/sysext/form/ext_localconf.php
typo3/sysext/frontend/Classes/ContentObject/SearchResultContentObject.php [deleted file]
typo3/sysext/frontend/Configuration/TCA/tt_content.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/ext_localconf.php

index 8ee3f3c..bf15889 100644 (file)
@@ -131,18 +131,8 @@ mod.wizards.newContentElement {
                }
                special.show = uploads,media,menu,html,div,shortcut
 
+               # dummy placeholder for forms group
                forms.header = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms
-               forms.elements {
-                       search {
-                               icon = gfx/c_wiz/searchform.gif
-                               title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_search_title
-                               description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_search_description
-                               tt_content_defValues {
-                                       CType = search
-                               }
-                       }
-               }
-               forms.show = search
 
                plugins.header = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:plugins
                plugins.elements {
diff --git a/typo3/sysext/compatibility6/Classes/ContentObject/SearchResultContentObject.php b/typo3/sysext/compatibility6/Classes/ContentObject/SearchResultContentObject.php
new file mode 100644 (file)
index 0000000..6ac0d7a
--- /dev/null
@@ -0,0 +1,650 @@
+<?php
+namespace TYPO3\CMS\Compatibility6\ContentObject;
+
+/*
+ * 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\Frontend\ContentObject\ContentObjectRenderer;
+
+/**
+ * Search class used for the content object SEARCHRESULT
+ * and searching in database tables, typ. "pages" and "tt_content"
+ * Used to generate search queries for TypoScript.
+ * The class is included from "TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer"
+ * based on whether there has been detected content in the GPvar "sword"
+ */
+class SearchResultContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
+
+       /**
+        * @var array
+        */
+       public $tables = array();
+
+       /**
+        * Alternatively 'PRIMARY_KEY'; sorting by primary key
+        *
+        * @var string
+        */
+       public $group_by = 'PRIMARY_KEY';
+
+       /**
+        * Standard SQL-operator between words
+        *
+        * @var string
+        */
+       public $default_operator = 'AND';
+
+       /**
+        * @var bool
+        */
+       public $operator_translate_table_caseinsensitive = TRUE;
+
+       /**
+        * case-sensitive. Defines the words, which will be operators between words
+        *
+        * @var array
+        */
+       public $operator_translate_table = array(
+               array('+', 'AND'),
+               array('|', 'AND'),
+               array('-', 'AND NOT'),
+               // english
+               array('and', 'AND'),
+               array('or', 'OR'),
+               array('not', 'AND NOT')
+       );
+
+       /**
+        * Contains the search-words and operators
+        *
+        * @var array
+        */
+       public $sword_array;
+
+       /**
+        * Contains the query parts after processing.
+        *
+        * @var array
+        */
+       public $queryParts;
+
+       /**
+        * This is set with the foreign table that 'pages' are connected to.
+        *
+        * @var string
+        */
+       public $fTable;
+
+       /**
+        * How many rows to offset from the beginning
+        *
+        * @var int
+        */
+       public $res_offset = 0;
+
+       /**
+        * How many results to show (0 = no limit)
+        *
+        * @var int
+        */
+       public $res_shows = 20;
+
+       /**
+        * Intern: How many results, there was last time (with the exact same searchstring.
+        *
+        * @var int
+        */
+       public $res_count;
+
+       /**
+        * List of pageIds.
+        *
+        * @var string
+        */
+       public $pageIdList = '';
+
+       /**
+        * @var string
+        */
+       public $listOfSearchFields = '';
+
+       /**
+        * Override default constructor to make it possible to instantiate this
+        * class for indexed_search
+        *
+        * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj
+        */
+       public function __construct(ContentObjectRenderer $cObj = NULL) {
+               if (!is_null($cObj)) {
+                       $this->cObj = $cObj;
+                       $this->fileFactory = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance();
+               }
+       }
+
+       /**
+        * Rendering the cObject, SEARCHRESULT
+        *
+        * @param array $conf Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sword') && \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scols')) {
+                       $this->register_and_explode_search_string(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sword'));
+                       $this->register_tables_and_columns(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scols'), $conf['allowedCols']);
+                       // Depth
+                       $depth = 100;
+                       // The startId is found
+                       $theStartId = 0;
+                       if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype'))) {
+                               $temp_theStartId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype');
+                               $rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($temp_theStartId);
+                               // The page MUST have a rootline with the Level0-page of the current site inside!!
+                               foreach ($rootLine as $val) {
+                                       if ($val['uid'] == $GLOBALS['TSFE']->tmpl->rootLine[0]['uid']) {
+                                               $theStartId = $temp_theStartId;
+                                       }
+                               }
+                       } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype')) {
+                               if (substr(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype'), 0, 1) == 'L') {
+                                       $pointer = (int)substr(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype'), 1);
+                                       $theRootLine = $GLOBALS['TSFE']->tmpl->rootLine;
+                                       // location Data:
+                                       $locDat_arr = explode(':', \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('locationData'));
+                                       $pId = (int)$locDat_arr[0];
+                                       if ($pId) {
+                                               $altRootLine = $GLOBALS['TSFE']->sys_page->getRootLine($pId);
+                                               ksort($altRootLine);
+                                               if (count($altRootLine)) {
+                                                       // Check if the rootline has the real Level0 in it!!
+                                                       $hitRoot = 0;
+                                                       $theNewRoot = array();
+                                                       foreach ($altRootLine as $val) {
+                                                               if ($hitRoot || $val['uid'] == $GLOBALS['TSFE']->tmpl->rootLine[0]['uid']) {
+                                                                       $hitRoot = 1;
+                                                                       $theNewRoot[] = $val;
+                                                               }
+                                                       }
+                                                       if ($hitRoot) {
+                                                               // Override the real rootline if any thing
+                                                               $theRootLine = $theNewRoot;
+                                                       }
+                                               }
+                                       }
+                                       $key = $this->cObj->getKey($pointer, $theRootLine);
+                                       $theStartId = $theRootLine[$key]['uid'];
+                               }
+                       }
+                       if (!$theStartId) {
+                               // If not set, we use current page
+                               $theStartId = $GLOBALS['TSFE']->id;
+                       }
+                       // Generate page-tree
+                       $this->pageIdList .= $this->cObj->getTreeList(-1 * $theStartId, $depth);
+                       $endClause = 'pages.uid IN (' . $this->pageIdList . ')
+                               AND pages.doktype in (' . $GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'] . ($conf['addExtUrlsAndShortCuts'] ? ',3,4' : '') . ')
+                               AND pages.no_search=0' . $this->cObj->enableFields($this->fTable) . $this->cObj->enableFields('pages');
+                       if ($conf['languageField.'][$this->fTable]) {
+                               // (using sys_language_uid which is the ACTUAL language of the page.
+                               // sys_language_content is only for selecting DISPLAY content!)
+                               $endClause .= ' AND ' . $this->fTable . '.' . $conf['languageField.'][$this->fTable] . ' = ' . (int)$GLOBALS['TSFE']->sys_language_uid;
+                       }
+                       // Build query
+                       $this->build_search_query($endClause);
+                       // Count...
+                       if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scount'))) {
+                               $this->res_count = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scount');
+                       } else {
+                               $this->count_query();
+                       }
+                       // Range
+                       $spointer = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('spointer');
+                       $range = isset($conf['range.']) ? $this->cObj->stdWrap($conf['range'], $conf['range.']) : $conf['range'];
+                       if ($range) {
+                               $theRange = (int)$range;
+                       } else {
+                               $theRange = 20;
+                       }
+                       // Order By:
+                       $noOrderBy = isset($conf['noOrderBy.']) ? $this->cObj->stdWrap($conf['noOrderBy'], $conf['noOrderBy.']) : $conf['noOrderBy'];
+                       if (!$noOrderBy) {
+                               $this->queryParts['ORDERBY'] = 'pages.lastUpdated, pages.tstamp';
+                       }
+                       $this->queryParts['LIMIT'] = $spointer . ',' . $theRange;
+                       // Search...
+                       $this->execute_query();
+                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($this->result)) {
+                               $GLOBALS['TSFE']->register['SWORD_PARAMS'] = $this->get_searchwords();
+                               $total = $this->res_count;
+                               $rangeLow = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($spointer + 1, 1, $total);
+                               $rangeHigh = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($spointer + $theRange, 1, $total);
+                               // prev/next url:
+                               $target = isset($conf['target.']) ? $this->cObj->stdWrap($conf['target'], $conf['target.']) : $conf['target'];
+                               $LD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page, $target, 1, '', '', $this->cObj->getClosestMPvalueForPage($GLOBALS['TSFE']->page['uid']));
+                               $targetPart = $LD['target'] ? ' target="' . htmlspecialchars($LD['target']) . '"' : '';
+                               $urlParams = $this->cObj->URLqMark($LD['totalURL'], '&sword=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sword')) . '&scols=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scols')) . '&stype=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype')) . '&scount=' . $total);
+                               // substitution:
+                               $result = str_replace(
+                                       array(
+                                               '###RANGELOW###',
+                                               '###RANGEHIGH###',
+                                               '###TOTAL###'
+                                       ),
+                                       array(
+                                               $rangeLow,
+                                               $rangeHigh,
+                                               $total
+                                       ),
+                                       $this->cObj->cObjGetSingle($conf['layout'], $conf['layout.'], 'layout')
+                               );
+                               if ($rangeHigh < $total) {
+                                       $next = $this->cObj->cObjGetSingle($conf['next'], $conf['next.'], 'next');
+                                       $next = '<a href="' . htmlspecialchars(($urlParams . '&spointer=' . ($spointer + $theRange))) . '"' . $targetPart . $GLOBALS['TSFE']->ATagParams . '>' . $next . '</a>';
+                               } else {
+                                       $next = '';
+                               }
+                               $result = str_replace('###NEXT###', $next, $result);
+                               if ($rangeLow > 1) {
+                                       $prev = $this->cObj->cObjGetSingle($conf['prev'], $conf['prev.'], 'prev');
+                                       $prev = '<a href="' . htmlspecialchars(($urlParams . '&spointer=' . ($spointer - $theRange))) . '"' . $targetPart . $GLOBALS['TSFE']->ATagParams . '>' . $prev . '</a>';
+                               } else {
+                                       $prev = '';
+                               }
+                               $result = str_replace('###PREV###', $prev, $result);
+                               // Searching result
+                               $theValue = $this->cObj->cObjGetSingle($conf['resultObj'], $conf['resultObj.'], 'resultObj');
+                               /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj */
+                               $cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
+                               $cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
+                               $renderCode = '';
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($this->result)) {
+                                       // versionOL() here? This is search result displays, is that possible to preview anyway?
+                                       // Or are records selected here already future versions?
+                                       $cObj->start($row);
+                                       $renderCode .= $cObj->cObjGetSingle($conf['renderObj'], $conf['renderObj.'], 'renderObj');
+                               }
+                               $renderWrap = isset($conf['renderWrap.']) ? $this->cObj->stdWrap($conf['renderWrap'], $conf['renderWrap.']) : $conf['renderWrap'];
+                               $theValue .= $this->cObj->wrap($renderCode, $renderWrap);
+                               $theValue = str_replace('###RESULT###', $theValue, $result);
+                       } else {
+                               $theValue = $this->cObj->cObjGetSingle($conf['noResultObj'], $conf['noResultObj.'], 'noResultObj');
+                       }
+                       $GLOBALS['TT']->setTSlogMessage('Search in fields:   ' . $this->listOfSearchFields);
+                       // Wrapping
+                       $content = $theValue;
+                       $wrap = isset($conf['wrap.']) ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];
+                       if ($wrap) {
+                               $content = $this->cObj->wrap($content, $wrap);
+                       }
+                       if (isset($conf['stdWrap.'])) {
+                               $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+                       }
+                       // Returning, do not cache the result of the search
+                       $GLOBALS['TSFE']->set_no_cache('Search result page');
+                       return $content;
+               }
+               return '';
+       }
+
+       /**
+        * Creates the $this->tables-array.
+        * The 'pages'-table is ALWAYS included as the search is page-based. Apart from this there may be one and only one table, joined with the pages-table. This table is the first table mentioned in the requested-list. If any more tables are set here, they are ignored.
+        *
+        * @param string $requestedCols is a list (-) of columns that we want to search. This could be input from the search-form (see TypoScript documentation)
+        * @param string $allowedCols $allowedCols: is the list of columns, that MAY be searched. All allowed cols are set as result-fields. All requested cols MUST be in the allowed-fields list.
+        * @return void
+        */
+       public function register_tables_and_columns($requestedCols, $allowedCols) {
+               $rCols = $this->explodeCols($requestedCols);
+               $aCols = $this->explodeCols($allowedCols);
+               foreach ($rCols as $k => $v) {
+                       $rCols[$k] = trim($v);
+                       if (in_array($rCols[$k], $aCols)) {
+                               $parts = explode('.', $rCols[$k]);
+                               $this->tables[$parts[0]]['searchfields'][] = $parts[1];
+                       }
+               }
+               $this->tables['pages']['primary_key'] = 'uid';
+               $this->tables['pages']['resultfields'][] = 'uid';
+               unset($this->tables['pages']['fkey']);
+               foreach ($aCols as $k => $v) {
+                       $aCols[$k] = trim($v);
+                       $parts = explode('.', $aCols[$k]);
+                       $this->tables[$parts[0]]['resultfields'][] = $parts[1] . ' AS ' . str_replace('.', '_', $aCols[$k]);
+                       $this->tables[$parts[0]]['fkey'] = 'pid';
+               }
+               $this->fTable = '';
+               foreach ($this->tables as $t => $v) {
+                       if ($t != 'pages') {
+                               if (!$this->fTable) {
+                                       $this->fTable = $t;
+                               } else {
+                                       unset($this->tables[$t]);
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Function that can convert the syntax for entering which tables/fields the search should be conducted in.
+        *
+        * @param string $in This is the code-line defining the tables/fields to search. Syntax: '[table1].[field1]-[field2]-[field3] : [table2].[field1]-[field2]'
+        * @return array An array where the values is "[table].[field]" strings to search
+        * @see register_tables_and_columns()
+        */
+       public function explodeCols($in) {
+               $theArray = explode(':', $in);
+               $out = array();
+               foreach ($theArray as $val) {
+                       $val = trim($val);
+                       $parts = explode('.', $val);
+                       if ($parts[0] && $parts[1]) {
+                               $subparts = explode('-', $parts[1]);
+                               foreach ($subparts as $piece) {
+                                       $piece = trim($piece);
+                                       if ($piece) {
+                                               $out[] = $parts[0] . '.' . $piece;
+                                       }
+                               }
+                       }
+               }
+               return $out;
+       }
+
+       /**
+        * Takes a search-string (WITHOUT SLASHES or else it'll be a little sppooky , NOW REMEMBER to unslash!!)
+        * Sets up $this->sword_array op with operators.
+        * This function uses $this->operator_translate_table as well as $this->default_operator
+        *
+        * @param string $sword The input search-word string.
+        * @return void
+        */
+       public function register_and_explode_search_string($sword) {
+               $sword = trim($sword);
+               if ($sword) {
+                       $components = $this->split($sword);
+                       // the searchword is stored here during the loop
+                       $s_sword = '';
+                       if (is_array($components)) {
+                               $i = 0;
+                               $lastoper = '';
+                               foreach ($components as $key => $val) {
+                                       $operator = $this->get_operator($val);
+                                       if ($operator) {
+                                               $lastoper = $operator;
+                                       } elseif (strlen($val) > 1) {
+                                               // A searchword MUST be at least two characters long!
+                                               $this->sword_array[$i]['sword'] = $val;
+                                               $this->sword_array[$i]['oper'] = $lastoper ?: $this->default_operator;
+                                               $lastoper = '';
+                                               $i++;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Used to split a search-word line up into elements to search for. This function will detect boolean words like AND and OR, + and -, and even find sentences encapsulated in ""
+        * This function could be re-written to be more clean and effective - yet it's not that important.
+        *
+        * @param string $origSword The raw sword string from outside
+        * @param string $specchars Special chars which are used as operators (+- is default)
+        * @param string $delchars Special chars which are deleted if the append the searchword (+-., is default)
+        * @return mixed Returns an ARRAY if there were search words, otherwise the return value may be unset.
+        */
+       public function split($origSword, $specchars = '+-', $delchars = '+.,-') {
+               $sword = $origSword;
+               $specs = '[' . preg_quote($specchars, '/') . ']';
+               // As long as $sword is TRUE (that means $sword MUST be reduced little by little until its empty inside the loop!)
+               while ($sword) {
+                       // There was a double-quote and we will then look for the ending quote.
+                       if (preg_match('/^"/', $sword)) {
+                               // Removes first double-quote
+                               $sword = preg_replace('/^"/', '', $sword);
+                               // Removes everything till next double-quote
+                               preg_match('/^[^"]*/', $sword, $reg);
+                               // reg[0] is the value, should not be trimmed
+                               $value[] = $reg[0];
+                               $sword = preg_replace('/^' . preg_quote($reg[0], '/') . '/', '', $sword);
+                               // Removes last double-quote
+                               $sword = trim(preg_replace('/^"/', '', $sword));
+                       } elseif (preg_match('/^' . $specs . '/', $sword, $reg)) {
+                               $value[] = $reg[0];
+                               // Removes = sign
+                               $sword = trim(preg_replace('/^' . $specs . '/', '', $sword));
+                       } elseif (preg_match('/[\\+\\-]/', $sword)) {
+                               // Check if $sword contains + or -
+                               // + and - shall only be interpreted as $specchars when there's whitespace before it
+                               // otherwise it's included in the searchword (e.g. "know-how")
+                               // explode $sword to single words
+                               $a_sword = explode(' ', $sword);
+                               // get first word
+                               $word = array_shift($a_sword);
+                               // Delete $delchars at end of string
+                               $word = rtrim($word, $delchars);
+                               // add searchword to values
+                               $value[] = $word;
+                               // re-build $sword
+                               $sword = implode(' ', $a_sword);
+                       } else {
+                               // There are no double-quotes around the value. Looking for next (space) or special char.
+                               preg_match('/^[^ ' . preg_quote($specchars, '/') . ']*/', $sword, $reg);
+                               // Delete $delchars at end of string
+                               $word = rtrim(trim($reg[0]), $delchars);
+                               $value[] = $word;
+                               $sword = trim(preg_replace('/^' . preg_quote($reg[0], '/') . '/', '', $sword));
+                       }
+               }
+               return $value;
+       }
+
+       /**
+        * This creates the search-query.
+        * In TypoScript this is used for searching only records not hidden, start/endtimed and fe_grouped! (enable-fields, see tt_content)
+        * Sets $this->queryParts
+        *
+        * @param string $endClause Some extra conditions that the search must match.
+        * @return bool Returns TRUE no matter what - sweet isn't it!
+        * @access private
+        * @see \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::SEARCHRESULT()
+        */
+       public function build_search_query($endClause) {
+               if (is_array($this->tables)) {
+                       $tables = $this->tables;
+                       $primary_table = '';
+                       // Primary key table is found.
+                       foreach ($tables as $key => $val) {
+                               if ($tables[$key]['primary_key']) {
+                                       $primary_table = $key;
+                               }
+                       }
+                       if ($primary_table) {
+                               // Initialize query parts:
+                               $this->queryParts = array(
+                                       'SELECT' => '',
+                                       'FROM' => '',
+                                       'WHERE' => '',
+                                       'GROUPBY' => '',
+                                       'ORDERBY' => '',
+                                       'LIMIT' => ''
+                               );
+                               // Find tables / field names to select:
+                               $fieldArray = array();
+                               $tableArray = array();
+                               foreach ($tables as $key => $val) {
+                                       $tableArray[] = $key;
+                                       $resultfields = $tables[$key]['resultfields'];
+                                       if (is_array($resultfields)) {
+                                               foreach ($resultfields as $key2 => $val2) {
+                                                       $fieldArray[] = $key . '.' . $val2;
+                                               }
+                                       }
+                               }
+                               $this->queryParts['SELECT'] = implode(',', $fieldArray);
+                               $this->queryParts['FROM'] = implode(',', $tableArray);
+                               // Set join WHERE parts:
+                               $whereArray = array();
+                               $primary_table_and_key = $primary_table . '.' . $tables[$primary_table]['primary_key'];
+                               $primKeys = array();
+                               foreach ($tables as $key => $val) {
+                                       $fkey = $tables[$key]['fkey'];
+                                       if ($fkey) {
+                                               $primKeys[] = $key . '.' . $fkey . '=' . $primary_table_and_key;
+                                       }
+                               }
+                               if (count($primKeys)) {
+                                       $whereArray[] = '(' . implode(' OR ', $primKeys) . ')';
+                               }
+                               // Additional where clause:
+                               if (trim($endClause)) {
+                                       $whereArray[] = trim($endClause);
+                               }
+                               // Add search word where clause:
+                               $query_part = $this->build_search_query_for_searchwords();
+                               if (!$query_part) {
+                                       $query_part = '(0!=0)';
+                               }
+                               $whereArray[] = '(' . $query_part . ')';
+                               // Implode where clauses:
+                               $this->queryParts['WHERE'] = implode(' AND ', $whereArray);
+                               // Group by settings:
+                               if ($this->group_by) {
+                                       if ($this->group_by == 'PRIMARY_KEY') {
+                                               $this->queryParts['GROUPBY'] = $primary_table_and_key;
+                                       } else {
+                                               $this->queryParts['GROUPBY'] = $this->group_by;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Creates the part of the SQL-sentence, that searches for the search-words ($this->sword_array)
+        *
+        * @return string Part of where class limiting result to the those having the search word.
+        * @access private
+        */
+       public function build_search_query_for_searchwords() {
+               if (is_array($this->sword_array)) {
+                       $main_query_part = array();
+                       foreach ($this->sword_array as $key => $val) {
+                               $s_sword = $this->sword_array[$key]['sword'];
+                               // Get subQueryPart
+                               $sub_query_part = array();
+                               $this->listOfSearchFields = '';
+                               foreach ($this->tables as $key3 => $val3) {
+                                       $searchfields = $this->tables[$key3]['searchfields'];
+                                       if (is_array($searchfields)) {
+                                               foreach ($searchfields as $key2 => $val2) {
+                                                       $this->listOfSearchFields .= $key3 . '.' . $val2 . ',';
+                                                       $sub_query_part[] = $key3 . '.' . $val2 . ' LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($s_sword, $key3) . '%\'';
+                                               }
+                                       }
+                               }
+                               if (count($sub_query_part)) {
+                                       $main_query_part[] = $this->sword_array[$key]['oper'];
+                                       $main_query_part[] = '(' . implode(' OR ', $sub_query_part) . ')';
+                               }
+                       }
+                       if (count($main_query_part)) {
+                               // Remove first part anyways.
+                               unset($main_query_part[0]);
+                               return implode(' ', $main_query_part);
+                       }
+               }
+       }
+
+       /**
+        * This returns an SQL search-operator (eg. AND, OR, NOT) translated from the current localized set of operators (eg. in danish OG, ELLER, IKKE).
+        *
+        * @param string $operator The possible operator to find in the internal operator array.
+        * @return string If found, the SQL operator for the localized input operator.
+        * @access private
+        */
+       public function get_operator($operator) {
+               $operator = trim($operator);
+               $op_array = $this->operator_translate_table;
+               if ($this->operator_translate_table_caseinsensitive) {
+                       // case-conversion is charset insensitive, but it doesn't spoil
+                       // anything if input string AND operator table is already converted
+                       $operator = strtolower($operator);
+               }
+               foreach ($op_array as $key => $val) {
+                       $item = $op_array[$key][0];
+                       if ($this->operator_translate_table_caseinsensitive) {
+                               // See note above.
+                               $item = strtolower($item);
+                       }
+                       if ($operator == $item) {
+                               return $op_array[$key][1];
+                       }
+               }
+       }
+
+       /**
+        * Counts the results and sets the result in $this->res_count
+        *
+        * @return bool TRUE, if $this->query was found
+        */
+       public function count_query() {
+               if (is_array($this->queryParts)) {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($this->queryParts['SELECT'], $this->queryParts['FROM'], $this->queryParts['WHERE'], $this->queryParts['GROUPBY']);
+                       $this->res_count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
+                       return TRUE;
+               }
+       }
+
+       /**
+        * Executes the search, sets result pointer in $this->result
+        *
+        * @return bool TRUE, if $this->query was set and query performed
+        */
+       public function execute_query() {
+               if (is_array($this->queryParts)) {
+                       $this->result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($this->queryParts);
+                       return TRUE;
+               }
+       }
+
+       /**
+        * Returns URL-parameters with the current search words.
+        * Used when linking to result pages so that search words can be highlighted.
+        *
+        * @return string URL-parameters with the searchwords
+        */
+       public function get_searchwords() {
+               $SWORD_PARAMS = '';
+               if (is_array($this->sword_array)) {
+                       foreach ($this->sword_array as $key => $val) {
+                               $SWORD_PARAMS .= '&sword_list[]=' . rawurlencode($val['sword']);
+                       }
+               }
+               return $SWORD_PARAMS;
+       }
+
+       /**
+        * Returns an array with the search words in
+        *
+        * @return array IF the internal sword_array contained search words it will return these, otherwise "void
+        */
+       public function get_searchwordsArray() {
+               if (is_array($this->sword_array)) {
+                       foreach ($this->sword_array as $key => $val) {
+                               $swords[] = $val['sword'];
+                       }
+               }
+               return $swords;
+       }
+
+}
index d2bad6a..af900b0 100644 (file)
@@ -1,8 +1,64 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
+/**
+ * CType "search"
+ */
+$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['search'] = 'mimetypes-x-content-form-search';
+$GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['search'] = 'tt_content_search.gif';
+$GLOBALS['TCA']['tt_content']['types']['search'] = array(
+       'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
+                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
+               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
+                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
+               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
+                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
+                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
+               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
+                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.searchform;searchform,
+               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
+);
+
+$GLOBALS['TCA']['tt_content']['palettes']['searchform'] = array(
+       'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.searchform',
+       'canNotCollapse' => 1
+);
+
+// check if there is already a forms tab and add the item after that, otherwise
+// add the tab item as well
+$additionalCTypeItem = array(
+       'LLL:EXT:cms/locallang_ttc.xlf:CType.I.9',
+       'search',
+       'i/tt_content_search.gif'
+);
+
+$existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
+$groupFound = FALSE;
+$groupPosition = FALSE;
+foreach ($existingCTypeItems as $position => $item) {
+       if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
+               $groupFound = TRUE;
+               $groupPosition = $position;
+               break;
+       }
+}
+
+if ($groupFound && $groupPosition) {
+       // add the new CType item below CType
+       array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition+1, 0, array(0 => $additionalCTypeItem));
+} else {
+       // nothing found, add two items (group + new CType) at the bottom of the list
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
+               array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
+}
 
+
+/**
+ * CType "mailform"
+ */
+if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
        $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
        $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
        $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
@@ -30,24 +86,25 @@ if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
                'search',
                'before'
        );
-
-       // set up the fields
-       $GLOBALS['TCA']['tt_content']['types']['mailform'] = array(
-               'showitem' => '
-                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
-                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
-                       bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.mailform_formlabel;;nowrap:wizards[forms],
-               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
-                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
-               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
-                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
-                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
-               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
-                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.mailform;mailform,
-               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
-       );
-       $GLOBALS['TCA']['tt_content']['palettes']['mailform'] = array(
-                       'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.mailform, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader.ALT.mailform_formlabel',
-                       'canNotCollapse' => 1
-       );
 }
+
+
+// set up the fields
+$GLOBALS['TCA']['tt_content']['types']['mailform'] = array(
+       'showitem' => '
+               --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
+               --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
+               bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.mailform_formlabel;;nowrap:wizards[forms],
+       --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
+               --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
+       --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
+               --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
+               --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
+       --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
+               --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.mailform;mailform,
+       --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
+);
+$GLOBALS['TCA']['tt_content']['palettes']['mailform'] = array(
+       'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.mailform, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader.ALT.mailform_formlabel',
+       'canNotCollapse' => 1
+);
diff --git a/typo3/sysext/compatibility6/Configuration/TypoScript/Search/constants.txt b/typo3/sysext/compatibility6/Configuration/TypoScript/Search/constants.txt
new file mode 100644 (file)
index 0000000..ac627f0
--- /dev/null
@@ -0,0 +1,9 @@
+styles.content.searchform {
+    # cat=content/cSearch; type=; label= Message, Searchform: This is the message (if any) that is popped-up when a user performs a search
+  goodMess =
+}
+
+styles.content.searchresult {
+  resultTarget = {$PAGE_TARGET}
+  target = {$PAGE_TARGET}
+}
diff --git a/typo3/sysext/compatibility6/Configuration/TypoScript/Search/setup.txt b/typo3/sysext/compatibility6/Configuration/TypoScript/Search/setup.txt
new file mode 100644 (file)
index 0000000..41db754
--- /dev/null
@@ -0,0 +1,108 @@
+# ******************
+# CType: search
+# ******************
+tt_content.search = COA
+tt_content.search.10 = < lib.stdheader
+# Result:
+tt_content.search.20 = SEARCHRESULT
+tt_content.search.20 {
+       allowedCols = pages.title-subtitle-keywords-description : tt_content.header-bodytext-imagecaption : tt_address.name-title-address-email-company-city-country : tt_links.title-note-note2-url : tt_board.subject-message-author-email : tt_calender.title-note : tt_products.title-note-itemnumber
+       languageField.tt_content = sys_language_uid
+       renderObj = COA
+       renderObj {
+
+               10 = TEXT
+               10.field = pages_title
+               10.htmlSpecialChars = 1
+               10.typolink {
+                       parameter.field = uid
+                       target < lib.parseTarget
+                       target =
+                       target.override = {$styles.content.searchresult.resultTarget}
+                       additionalParams.data = register:SWORD_PARAMS
+                       additionalParams.required = 1
+                       additionalParams.wrap = &no_cache=1
+               }
+               10.htmlSpecialChars = 1
+               10.wrap = <h3 class="csc-searchResultHeader">|</h3>
+
+               20 = COA
+               20 {
+                       10 = TEXT
+                       10.field = tt_content_bodytext
+                       10.stripHtml = 1
+                       10.htmlSpecialChars = 1
+               }
+               20.stdWrap.crop = 200 | ...
+               20.stdWrap.wrap = <p class="csc-searchResult">|</p>
+       }
+
+       layout = COA
+       layout {
+               wrap = <table border="0" cellspacing="0" cellpadding="2" class="csc-searchResultInfo"><tr> | </tr></table> ###RESULT###
+
+               10 = TEXT
+               10.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.resultRange
+               10.wrap = <td class="csc-searchResultRange"><p>|</p></td>
+
+               20 = TEXT
+               20.value = ###PREV###&nbsp;&nbsp;&nbsp;###NEXT###
+               20.wrap = <td class="csc-searchResultPrevNext"><p>|</p></td>
+       }
+
+       noResultObj = COA
+       noResultObj {
+               10 = TEXT
+               10.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.emptySearch
+               10.wrap = <h3 class="csc-noSearchResultMsg">|</h3>
+       }
+
+       next = TEXT
+       next.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchResultNext
+
+       prev = TEXT
+       prev.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchResultPrev
+
+       target < lib.parseTarget
+       target =
+       target.override = {$styles.content.searchresult.target}
+
+       range = 20
+
+       stdWrap.prefixComment = 2 | Search result:
+}
+
+tt_content.search.30 < tt_content.mailform.20
+tt_content.search.30 {
+       goodMess = {$styles.content.searchform.goodMess}
+       redirect >
+       recipient >
+       data >
+       dataArray {
+               10.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchWord
+               10.type = sword=input
+               20.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchIn
+               20.type = scols=select
+               20.valueArray {
+                       10.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.headersKeywords
+                       10.value = pages.title-subtitle-keywords-description:tt_content.header
+                       20.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.pageContent
+                       20.value = tt_content.header-bodytext-imagecaption
+               }
+               30.type = stype=hidden
+               30.value = L0
+               40.type = submit=submit
+               40.value.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchButton
+       }
+       type.field = pages
+       type.listNum = 0
+       locationData = HTTP_POST_VARS
+       no_cache = 1
+
+       stdWrap.wrap = <table border="0" cellspacing="1" cellpadding="1" class="csc-searchform">  | </table>
+       stdWrap {
+               editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.search
+
+               prefixComment = 2 | Search form inserted:
+       }
+}
index f48df32..6ebcc89 100644 (file)
@@ -1274,6 +1274,7 @@ return array(
        'localFolderTree' => \TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView::class,
        'TBE_FolderTree' => \TYPO3\CMS\Recordlist\Tree\View\ElementBrowserFolderTreeView::class,
        'newRecordLocalPageTree' => \TYPO3\CMS\Backend\Tree\View\NewRecordPageTreeView::class,
+       'TYPO3\\CMS\\Frontend\\ContentObject\\SearchResultContentObject' => \TYPO3\CMS\Compatibility6\ContentObject\SearchResultContentObject::class,
        'TYPO3\\CMS\\Frontend\\ContentObject\\ImageTextContentObject' => \TYPO3\CMS\Compatibility6\ContentObject\ImageTextContentObject::class,
        'TYPO3\\CMS\\Frontend\\ContentObject\\ClearGifContentObject' => \TYPO3\CMS\Compatibility6\ContentObject\ClearGifContentObject::class,
        'TYPO3\\CMS\\Frontend\\ContentObject\\ContentTableContentObject' => \TYPO3\CMS\Compatibility6\ContentObject\ContentTableContentObject::class,
index 0b5e47c..23790f8 100644 (file)
@@ -4894,7 +4894,7 @@ class tslib_content_ScalableVectorGraphics extends \TYPO3\CMS\Frontend\ContentOb
 /**
  * @deprecated since 6.0, removed since 7.0
  */
-class tslib_content_SearchResult extends \TYPO3\CMS\Frontend\ContentObject\SearchResultContentObject {}
+class tslib_content_SearchResult extends \TYPO3\CMS\Compatibility6\ContentObject\SearchResultContentObject {}
 
 /**
  * @deprecated since 6.0, removed since 7.0
index e96960c..4aad91e 100644 (file)
@@ -4,13 +4,14 @@ defined('TYPO3_MODE') or die();
 if (TYPO3_MODE === 'FE') {
 
        // Register legacy content objects
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['IMGTEXT']  = \TYPO3\CMS\Compatibility6\ContentObject\ImageTextContentObject::class;
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['CLEARGIF'] = \TYPO3\CMS\Compatibility6\ContentObject\ClearGifContentObject::class;
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['CTABLE']   = \TYPO3\CMS\Compatibility6\ContentObject\ContentTableContentObject::class;
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['OTABLE']   = \TYPO3\CMS\Compatibility6\ContentObject\OffsetTableContentObject::class;
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['COLUMNS']  = \TYPO3\CMS\Compatibility6\ContentObject\ColumnsContentObject::class;
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['HRULER']   = \TYPO3\CMS\Compatibility6\ContentObject\HorizontalRulerContentObject::class;
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['FORM']     = \TYPO3\CMS\Compatibility6\ContentObject\FormContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['IMGTEXT']      = \TYPO3\CMS\Compatibility6\ContentObject\ImageTextContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['CLEARGIF']     = \TYPO3\CMS\Compatibility6\ContentObject\ClearGifContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['CTABLE']       = \TYPO3\CMS\Compatibility6\ContentObject\ContentTableContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['OTABLE']       = \TYPO3\CMS\Compatibility6\ContentObject\OffsetTableContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['COLUMNS']      = \TYPO3\CMS\Compatibility6\ContentObject\ColumnsContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['HRULER']       = \TYPO3\CMS\Compatibility6\ContentObject\HorizontalRulerContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['FORM']         = \TYPO3\CMS\Compatibility6\ContentObject\FormContentObject::class;
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['SEARCHRESULT'] = \TYPO3\CMS\Compatibility6\ContentObject\SearchResultContentObject::class;
 
        // Register a hook for data submission
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission']['mailform'] = \TYPO3\CMS\Compatibility6\Controller\FormDataSubmissionController::class;
@@ -21,36 +22,60 @@ if (TYPO3_MODE === 'FE') {
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'][] = \TYPO3\CMS\Compatibility6\Hooks\TypoScriptFrontendController\ContentPostProcHook::class . '->contentPostProcOutput';
 }
 
-// Add Default TS for CType "mailform" after default content rendering
+/**
+ * CType "mailform"
+ */
+// Add Default TypoScript for CType "mailform" after default content rendering
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'constants', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Form/constants.txt">', 'defaultContentRendering');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'setup',     '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Form/setup.txt">', 'defaultContentRendering');
 
+// Add the search CType to the "New Content Element" wizard
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
-mod.wizards.newContentElement.wizardItems {
-               forms.header = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms
-               forms.elements.mailform {
-                       icon = gfx/c_wiz/mailform.gif
-                       title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_title
-                       description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_description
-                       tt_content_defValues {
-                               CType = mailform
-                               bodytext (
-# Example content:
-Name: | *name = input,40 | Enter your name here
-Email: | *email=input,40 |
-Address: | address=textarea,40,5 |
-Contact me: | tv=check | 1
-
-|formtype_mail = submit | Send form!
-|html_enabled=hidden | 1
-|subject=hidden| This is the subject
-                               )
-                       }
+mod.wizards.newContentElement.wizardItems.forms {
+       elements.mailform {
+               icon = gfx/c_wiz/mailform.gif
+               title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_title
+               description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_description
+               tt_content_defValues {
+                       CType = mailform
+                       bodytext (
+               # Example content:
+               Name: | *name = input,40 | Enter your name here
+               Email: | *email=input,40 |
+               Address: | address=textarea,40,5 |
+               Contact me: | tv=check | 1
+
+               |formtype_mail = submit | Send form!
+               |html_enabled=hidden | 1
+               |subject=hidden| This is the subject
+                       )
                }
-               forms.show := addToList(mailform)
        }
+       show :=addToList(mailform)
 }
 ');
 
 // Add a for previewing tt_content elements of CType="mailform"
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['mailform'] = \TYPO3\CMS\Compatibility6\Hooks\PageLayoutView\MailformPreviewRenderer::class;
+
+
+/**
+ * CType "search"
+ */
+
+// Add Default TypoScript for CType "search" after default content rendering
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'constants', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Search/constants.txt">', 'defaultContentRendering');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('compatibility6', 'setup',     '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility6/Configuration/TypoScript/Search/setup.txt">', 'defaultContentRendering');
+
+// Add the search CType to the "New Content Element" wizard
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
+mod.wizards.newContentElement.wizardItems.forms {
+       elements.search {
+               icon = gfx/c_wiz/searchform.gif
+               title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_search_title
+               description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_search_description
+               tt_content_defValues.CType = search
+       }
+       show :=addToList(search)
+}
+');
index 485bb0d..90e1ee7 100644 (file)
@@ -1417,7 +1417,7 @@ class TemplateService {
         * @param string $typeOverride If you set this value to something else than a blank string, then the typeNumber used in the link will be forced to this value. Normally the typeNum is based on the target set OR on $this->getTypoScriptFrontendController()->config['config']['forceTypeValue'] if found.
         * @param string $targetDomain The target Doamin, if any was detected in typolink
         * @return array Contains keys like "totalURL", "url", "sectionIndex", "linkVars", "no_cache", "type", "target" of which "totalURL" is normally the value you would use while the other keys contains various parts that was used to construct "totalURL
-        * @see \TYPO3\CMS\Frontend\Page\FramesetRenderer::frameParams(), \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::typoLink(), \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::SEARCHRESULT(), \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit(), \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::link()
+        * @see \TYPO3\CMS\Frontend\Page\FramesetRenderer::frameParams(), \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::typoLink(), \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit(), \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::link()
         */
        public function linkData($page, $oTarget, $no_cache, $script, $overrideArray = NULL, $addParams = '', $typeOverride = '', $targetDomain = '') {
                $LD = array();
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-64696-MoveSearchCTypeToLegacyExtension.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-64696-MoveSearchCTypeToLegacyExtension.rst
new file mode 100644 (file)
index 0000000..8ac5656
--- /dev/null
@@ -0,0 +1,27 @@
+=====================================================================
+Breaking: #64696 - Content Element "search" moved to legacy extension
+=====================================================================
+
+Description
+===========
+
+The TYPO3-inhouse "search" functionality, which is based on FORM and SEARCHRESULTS ContentObjects and the content
+element itself (CType=search) has been moved to the legacy extension "compatibility6".
+
+Impact
+======
+
+Content elements of the Type "search" are missing and not rendered in the frontend anymore
+unless the extension compatibility6 is installed. TypoScript using SEARCHRESULTS directly will return nothing.
+
+
+Affected installations
+======================
+
+Any installation using the simple "search" Content Element or the SEARCHRESULTS Content Object directly will break.
+
+Migration
+=========
+
+For TYPO3 CMS 7, installing the compatibility6 extension brings back the existing functionality. For the long term
+the affected installations should be migrate to a better suited solution for searching.
index b8a008c..86a02b9 100644 (file)
@@ -107,16 +107,6 @@ styles.content.loginform {
   templateFile = EXT:felogin/template.html
 }
 
-styles.content.searchform {
-    # cat=content/cSearch; type=; label= Message, Searchform: This is the message (if any) that is popped-up when a user performs a search
-  goodMess =
-}
-
-styles.content.searchresult {
-  resultTarget = {$PAGE_TARGET}
-  target = {$PAGE_TARGET}
-}
-
 styles.content.media {
     # cat=content/cMedia/j1; type=; label= Video Player: configure the path to the video player
   videoPlayer = typo3/contrib/flashmedia/flvplayer.swf
index 5d41dbd..3ba0d83 100644 (file)
@@ -1600,117 +1600,6 @@ tt_content.media {
        }
 }
 
-
-# ******************
-# CType: search
-# ******************
-tt_content.search = COA
-tt_content.search.10 = < lib.stdheader
-# Result:
-tt_content.search.20 = SEARCHRESULT
-tt_content.search.20 {
-       allowedCols = pages.title-subtitle-keywords-description : tt_content.header-bodytext-imagecaption : tt_address.name-title-address-email-company-city-country : tt_links.title-note-note2-url : tt_board.subject-message-author-email : tt_calender.title-note : tt_products.title-note-itemnumber
-       languageField.tt_content = sys_language_uid
-       renderObj = COA
-       renderObj {
-
-               10 = TEXT
-               10.field = pages_title
-               10.htmlSpecialChars = 1
-               10.typolink {
-                       parameter.field = uid
-                       target < lib.parseTarget
-                       target =
-                       target.override = {$styles.content.searchresult.resultTarget}
-                       additionalParams.data = register:SWORD_PARAMS
-                       additionalParams.required = 1
-                       additionalParams.wrap = &no_cache=1
-               }
-               10.htmlSpecialChars = 1
-               10.wrap = <h3 class="csc-searchResultHeader">|</h3>
-
-               20 = COA
-               20 {
-                       10 = TEXT
-                       10.field = tt_content_bodytext
-                       10.stripHtml = 1
-                       10.htmlSpecialChars = 1
-               }
-               20.stdWrap.crop = 200 | ...
-               20.stdWrap.wrap = <p class="csc-searchResult">|</p>
-       }
-
-       layout = COA
-       layout {
-               wrap = <table border="0" cellspacing="0" cellpadding="2" class="csc-searchResultInfo"><tr> | </tr></table> ###RESULT###
-
-               10 = TEXT
-               10.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.resultRange
-               10.wrap = <td class="csc-searchResultRange"><p>|</p></td>
-
-               20 = TEXT
-               20.value = ###PREV###&nbsp;&nbsp;&nbsp;###NEXT###
-               20.wrap = <td class="csc-searchResultPrevNext"><p>|</p></td>
-       }
-
-       noResultObj = COA
-       noResultObj {
-               10 = TEXT
-               10.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.emptySearch
-               10.wrap = <h3 class="csc-noSearchResultMsg">|</h3>
-       }
-
-       next = TEXT
-       next.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchResultNext
-
-       prev = TEXT
-       prev.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchResultPrev
-
-       target < lib.parseTarget
-       target =
-       target.override = {$styles.content.searchresult.target}
-
-       range = 20
-
-       stdWrap.prefixComment = 2 | Search result:
-}
-
-tt_content.search.30 =< tt_content.mailform.20
-tt_content.search.30 {
-       goodMess = {$styles.content.searchform.goodMess}
-       redirect >
-       recipient >
-       data >
-       dataArray {
-               10.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchWord
-               10.type = sword=input
-               20.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchIn
-               20.type = scols=select
-               20.valueArray {
-                       10.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.headersKeywords
-                       10.value = pages.title-subtitle-keywords-description:tt_content.header
-                       20.label.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.pageContent
-                       20.value = tt_content.header-bodytext-imagecaption
-               }
-               30.type = stype=hidden
-               30.value = L0
-               40.type = submit=submit
-               40.value.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:search.searchButton
-       }
-       type.field = pages
-       type.listNum = 0
-       locationData = HTTP_POST_VARS
-       no_cache = 1
-
-       stdWrap.wrap = <table border="0" cellspacing="1" cellpadding="1" class="csc-searchform">  | </table>
-       stdWrap {
-               editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.search
-
-               prefixComment = 2 | Search form inserted:
-       }
-}
-
-
 # ****************
 # CType: menu
 # ****************
index 00c5de3..806285c 100644 (file)
@@ -7,18 +7,38 @@ defined('TYPO3_MODE') or die();
        'login'
 );
 
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
-       'tt_content',
-       'CType',
-       array(
-               'LLL:EXT:cms/locallang_ttc.xlf:CType.I.10',
-               'login',
-               'i/tt_content_login.gif'
-       ),
-       'mailform',
-       'after'
+
+// check if there is already a forms tab and add the item after that, otherwise
+// add the tab item as well
+$additionalCTypeItem = array(
+       'LLL:EXT:cms/locallang_ttc.xlf:CType.I.10',
+       'login',
+       'i/tt_content_login.gif'
 );
 
+$existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
+$groupFound = FALSE;
+$groupPosition = FALSE;
+foreach ($existingCTypeItems as $position => $item) {
+       if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
+               $groupFound = TRUE;
+               $groupPosition = $position;
+               break;
+       }
+}
+
+if ($groupFound && $groupPosition) {
+       // add the new CType item below CType
+       array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition, 0, array(0 => $additionalCTypeItem));
+} else {
+       // nothing found, add two items (group + new CType) at the bottom of the list
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
+               array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
+}
+
+
 $GLOBALS['TCA']['tt_content']['types']['login']['showitem'] =
        '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,'
        . '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,'
index d1d4968..d5f5314 100644 (file)
@@ -24,14 +24,12 @@ tt_content.login {
 if (TYPO3_MODE === 'BE') {
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
        mod.wizards.newContentElement.wizardItems.forms {
-               elements {
-                       login {
-                               icon = gfx/c_wiz/login_form.gif
-                               title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_login_title
-                               description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_login_description
-                               tt_content_defValues {
-                                       CType = login
-                               }
+               elements.login {
+                       icon = gfx/c_wiz/login_form.gif
+                       title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_login_title
+                       description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_login_description
+                       tt_content_defValues {
+                               CType = login
                        }
                }
                show :=addToList(login)
index fda2b67..933d3a3 100644 (file)
@@ -1,20 +1,38 @@
 <?php
 defined('TYPO3_MODE') or die();
 
+// add an CType element "mailform"
+$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
+$GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
 
-// add an CType element if the compatibility6 extension is not taking care of that already
-if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('compatibility6')) {
-       $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
-       $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
+// check if there is already a forms tab and add the item after that, otherwise
+// add the tab item as well
+$additionalCTypeItem = array(
+       'LLL:EXT:cms/locallang_ttc.xlf:CType.I.8',
+       'mailform',
+       'i/tt_content_form.gif'
+);
+
+$existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
+$groupFound = FALSE;
+$groupPosition = FALSE;
+foreach ($existingCTypeItems as $position => $item) {
+       if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
+               $groupFound = TRUE;
+               $groupPosition = $position;
+               break;
+       }
+}
 
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', array(
-                       'LLL:EXT:cms/locallang_ttc.xlf:CType.I.8',
-                       'mailform',
-                       'i/tt_content_form.gif'
-               ),
-               'search',
-               'before'
+if ($groupFound && $groupPosition) {
+       // add the new CType item below CType
+       array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition+1, 0, array(0 => $additionalCTypeItem));
+} else {
+       // nothing found, add two items (group + new CType) at the bottom of the list
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
+               array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
        );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
 }
 
 $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
index b9edd07..7045505 100644 (file)
@@ -1,8 +1,7 @@
-# Cancel the check that prevents display of subheader for old mailform
-tt_content.mailform.10.20.if.isFalse.override = 0
-
 # Replace rendering of old mailform
-tt_content.mailform.20 >
+tt_content.mailform >
+tt_content.mailform = COA
+tt_content.mailform.10 = < lib.stdheader
 tt_content.mailform.20 = FORM
 tt_content.mailform.20 {
        stdWrap.wrap = <div class="csc-mailform"> | </div>
@@ -14,52 +13,6 @@ tt_content.mailform.20 {
        }
 }
 
-#tt_content.login.20 >
-#tt_content.login.20 = FORM
-#tt_content.login.20 {
-#      prefix = login
-#      method = post
-#      10 = FIELDSET
-#      10 {
-#              legend = TEXT
-#              legend {
-#                      data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.username
-#              }
-#              10 = TEXTLINE
-#              10 {
-#                      name = user
-#                      id = mailformuser
-#                      size = 20
-#                      label = TEXT
-#                      label {
-#                              data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.username
-#                      }
-#              }
-#              20 = PASSWORD
-#              20 {
-#                      name = pass
-#                      id = mailformpass
-#                      size = 20
-#                      label = TEXT
-#                      label {
-#                              data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.password
-#                      }
-#              }
-#      }
-#      30 = HIDDEN
-#      30 {
-#              name = logintype
-#              id = mailformlogintype
-#      }
-#      20 = SUBMIT
-#      20 {
-#              name = submit
-#              id = mailformsubmit
-#              value = login
-#      }
-#}
-
-
 plugin.tx_form._CSS_DEFAULT_STYLE (
        div.csc-mailform ol,
        div.csc-mailform ol li {
index 1e3eeaa..e41edf0 100644 (file)
@@ -5,3 +5,17 @@ defined('TYPO3_MODE') or die();
 
 // Add a for previewing tt_content elements of CType="mailform"
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['mailform'] = \TYPO3\CMS\Form\Hooks\PageLayoutView\MailformPreviewRenderer::class;
+
+
+// Add the form CType to the "New Content Element" wizard
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
+       mod.wizards.newContentElement.wizardItems.forms {
+               elements.mailform {
+                       icon = gfx/c_wiz/mailform.gif
+                       title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_title
+                       description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms_mail_description
+                       tt_content_defValues.CType = mailform
+               }
+               show :=addToList(mailform)
+       }
+');
diff --git a/typo3/sysext/frontend/Classes/ContentObject/SearchResultContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/SearchResultContentObject.php
deleted file mode 100644 (file)
index 6995cd6..0000000
+++ /dev/null
@@ -1,648 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\ContentObject;
-
-/*
- * 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!
- */
-
-/**
- * Search class used for the content object SEARCHRESULT
- * and searching in database tables, typ. "pages" and "tt_content"
- * Used to generate search queries for TypoScript.
- * The class is included from "TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer"
- * based on whether there has been detected content in the GPvar "sword"
- */
-class SearchResultContentObject extends AbstractContentObject {
-
-       /**
-        * @var array
-        */
-       public $tables = array();
-
-       /**
-        * Alternatively 'PRIMARY_KEY'; sorting by primary key
-        *
-        * @var string
-        */
-       public $group_by = 'PRIMARY_KEY';
-
-       /**
-        * Standard SQL-operator between words
-        *
-        * @var string
-        */
-       public $default_operator = 'AND';
-
-       /**
-        * @var bool
-        */
-       public $operator_translate_table_caseinsensitive = TRUE;
-
-       /**
-        * case-sensitive. Defines the words, which will be operators between words
-        *
-        * @var array
-        */
-       public $operator_translate_table = array(
-               array('+', 'AND'),
-               array('|', 'AND'),
-               array('-', 'AND NOT'),
-               // english
-               array('and', 'AND'),
-               array('or', 'OR'),
-               array('not', 'AND NOT')
-       );
-
-       /**
-        * Contains the search-words and operators
-        *
-        * @var array
-        */
-       public $sword_array;
-
-       /**
-        * Contains the query parts after processing.
-        *
-        * @var array
-        */
-       public $queryParts;
-
-       /**
-        * This is set with the foreign table that 'pages' are connected to.
-        *
-        * @var string
-        */
-       public $fTable;
-
-       /**
-        * How many rows to offset from the beginning
-        *
-        * @var int
-        */
-       public $res_offset = 0;
-
-       /**
-        * How many results to show (0 = no limit)
-        *
-        * @var int
-        */
-       public $res_shows = 20;
-
-       /**
-        * Intern: How many results, there was last time (with the exact same searchstring.
-        *
-        * @var int
-        */
-       public $res_count;
-
-       /**
-        * List of pageIds.
-        *
-        * @var string
-        */
-       public $pageIdList = '';
-
-       /**
-        * @var string
-        */
-       public $listOfSearchFields = '';
-
-       /**
-        * Override default constructor to make it possible to instantiate this
-        * class for indexed_search
-        *
-        * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj
-        */
-       public function __construct(ContentObjectRenderer $cObj = NULL) {
-               if (!is_null($cObj)) {
-                       $this->cObj = $cObj;
-                       $this->fileFactory = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance();
-               }
-       }
-
-       /**
-        * Rendering the cObject, SEARCHRESULT
-        *
-        * @param array $conf Array of TypoScript properties
-        * @return string Output
-        */
-       public function render($conf = array()) {
-               if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sword') && \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scols')) {
-                       $this->register_and_explode_search_string(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sword'));
-                       $this->register_tables_and_columns(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scols'), $conf['allowedCols']);
-                       // Depth
-                       $depth = 100;
-                       // The startId is found
-                       $theStartId = 0;
-                       if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype'))) {
-                               $temp_theStartId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype');
-                               $rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($temp_theStartId);
-                               // The page MUST have a rootline with the Level0-page of the current site inside!!
-                               foreach ($rootLine as $val) {
-                                       if ($val['uid'] == $GLOBALS['TSFE']->tmpl->rootLine[0]['uid']) {
-                                               $theStartId = $temp_theStartId;
-                                       }
-                               }
-                       } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype')) {
-                               if (substr(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype'), 0, 1) == 'L') {
-                                       $pointer = (int)substr(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype'), 1);
-                                       $theRootLine = $GLOBALS['TSFE']->tmpl->rootLine;
-                                       // location Data:
-                                       $locDat_arr = explode(':', \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('locationData'));
-                                       $pId = (int)$locDat_arr[0];
-                                       if ($pId) {
-                                               $altRootLine = $GLOBALS['TSFE']->sys_page->getRootLine($pId);
-                                               ksort($altRootLine);
-                                               if (count($altRootLine)) {
-                                                       // Check if the rootline has the real Level0 in it!!
-                                                       $hitRoot = 0;
-                                                       $theNewRoot = array();
-                                                       foreach ($altRootLine as $val) {
-                                                               if ($hitRoot || $val['uid'] == $GLOBALS['TSFE']->tmpl->rootLine[0]['uid']) {
-                                                                       $hitRoot = 1;
-                                                                       $theNewRoot[] = $val;
-                                                               }
-                                                       }
-                                                       if ($hitRoot) {
-                                                               // Override the real rootline if any thing
-                                                               $theRootLine = $theNewRoot;
-                                                       }
-                                               }
-                                       }
-                                       $key = $this->cObj->getKey($pointer, $theRootLine);
-                                       $theStartId = $theRootLine[$key]['uid'];
-                               }
-                       }
-                       if (!$theStartId) {
-                               // If not set, we use current page
-                               $theStartId = $GLOBALS['TSFE']->id;
-                       }
-                       // Generate page-tree
-                       $this->pageIdList .= $this->cObj->getTreeList(-1 * $theStartId, $depth);
-                       $endClause = 'pages.uid IN (' . $this->pageIdList . ')
-                               AND pages.doktype in (' . $GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'] . ($conf['addExtUrlsAndShortCuts'] ? ',3,4' : '') . ')
-                               AND pages.no_search=0' . $this->cObj->enableFields($this->fTable) . $this->cObj->enableFields('pages');
-                       if ($conf['languageField.'][$this->fTable]) {
-                               // (using sys_language_uid which is the ACTUAL language of the page.
-                               // sys_language_content is only for selecting DISPLAY content!)
-                               $endClause .= ' AND ' . $this->fTable . '.' . $conf['languageField.'][$this->fTable] . ' = ' . (int)$GLOBALS['TSFE']->sys_language_uid;
-                       }
-                       // Build query
-                       $this->build_search_query($endClause);
-                       // Count...
-                       if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scount'))) {
-                               $this->res_count = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scount');
-                       } else {
-                               $this->count_query();
-                       }
-                       // Range
-                       $spointer = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('spointer');
-                       $range = isset($conf['range.']) ? $this->cObj->stdWrap($conf['range'], $conf['range.']) : $conf['range'];
-                       if ($range) {
-                               $theRange = (int)$range;
-                       } else {
-                               $theRange = 20;
-                       }
-                       // Order By:
-                       $noOrderBy = isset($conf['noOrderBy.']) ? $this->cObj->stdWrap($conf['noOrderBy'], $conf['noOrderBy.']) : $conf['noOrderBy'];
-                       if (!$noOrderBy) {
-                               $this->queryParts['ORDERBY'] = 'pages.lastUpdated, pages.tstamp';
-                       }
-                       $this->queryParts['LIMIT'] = $spointer . ',' . $theRange;
-                       // Search...
-                       $this->execute_query();
-                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($this->result)) {
-                               $GLOBALS['TSFE']->register['SWORD_PARAMS'] = $this->get_searchwords();
-                               $total = $this->res_count;
-                               $rangeLow = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($spointer + 1, 1, $total);
-                               $rangeHigh = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($spointer + $theRange, 1, $total);
-                               // prev/next url:
-                               $target = isset($conf['target.']) ? $this->cObj->stdWrap($conf['target'], $conf['target.']) : $conf['target'];
-                               $LD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page, $target, 1, '', '', $this->cObj->getClosestMPvalueForPage($GLOBALS['TSFE']->page['uid']));
-                               $targetPart = $LD['target'] ? ' target="' . htmlspecialchars($LD['target']) . '"' : '';
-                               $urlParams = $this->cObj->URLqMark($LD['totalURL'], '&sword=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sword')) . '&scols=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('scols')) . '&stype=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('stype')) . '&scount=' . $total);
-                               // substitution:
-                               $result = str_replace(
-                                       array(
-                                               '###RANGELOW###',
-                                               '###RANGEHIGH###',
-                                               '###TOTAL###'
-                                       ),
-                                       array(
-                                               $rangeLow,
-                                               $rangeHigh,
-                                               $total
-                                       ),
-                                       $this->cObj->cObjGetSingle($conf['layout'], $conf['layout.'], 'layout')
-                               );
-                               if ($rangeHigh < $total) {
-                                       $next = $this->cObj->cObjGetSingle($conf['next'], $conf['next.'], 'next');
-                                       $next = '<a href="' . htmlspecialchars(($urlParams . '&spointer=' . ($spointer + $theRange))) . '"' . $targetPart . $GLOBALS['TSFE']->ATagParams . '>' . $next . '</a>';
-                               } else {
-                                       $next = '';
-                               }
-                               $result = str_replace('###NEXT###', $next, $result);
-                               if ($rangeLow > 1) {
-                                       $prev = $this->cObj->cObjGetSingle($conf['prev'], $conf['prev.'], 'prev');
-                                       $prev = '<a href="' . htmlspecialchars(($urlParams . '&spointer=' . ($spointer - $theRange))) . '"' . $targetPart . $GLOBALS['TSFE']->ATagParams . '>' . $prev . '</a>';
-                               } else {
-                                       $prev = '';
-                               }
-                               $result = str_replace('###PREV###', $prev, $result);
-                               // Searching result
-                               $theValue = $this->cObj->cObjGetSingle($conf['resultObj'], $conf['resultObj.'], 'resultObj');
-                               /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj */
-                               $cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
-                               $cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
-                               $renderCode = '';
-                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($this->result)) {
-                                       // versionOL() here? This is search result displays, is that possible to preview anyway?
-                                       // Or are records selected here already future versions?
-                                       $cObj->start($row);
-                                       $renderCode .= $cObj->cObjGetSingle($conf['renderObj'], $conf['renderObj.'], 'renderObj');
-                               }
-                               $renderWrap = isset($conf['renderWrap.']) ? $this->cObj->stdWrap($conf['renderWrap'], $conf['renderWrap.']) : $conf['renderWrap'];
-                               $theValue .= $this->cObj->wrap($renderCode, $renderWrap);
-                               $theValue = str_replace('###RESULT###', $theValue, $result);
-                       } else {
-                               $theValue = $this->cObj->cObjGetSingle($conf['noResultObj'], $conf['noResultObj.'], 'noResultObj');
-                       }
-                       $GLOBALS['TT']->setTSlogMessage('Search in fields:   ' . $this->listOfSearchFields);
-                       // Wrapping
-                       $content = $theValue;
-                       $wrap = isset($conf['wrap.']) ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];
-                       if ($wrap) {
-                               $content = $this->cObj->wrap($content, $wrap);
-                       }
-                       if (isset($conf['stdWrap.'])) {
-                               $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-                       }
-                       // Returning, do not cache the result of the search
-                       $GLOBALS['TSFE']->set_no_cache('Search result page');
-                       return $content;
-               }
-               return '';
-       }
-
-       /**
-        * Creates the $this->tables-array.
-        * The 'pages'-table is ALWAYS included as the search is page-based. Apart from this there may be one and only one table, joined with the pages-table. This table is the first table mentioned in the requested-list. If any more tables are set here, they are ignored.
-        *
-        * @param string $requestedCols is a list (-) of columns that we want to search. This could be input from the search-form (see TypoScript documentation)
-        * @param string $allowedCols $allowedCols: is the list of columns, that MAY be searched. All allowed cols are set as result-fields. All requested cols MUST be in the allowed-fields list.
-        * @return void
-        */
-       public function register_tables_and_columns($requestedCols, $allowedCols) {
-               $rCols = $this->explodeCols($requestedCols);
-               $aCols = $this->explodeCols($allowedCols);
-               foreach ($rCols as $k => $v) {
-                       $rCols[$k] = trim($v);
-                       if (in_array($rCols[$k], $aCols)) {
-                               $parts = explode('.', $rCols[$k]);
-                               $this->tables[$parts[0]]['searchfields'][] = $parts[1];
-                       }
-               }
-               $this->tables['pages']['primary_key'] = 'uid';
-               $this->tables['pages']['resultfields'][] = 'uid';
-               unset($this->tables['pages']['fkey']);
-               foreach ($aCols as $k => $v) {
-                       $aCols[$k] = trim($v);
-                       $parts = explode('.', $aCols[$k]);
-                       $this->tables[$parts[0]]['resultfields'][] = $parts[1] . ' AS ' . str_replace('.', '_', $aCols[$k]);
-                       $this->tables[$parts[0]]['fkey'] = 'pid';
-               }
-               $this->fTable = '';
-               foreach ($this->tables as $t => $v) {
-                       if ($t != 'pages') {
-                               if (!$this->fTable) {
-                                       $this->fTable = $t;
-                               } else {
-                                       unset($this->tables[$t]);
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Function that can convert the syntax for entering which tables/fields the search should be conducted in.
-        *
-        * @param string $in This is the code-line defining the tables/fields to search. Syntax: '[table1].[field1]-[field2]-[field3] : [table2].[field1]-[field2]'
-        * @return array An array where the values is "[table].[field]" strings to search
-        * @see register_tables_and_columns()
-        */
-       public function explodeCols($in) {
-               $theArray = explode(':', $in);
-               $out = array();
-               foreach ($theArray as $val) {
-                       $val = trim($val);
-                       $parts = explode('.', $val);
-                       if ($parts[0] && $parts[1]) {
-                               $subparts = explode('-', $parts[1]);
-                               foreach ($subparts as $piece) {
-                                       $piece = trim($piece);
-                                       if ($piece) {
-                                               $out[] = $parts[0] . '.' . $piece;
-                                       }
-                               }
-                       }
-               }
-               return $out;
-       }
-
-       /**
-        * Takes a search-string (WITHOUT SLASHES or else it'll be a little sppooky , NOW REMEMBER to unslash!!)
-        * Sets up $this->sword_array op with operators.
-        * This function uses $this->operator_translate_table as well as $this->default_operator
-        *
-        * @param string $sword The input search-word string.
-        * @return void
-        */
-       public function register_and_explode_search_string($sword) {
-               $sword = trim($sword);
-               if ($sword) {
-                       $components = $this->split($sword);
-                       // the searchword is stored here during the loop
-                       $s_sword = '';
-                       if (is_array($components)) {
-                               $i = 0;
-                               $lastoper = '';
-                               foreach ($components as $key => $val) {
-                                       $operator = $this->get_operator($val);
-                                       if ($operator) {
-                                               $lastoper = $operator;
-                                       } elseif (strlen($val) > 1) {
-                                               // A searchword MUST be at least two characters long!
-                                               $this->sword_array[$i]['sword'] = $val;
-                                               $this->sword_array[$i]['oper'] = $lastoper ?: $this->default_operator;
-                                               $lastoper = '';
-                                               $i++;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Used to split a search-word line up into elements to search for. This function will detect boolean words like AND and OR, + and -, and even find sentences encapsulated in ""
-        * This function could be re-written to be more clean and effective - yet it's not that important.
-        *
-        * @param string $origSword The raw sword string from outside
-        * @param string $specchars Special chars which are used as operators (+- is default)
-        * @param string $delchars Special chars which are deleted if the append the searchword (+-., is default)
-        * @return mixed Returns an ARRAY if there were search words, otherwise the return value may be unset.
-        */
-       public function split($origSword, $specchars = '+-', $delchars = '+.,-') {
-               $sword = $origSword;
-               $specs = '[' . preg_quote($specchars, '/') . ']';
-               // As long as $sword is TRUE (that means $sword MUST be reduced little by little until its empty inside the loop!)
-               while ($sword) {
-                       // There was a double-quote and we will then look for the ending quote.
-                       if (preg_match('/^"/', $sword)) {
-                               // Removes first double-quote
-                               $sword = preg_replace('/^"/', '', $sword);
-                               // Removes everything till next double-quote
-                               preg_match('/^[^"]*/', $sword, $reg);
-                               // reg[0] is the value, should not be trimmed
-                               $value[] = $reg[0];
-                               $sword = preg_replace('/^' . preg_quote($reg[0], '/') . '/', '', $sword);
-                               // Removes last double-quote
-                               $sword = trim(preg_replace('/^"/', '', $sword));
-                       } elseif (preg_match('/^' . $specs . '/', $sword, $reg)) {
-                               $value[] = $reg[0];
-                               // Removes = sign
-                               $sword = trim(preg_replace('/^' . $specs . '/', '', $sword));
-                       } elseif (preg_match('/[\\+\\-]/', $sword)) {
-                               // Check if $sword contains + or -
-                               // + and - shall only be interpreted as $specchars when there's whitespace before it
-                               // otherwise it's included in the searchword (e.g. "know-how")
-                               // explode $sword to single words
-                               $a_sword = explode(' ', $sword);
-                               // get first word
-                               $word = array_shift($a_sword);
-                               // Delete $delchars at end of string
-                               $word = rtrim($word, $delchars);
-                               // add searchword to values
-                               $value[] = $word;
-                               // re-build $sword
-                               $sword = implode(' ', $a_sword);
-                       } else {
-                               // There are no double-quotes around the value. Looking for next (space) or special char.
-                               preg_match('/^[^ ' . preg_quote($specchars, '/') . ']*/', $sword, $reg);
-                               // Delete $delchars at end of string
-                               $word = rtrim(trim($reg[0]), $delchars);
-                               $value[] = $word;
-                               $sword = trim(preg_replace('/^' . preg_quote($reg[0], '/') . '/', '', $sword));
-                       }
-               }
-               return $value;
-       }
-
-       /**
-        * This creates the search-query.
-        * In TypoScript this is used for searching only records not hidden, start/endtimed and fe_grouped! (enable-fields, see tt_content)
-        * Sets $this->queryParts
-        *
-        * @param string $endClause Some extra conditions that the search must match.
-        * @return bool Returns TRUE no matter what - sweet isn't it!
-        * @access private
-        * @see \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::SEARCHRESULT()
-        */
-       public function build_search_query($endClause) {
-               if (is_array($this->tables)) {
-                       $tables = $this->tables;
-                       $primary_table = '';
-                       // Primary key table is found.
-                       foreach ($tables as $key => $val) {
-                               if ($tables[$key]['primary_key']) {
-                                       $primary_table = $key;
-                               }
-                       }
-                       if ($primary_table) {
-                               // Initialize query parts:
-                               $this->queryParts = array(
-                                       'SELECT' => '',
-                                       'FROM' => '',
-                                       'WHERE' => '',
-                                       'GROUPBY' => '',
-                                       'ORDERBY' => '',
-                                       'LIMIT' => ''
-                               );
-                               // Find tables / field names to select:
-                               $fieldArray = array();
-                               $tableArray = array();
-                               foreach ($tables as $key => $val) {
-                                       $tableArray[] = $key;
-                                       $resultfields = $tables[$key]['resultfields'];
-                                       if (is_array($resultfields)) {
-                                               foreach ($resultfields as $key2 => $val2) {
-                                                       $fieldArray[] = $key . '.' . $val2;
-                                               }
-                                       }
-                               }
-                               $this->queryParts['SELECT'] = implode(',', $fieldArray);
-                               $this->queryParts['FROM'] = implode(',', $tableArray);
-                               // Set join WHERE parts:
-                               $whereArray = array();
-                               $primary_table_and_key = $primary_table . '.' . $tables[$primary_table]['primary_key'];
-                               $primKeys = array();
-                               foreach ($tables as $key => $val) {
-                                       $fkey = $tables[$key]['fkey'];
-                                       if ($fkey) {
-                                               $primKeys[] = $key . '.' . $fkey . '=' . $primary_table_and_key;
-                                       }
-                               }
-                               if (count($primKeys)) {
-                                       $whereArray[] = '(' . implode(' OR ', $primKeys) . ')';
-                               }
-                               // Additional where clause:
-                               if (trim($endClause)) {
-                                       $whereArray[] = trim($endClause);
-                               }
-                               // Add search word where clause:
-                               $query_part = $this->build_search_query_for_searchwords();
-                               if (!$query_part) {
-                                       $query_part = '(0!=0)';
-                               }
-                               $whereArray[] = '(' . $query_part . ')';
-                               // Implode where clauses:
-                               $this->queryParts['WHERE'] = implode(' AND ', $whereArray);
-                               // Group by settings:
-                               if ($this->group_by) {
-                                       if ($this->group_by == 'PRIMARY_KEY') {
-                                               $this->queryParts['GROUPBY'] = $primary_table_and_key;
-                                       } else {
-                                               $this->queryParts['GROUPBY'] = $this->group_by;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Creates the part of the SQL-sentence, that searches for the search-words ($this->sword_array)
-        *
-        * @return string Part of where class limiting result to the those having the search word.
-        * @access private
-        */
-       public function build_search_query_for_searchwords() {
-               if (is_array($this->sword_array)) {
-                       $main_query_part = array();
-                       foreach ($this->sword_array as $key => $val) {
-                               $s_sword = $this->sword_array[$key]['sword'];
-                               // Get subQueryPart
-                               $sub_query_part = array();
-                               $this->listOfSearchFields = '';
-                               foreach ($this->tables as $key3 => $val3) {
-                                       $searchfields = $this->tables[$key3]['searchfields'];
-                                       if (is_array($searchfields)) {
-                                               foreach ($searchfields as $key2 => $val2) {
-                                                       $this->listOfSearchFields .= $key3 . '.' . $val2 . ',';
-                                                       $sub_query_part[] = $key3 . '.' . $val2 . ' LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($s_sword, $key3) . '%\'';
-                                               }
-                                       }
-                               }
-                               if (count($sub_query_part)) {
-                                       $main_query_part[] = $this->sword_array[$key]['oper'];
-                                       $main_query_part[] = '(' . implode(' OR ', $sub_query_part) . ')';
-                               }
-                       }
-                       if (count($main_query_part)) {
-                               // Remove first part anyways.
-                               unset($main_query_part[0]);
-                               return implode(' ', $main_query_part);
-                       }
-               }
-       }
-
-       /**
-        * This returns an SQL search-operator (eg. AND, OR, NOT) translated from the current localized set of operators (eg. in danish OG, ELLER, IKKE).
-        *
-        * @param string $operator The possible operator to find in the internal operator array.
-        * @return string If found, the SQL operator for the localized input operator.
-        * @access private
-        */
-       public function get_operator($operator) {
-               $operator = trim($operator);
-               $op_array = $this->operator_translate_table;
-               if ($this->operator_translate_table_caseinsensitive) {
-                       // case-conversion is charset insensitive, but it doesn't spoil
-                       // anything if input string AND operator table is already converted
-                       $operator = strtolower($operator);
-               }
-               foreach ($op_array as $key => $val) {
-                       $item = $op_array[$key][0];
-                       if ($this->operator_translate_table_caseinsensitive) {
-                               // See note above.
-                               $item = strtolower($item);
-                       }
-                       if ($operator == $item) {
-                               return $op_array[$key][1];
-                       }
-               }
-       }
-
-       /**
-        * Counts the results and sets the result in $this->res_count
-        *
-        * @return bool TRUE, if $this->query was found
-        */
-       public function count_query() {
-               if (is_array($this->queryParts)) {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($this->queryParts['SELECT'], $this->queryParts['FROM'], $this->queryParts['WHERE'], $this->queryParts['GROUPBY']);
-                       $this->res_count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
-                       return TRUE;
-               }
-       }
-
-       /**
-        * Executes the search, sets result pointer in $this->result
-        *
-        * @return bool TRUE, if $this->query was set and query performed
-        */
-       public function execute_query() {
-               if (is_array($this->queryParts)) {
-                       $this->result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($this->queryParts);
-                       return TRUE;
-               }
-       }
-
-       /**
-        * Returns URL-parameters with the current search words.
-        * Used when linking to result pages so that search words can be highlighted.
-        *
-        * @return string URL-parameters with the searchwords
-        */
-       public function get_searchwords() {
-               $SWORD_PARAMS = '';
-               if (is_array($this->sword_array)) {
-                       foreach ($this->sword_array as $key => $val) {
-                               $SWORD_PARAMS .= '&sword_list[]=' . rawurlencode($val['sword']);
-                       }
-               }
-               return $SWORD_PARAMS;
-       }
-
-       /**
-        * Returns an array with the search words in
-        *
-        * @return array IF the internal sword_array contained search words it will return these, otherwise "void
-        */
-       public function get_searchwordsArray() {
-               if (is_array($this->sword_array)) {
-                       foreach ($this->sword_array as $key => $val) {
-                               $swords[] = $val['sword'];
-                       }
-               }
-               return $swords;
-       }
-
-}
index 0a3344d..eeea132 100644 (file)
@@ -39,7 +39,6 @@ return array(
                        'media' => 'mimetypes-x-content-multimedia',
                        'menu' => 'mimetypes-x-content-menu',
                        'list' => 'mimetypes-x-content-plugin',
-                       'search' => 'mimetypes-x-content-form-search',
                        'login' => 'mimetypes-x-content-login',
                        'shortcut' => 'mimetypes-x-content-link',
                        'script' => 'mimetypes-x-content-script',
@@ -59,7 +58,6 @@ return array(
                        'media' => 'tt_content_mm.gif',
                        'menu' => 'tt_content_menu.gif',
                        'list' => 'tt_content_list.gif',
-                       'search' => 'tt_content_search.gif',
                        'login' => 'tt_content_login.gif',
                        'shortcut' => 'tt_content_shortcut.gif',
                        'script' => 'tt_content_script.gif',
@@ -124,15 +122,6 @@ return array(
                                                'i/tt_content_uploads.gif'
                                        ),
                                        array(
-                                               'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms',
-                                               '--div--'
-                                       ),
-                                       array(
-                                               'LLL:EXT:cms/locallang_ttc.xlf:CType.I.9',
-                                               'search',
-                                               'i/tt_content_search.gif'
-                                       ),
-                                       array(
                                                'LLL:EXT:cms/locallang_ttc.xlf:CType.div.special',
                                                '--div--'
                                        ),
@@ -1734,18 +1723,6 @@ return array(
                                'categorized_content' => 'selected_categories;;menu, category_field;;menu',
                        )
                ),
-               'search' => array(
-                       'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.searchform;searchform,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
-               ),
                'shortcut' => array(
                        'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
                                        header;LLL:EXT:cms/locallang_ttc.xlf:header.ALT.shortcut_formlabel,
@@ -1888,10 +1865,6 @@ return array(
                        'showitem' => 'media;LLL:EXT:cms/locallang_ttc.xlf:media.ALT.uploads_formlabel, --linebreak--, file_collections;LLL:EXT:cms/locallang_ttc.xlf:file_collections.ALT.uploads_formlabel, --linebreak--, filelink_sorting, target',
                        'canNotCollapse' => 1
                ),
-               'searchform' => array(
-                       'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.searchform',
-                       'canNotCollapse' => 1
-               ),
                'menu' => array(
                        'showitem' => 'menu_type;LLL:EXT:cms/locallang_ttc.xlf:menu_type_formlabel, --linebreak--, pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.menu_formlabel',
                        'canNotCollapse' => 1
index 63c0d00..2edade8 100644 (file)
@@ -72,7 +72,6 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                'CASEFUNC'         => \TYPO3\CMS\Frontend\ContentObject\CaseContentObject::class,
                'LOAD_REGISTER'    => \TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject::class,
                'RESTORE_REGISTER' => \TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject::class,
-               'SEARCHRESULT'     => \TYPO3\CMS\Frontend\ContentObject\SearchResultContentObject::class,
                'TEMPLATE'         => \TYPO3\CMS\Frontend\ContentObject\TemplateContentObject::class,
                'FLUIDTEMPLATE'    => \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
                'MULTIMEDIA'       => \TYPO3\CMS\Frontend\ContentObject\MultimediaContentObject::class,
index b90e054..33e1487 100644 (file)
@@ -46,7 +46,6 @@ if (TYPO3_MODE === 'FE') {
                'CASEFUNC'         => \TYPO3\CMS\Frontend\ContentObject\CaseContentObject::class,
                'LOAD_REGISTER'    => \TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject::class,
                'RESTORE_REGISTER' => \TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject::class,
-               'SEARCHRESULT'     => \TYPO3\CMS\Frontend\ContentObject\SearchResultContentObject::class,
                'TEMPLATE'         => \TYPO3\CMS\Frontend\ContentObject\TemplateContentObject::class,
                'FLUIDTEMPLATE'    => \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
                'MULTIMEDIA'       => \TYPO3\CMS\Frontend\ContentObject\MultimediaContentObject::class,