From b4f3aee1ff016f36b7c23fdf314fedb55ce11352 Mon Sep 17 00:00:00 2001 From: Wouter Wolters <typo3@wouterwolters.nl> Date: Tue, 14 Feb 2017 22:44:32 +0100 Subject: [PATCH] [TASK] Provide update wizard for ext:compatibility7 Remove the extension at the same time. Resolves: #79734 Releases: master Change-Id: I457f29b64596a91e612b0f99a020aea46f4a2425 Reviewed-on: https://review.typo3.org/51690 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> --- Build/tsconfig.json | 8 +- composer.json | 1 - composer.lock | 2 +- .../Classes/Template/ModuleTemplate.php | 5 +- .../Classes/ContextMenu/ItemProvider.php | 111 - .../Controller/SearchFormController.php | 2681 ----------------- .../Controller/VersionModuleController.php | 635 ---- .../Classes/Hooks/BackendLoginLinkHook.php | 51 - .../Classes/Hooks/EnforceUrlSchemeHook.php | 89 - .../Classes/Hooks/PageLayoutActionHook.php | 682 ----- .../Classes/Hooks/TcaSoftExcludeHook.php | 49 - .../Classes/Report/Status/SystemStatus.php | 96 - .../Classes/Utility/MonitorUtility.php | 56 - .../Classes/View/VersionView.php | 119 - .../Menu/AbstractMenuViewHelper.php | 115 - .../ViewHelpers/Menu/CategoriesViewHelper.php | 111 - .../ViewHelpers/Menu/DirectoryViewHelper.php | 119 - .../ViewHelpers/Menu/KeywordsViewHelper.php | 157 - .../ViewHelpers/Menu/ListViewHelper.php | 123 - .../ViewHelpers/Menu/MenuViewHelperTrait.php | 125 - .../ViewHelpers/Menu/SectionViewHelper.php | 141 - .../ViewHelpers/Menu/UpdatedViewHelper.php | 117 - .../Configuration/Backend/Routes.php | 12 - .../Mod/Wizards/NewContentElementMenu.txt | 17 - .../Configuration/TCA/Overrides/pages.php | 33 - .../TCA/Overrides/sys_template.php | 17 - .../TCA/Overrides/tt_content.php | 29 - .../TCA/Overrides/tt_content_element_menu.php | 119 - .../ContentElement/CssStyledContent/setup.txt | 272 -- .../FluidStyledContent/setup.txt | 47 - .../Migrations/Code/ClassAliasMap.php | 8 - .../class.tx_indexed_search_pi_wizicon.php | 36 - .../Partials/Menu/Directory.html | 23 - .../Partials/Menu/Type-0.html | 22 - .../Partials/Menu/Type-1.html | 22 - .../Partials/Menu/Type-2.html | 23 - .../Partials/Menu/Type-3.html | 21 - .../Partials/Menu/Type-4.html | 46 - .../Partials/Menu/Type-5.html | 22 - .../Partials/Menu/Type-6.html | 22 - .../Partials/Menu/Type-7.html | 35 - .../Partials/Menu/Type-8.html | 23 - .../Menu/Type-categorized_content.html | 17 - .../Partials/Menu/Type-categorized_pages.html | 22 - .../FluidStyledContent/Templates/Menu.html | 8 - .../Private/Language/locallang_tca.xlf | 20 - .../Private/Language/locallang_version.xlf | 374 --- .../Resources/Private/Templates/Version.html | 34 - .../Private/Templates/indexed_search.tmpl | 259 -- .../Private/Templates/template_css.tmpl | 211 -- .../Resources/Public/Icons/Extension.png | Bin 3450 -> 0 bytes .../Public/JavaScript/ContextMenuActions.js | 38 - typo3/sysext/compatibility7/composer.json | 29 - typo3/sysext/compatibility7/ext_emconf.php | 25 - typo3/sysext/compatibility7/ext_localconf.php | 111 - typo3/sysext/compatibility7/ext_tables.php | 16 - typo3/sysext/compatibility7/ext_tables.sql | 14 - .../compatibility7/ext_typoscript_setup.txt | 135 - .../Compatibility7ExtractionUpdate.php | 122 + typo3/sysext/install/ext_localconf.php | 2 + 60 files changed, 128 insertions(+), 7751 deletions(-) delete mode 100644 typo3/sysext/compatibility7/Classes/ContextMenu/ItemProvider.php delete mode 100644 typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php delete mode 100644 typo3/sysext/compatibility7/Classes/Controller/VersionModuleController.php delete mode 100644 typo3/sysext/compatibility7/Classes/Hooks/BackendLoginLinkHook.php delete mode 100644 typo3/sysext/compatibility7/Classes/Hooks/EnforceUrlSchemeHook.php delete mode 100644 typo3/sysext/compatibility7/Classes/Hooks/PageLayoutActionHook.php delete mode 100644 typo3/sysext/compatibility7/Classes/Hooks/TcaSoftExcludeHook.php delete mode 100644 typo3/sysext/compatibility7/Classes/Report/Status/SystemStatus.php delete mode 100644 typo3/sysext/compatibility7/Classes/Utility/MonitorUtility.php delete mode 100644 typo3/sysext/compatibility7/Classes/View/VersionView.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/CategoriesViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/DirectoryViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/KeywordsViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/ListViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/MenuViewHelperTrait.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/SectionViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/UpdatedViewHelper.php delete mode 100644 typo3/sysext/compatibility7/Configuration/Backend/Routes.php delete mode 100644 typo3/sysext/compatibility7/Configuration/PageTS/Mod/Wizards/NewContentElementMenu.txt delete mode 100644 typo3/sysext/compatibility7/Configuration/TCA/Overrides/pages.php delete mode 100644 typo3/sysext/compatibility7/Configuration/TCA/Overrides/sys_template.php delete mode 100644 typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content.php delete mode 100644 typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content_element_menu.php delete mode 100644 typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/CssStyledContent/setup.txt delete mode 100644 typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/FluidStyledContent/setup.txt delete mode 100644 typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php delete mode 100644 typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Directory.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-0.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-1.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-2.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-3.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-4.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-5.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-6.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-7.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-8.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_content.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_pages.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Templates/Menu.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/Language/locallang_tca.xlf delete mode 100644 typo3/sysext/compatibility7/Resources/Private/Language/locallang_version.xlf delete mode 100644 typo3/sysext/compatibility7/Resources/Private/Templates/Version.html delete mode 100644 typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl delete mode 100644 typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl delete mode 100644 typo3/sysext/compatibility7/Resources/Public/Icons/Extension.png delete mode 100644 typo3/sysext/compatibility7/Resources/Public/JavaScript/ContextMenuActions.js delete mode 100644 typo3/sysext/compatibility7/composer.json delete mode 100644 typo3/sysext/compatibility7/ext_emconf.php delete mode 100644 typo3/sysext/compatibility7/ext_localconf.php delete mode 100644 typo3/sysext/compatibility7/ext_tables.php delete mode 100644 typo3/sysext/compatibility7/ext_tables.sql delete mode 100644 typo3/sysext/compatibility7/ext_typoscript_setup.txt create mode 100644 typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php diff --git a/Build/tsconfig.json b/Build/tsconfig.json index 605d77a2069a..0c73a40a8867 100644 --- a/Build/tsconfig.json +++ b/Build/tsconfig.json @@ -20,9 +20,6 @@ "TYPO3/CMS/Beuser/*": [ "../typo3/sysext/beuser/Resources/Public/JavaScript/" ], - "TYPO3/CMS/Compatibility7/*": [ - "../typo3/sysext/compatibility7/Resources/Public/JavaScript/" - ], "TYPO3/CMS/ContextHelp/*": [ "../typo3/sysext/context_help/Resources/Public/JavaScript/" ], @@ -134,9 +131,6 @@ "TYPO3/CMS/T3editor/*": [ "../typo3/sysext/t3editor/Resources/Public/JavaScript/" ], - "TYPO3/CMS/T3skin/*": [ - "../typo3/sysext/t3skin/Resources/Public/JavaScript/" - ], "TYPO3/CMS/Taskcenter/*": [ "../typo3/sysext/taskcenter/Resources/Public/JavaScript/" ], @@ -174,4 +168,4 @@ "../typo3/sysext/backend/Resources/Private/TypeScript/ImageManipulation.ts", "../typo3/sysext/backend/Resources/Private/TypeScript/RenameFile.ts" ] -} \ No newline at end of file +} diff --git a/composer.json b/composer.json index fbe2835ad126..78b8cebb8718 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,6 @@ "typo3/cms-beuser": "self.version", "typo3/cms-context-help": "self.version", "typo3/cms-core": "self.version", - "typo3/cms-compatibility7": "self.version", "typo3/cms-cshmanual": "self.version", "typo3/cms-css-styled-content": "self.version", "typo3/cms-documentation": "self.version", diff --git a/composer.lock b/composer.lock index d9b22c2879f7..52161d9ecb08 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "aa2279bf0a2d7d258d5e7ef5fa1372dc", + "content-hash": "ab232a6d09f0439f2a225d779cc865fb", "packages": [ { "name": "cogpowered/finediff", diff --git a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php index 0b3314b3c8eb..c828a0ca3bd2 100644 --- a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php +++ b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php @@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Template; use TYPO3\CMS\Backend\Template\Components\DocHeaderComponent; use TYPO3\CMS\Backend\Utility\BackendUtility; -use TYPO3\CMS\Compatibility7\View\VersionView; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; @@ -596,9 +595,9 @@ class ModuleTemplate /** * For Code Completion * - * @var $versionGuiObj VersionView + * @var $versionGuiObj \TYPO3\CMS\Compatibility7\View\VersionView */ - $versionGuiObj = GeneralUtility::makeInstance(VersionView::class); + $versionGuiObj = GeneralUtility::makeInstance(\TYPO3\CMS\Compatibility7\View\VersionView::class); return $versionGuiObj->getVersionSelector($id, $noAction); } return ''; diff --git a/typo3/sysext/compatibility7/Classes/ContextMenu/ItemProvider.php b/typo3/sysext/compatibility7/Classes/ContextMenu/ItemProvider.php deleted file mode 100644 index 3ca4536480d7..000000000000 --- a/typo3/sysext/compatibility7/Classes/ContextMenu/ItemProvider.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -declare(strict_types=1); -namespace TYPO3\CMS\Compatibility7\ContextMenu; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider; -use TYPO3\CMS\Backend\Utility\BackendUtility; - -/** - * Context menu item provider for version module - */ -class ItemProvider extends AbstractProvider -{ - /** - * @var array - */ - protected $itemsConfiguration = [ - 'versioning' => [ - 'type' => 'item', - 'label' => 'LLL:EXT:compatibility7/Resources/Private/Language/locallang_version.xlf:title', - 'iconIdentifier' => 'actions-version-page-open', - 'callbackAction' => 'openVersionModule' - ] - ]; - - /** - * @return bool - */ - public function canHandle(): bool - { - return isset($GLOBALS['TCA'][$this->table]) && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']; - } - - /** - * This needs to be lower than priority of the RecordProvider - * - * @return int - */ - public function getPriority(): int - { - return 55; - } - - /** - * Registers custom JS module with item onclick behaviour - * - * @param string $itemName - * @return array - */ - protected function getAdditionalAttributes(string $itemName): array - { - $url = BackendUtility::getModuleUrl('web_txversionM1', ['table' => $this->table, 'uid' => $this->identifier]); - return [ - 'data-action-url' => htmlspecialchars($url), - 'data-callback-module' => 'TYPO3/CMS/Compatibility7/ContextMenuActions' - ]; - } - - /** - * Adds import/export items to the "submenu" if available - * - * @param array $items - * @return array - */ - public function addItems(array $items): array - { - $this->initDisabledItems(); - - if (isset($items['delete'])) { - $localItems = $this->prepareItems($this->itemsConfiguration); - $position = array_search('delete', array_keys($items), true); - - $beginning = array_slice($items, 0, $position+1, true); - $end = array_slice($items, $position, null, true); - - $items = $beginning + $localItems + $end; - } - return $items; - } - - /** - * @param string $itemName - * @param string $type - * @return bool - */ - protected function canRender(string $itemName, string $type): bool - { - if (in_array($itemName, $this->disabledItems, true)) { - return false; - } - $canRender = false; - switch ($itemName) { - case 'versioning': - $canRender = (int)$this->identifier > 0 && $this->backendUser->check('modules', 'web_txversionM1'); - break; - } - return $canRender; - } -} diff --git a/typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php b/typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php deleted file mode 100644 index e1b5d871aa86..000000000000 --- a/typo3/sysext/compatibility7/Classes/Controller/SearchFormController.php +++ /dev/null @@ -1,2681 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Controller; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Charset\CharsetConverter; -use TYPO3\CMS\Core\Html\HtmlParser; -use TYPO3\CMS\Core\TimeTracker\TimeTracker; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\MathUtility; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; -use TYPO3\CMS\IndexedSearch\Utility; - -/** - * Index search frontend - * - * Creates a searchform for indexed search. Indexing must be enabled - * for this to make sense. - */ -class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin -{ - /** - * Used as fieldname prefix - * - * @var string - */ - public $prefixId = 'tx_indexedsearch'; - - /** - * Extension key. - * - * @var string - */ - public $extKey = 'indexed_search'; - - /** - * See document for info about this flag... - * - * @var int - */ - public $join_pages = 0; - - /** - * @var int - */ - public $defaultResultNumber = 10; - - /** - * Internal variable - * - * @var array - */ - public $operator_translate_table = [['+', 'AND'], ['|', 'OR'], ['-', 'AND NOT']]; - - /** - * Root-page ids to search in (rl0 field where clause, see initialize() function) - * - * @var int|string id or comma separated list of ids - */ - public $wholeSiteIdList = 0; - - /** - * Search Words and operators - * - * @var array - */ - public $sWArr = []; - - /** - * Selector box values for search configuration form - * - * @var array - */ - public $optValues = []; - - /** - * Will hold the first row in result - used to calculate relative hit-ratings. - * - * @var array - */ - public $firstRow = []; - - /** - * Caching of page path - * - * @var array - */ - public $cache_path = []; - - /** - * Caching of root line data - * - * @var array - */ - public $cache_rl = []; - - /** - * Required fe_groups memberships for display of a result. - * - * @var array - */ - public $fe_groups_required = []; - - /** - * sys_domain records - * - * @var array - */ - public $domain_records = []; - - /** - * Select clauses for individual words - * - * @var array - */ - public $wSelClauses = []; - - /** - * Page tree sections for search result. - * - * @var array - */ - public $resultSections = []; - - /** - * External parser objects - * @var array - */ - public $external_parsers = []; - - /** - * Storage of icons.... - * - * @var array - */ - public $iconFileNameCache = []; - - /** - * Will hold the content of $conf['templateFile'] - * - * @var string - */ - public $templateCode = ''; - - /** - * @var string - */ - public $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results'; - - /** - * Indexer configuration, coming from $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search'] - * - * @var array - */ - public $indexerConfig = []; - - /** - * @var bool - */ - public $enableMetaphoneSearch = false; - - /** - * @var bool - */ - public $storeMetaphoneInfoAsWords; - - /** - * Lexer object - * - * @var \TYPO3\CMS\IndexedSearch\Lexer - */ - public $lexerObj; - - /** - * @var TimeTracker - */ - protected $timeTracker; - - /** - * @var CharsetConverter - */ - protected $charsetConverter; - - /** - * Main function, called from TypoScript as a USER_INT object. - * - * @param string $content Content input, ignore (just put blank string) - * @param array $conf TypoScript configuration of the plugin! - * @return string HTML code for the search form / result display. - */ - public function main($content, $conf) - { - // Initialize: - $this->charsetConverter = GeneralUtility::makeInstance(CharsetConverter::class); - $this->conf = $conf; - $this->pi_loadLL('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf'); - $this->pi_setPiVarDefaults(); - // Initialize: - $this->initialize(); - // Do search: - // If there were any search words entered... - if (is_array($this->sWArr) && !empty($this->sWArr)) { - $content = $this->doSearch($this->sWArr); - } - // Finally compile all the content, form, messages and results: - $content = $this->makeSearchForm($this->optValues) . $this->printRules() . $content; - return $this->pi_wrapInBaseClass($content); - } - - /** - * Initialize internal variables, especially selector box values for the search form and search words - * - * @return void - */ - public function initialize() - { - // Indexer configuration from Extension Manager interface: - $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search'], ['allowed_classes' => false]); - $this->enableMetaphoneSearch = (bool)$this->indexerConfig['enableMetaphoneSearch']; - $this->storeMetaphoneInfoAsWords = !\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_words'); - $this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class); - // Initialize external document parsers for icon display and other soft operations - if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef) { - $this->external_parsers[$extension] = GeneralUtility::getUserObj($_objRef); - // Init parser and if it returns FALSE, unset its entry again: - if (!$this->external_parsers[$extension]->softInit($extension)) { - unset($this->external_parsers[$extension]); - } - } - } - // Init lexer (used to post-processing of search words) - $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class; - $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef); - // If "_sections" is set, this value overrides any existing value. - if ($this->piVars['_sections']) { - $this->piVars['sections'] = $this->piVars['_sections']; - } - // If "_sections" is set, this value overrides any existing value. - if ($this->piVars['_freeIndexUid'] !== '_') { - $this->piVars['freeIndexUid'] = $this->piVars['_freeIndexUid']; - } - // Add previous search words to current - if ($this->piVars['sword_prev_include'] && $this->piVars['sword_prev']) { - $this->piVars['sword'] = trim($this->piVars['sword_prev']) . ' ' . $this->piVars['sword']; - } - $this->piVars['results'] = MathUtility::forceIntegerInRange($this->piVars['results'], 1, 100, $this->defaultResultNumber); - // Make sure that some cropping and markup constants used later are defined - $this->loadSettings(); - - // Selector-box values defined here: - $this->optValues = [ - 'type' => [ - '0' => $this->pi_getLL('opt_type_0'), - '1' => $this->pi_getLL('opt_type_1'), - '2' => $this->pi_getLL('opt_type_2'), - '3' => $this->pi_getLL('opt_type_3'), - '10' => $this->pi_getLL('opt_type_10'), - '20' => $this->pi_getLL('opt_type_20') - ], - 'defOp' => [ - '0' => $this->pi_getLL('opt_defOp_0'), - '1' => $this->pi_getLL('opt_defOp_1') - ], - 'sections' => [ - '0' => $this->pi_getLL('opt_sections_0'), - '-1' => $this->pi_getLL('opt_sections_-1'), - '-2' => $this->pi_getLL('opt_sections_-2'), - '-3' => $this->pi_getLL('opt_sections_-3') - ], - 'freeIndexUid' => [ - '-1' => $this->pi_getLL('opt_freeIndexUid_-1'), - '-2' => $this->pi_getLL('opt_freeIndexUid_-2'), - '0' => $this->pi_getLL('opt_freeIndexUid_0') - ], - 'media' => [ - '-1' => $this->pi_getLL('opt_media_-1'), - '0' => $this->pi_getLL('opt_media_0'), - '-2' => $this->pi_getLL('opt_media_-2') - ], - 'order' => [ - 'rank_flag' => $this->pi_getLL('opt_order_rank_flag'), - 'rank_freq' => $this->pi_getLL('opt_order_rank_freq'), - 'rank_first' => $this->pi_getLL('opt_order_rank_first'), - 'rank_count' => $this->pi_getLL('opt_order_rank_count'), - 'mtime' => $this->pi_getLL('opt_order_mtime'), - 'title' => $this->pi_getLL('opt_order_title'), - 'crdate' => $this->pi_getLL('opt_order_crdate') - ], - 'group' => [ - 'sections' => $this->pi_getLL('opt_group_sections'), - 'flat' => $this->pi_getLL('opt_group_flat') - ], - 'lang' => [ - -1 => $this->pi_getLL('opt_lang_-1'), - 0 => $this->pi_getLL('opt_lang_0') - ], - 'desc' => [ - '0' => $this->pi_getLL('opt_desc_0'), - '1' => $this->pi_getLL('opt_desc_1') - ], - 'results' => [ - '10' => '10', - '20' => '20', - '50' => '50', - '100' => '100' - ] - ]; - // Remove this option if metaphone search is disabled) - if (!$this->enableMetaphoneSearch) { - unset($this->optValues['type']['10']); - } - // Free Index Uid: - if ($this->conf['search.']['defaultFreeIndexUidList']) { - $uidList = GeneralUtility::intExplode(',', $this->conf['search.']['defaultFreeIndexUidList']); - $indexCfgRecords = $this->databaseConnection->exec_SELECTgetRows('uid,title', 'index_config', 'uid IN (' . implode(',', $uidList) . ')' . $this->cObj->enableFields('index_config'), '', '', '', 'uid'); - foreach ($uidList as $uidValue) { - if (is_array($indexCfgRecords[$uidValue])) { - $this->optValues['freeIndexUid'][$uidValue] = $indexCfgRecords[$uidValue]['title']; - } - } - } - // Should we use join_pages instead of long lists of uids? - if ($this->conf['search.']['skipExtendToSubpagesChecking']) { - $this->join_pages = 1; - } - // Add media to search in: - if (trim($this->conf['search.']['mediaList']) !== '') { - $mediaList = implode(',', GeneralUtility::trimExplode(',', $this->conf['search.']['mediaList'], true)); - } - foreach ($this->external_parsers as $extension => $obj) { - // Skip unwanted extensions - if ($mediaList && !GeneralUtility::inList($mediaList, $extension)) { - continue; - } - if ($name = $obj->searchTypeMediaTitle($extension)) { - $this->optValues['media'][$extension] = $this->pi_getLL('opt_sections_' . $extension, $name); - } - } - // Add operators for various languages - // Converts the operators to lowercase - $this->operator_translate_table[] = [mb_strtolower($this->pi_getLL('local_operator_AND'), 'utf-8'), 'AND']; - $this->operator_translate_table[] = [mb_strtolower($this->pi_getLL('local_operator_OR'), 'utf-8'), 'OR']; - $this->operator_translate_table[] = [mb_strtolower($this->pi_getLL('local_operator_NOT'), 'utf-8'), 'AND NOT']; - // This is the id of the site root. This value may be a commalist of integer (prepared for this) - $this->wholeSiteIdList = (int)$this->frontendController->config['rootLine'][0]['uid']; - // Creating levels for section menu: - // This selects the first and secondary menus for the "sections" selector - so we can search in sections and sub sections. - if ($this->conf['show.']['L1sections']) { - $firstLevelMenu = $this->getMenu($this->wholeSiteIdList); - foreach ($firstLevelMenu as $optionName => $mR) { - if (!$mR['nav_hide']) { - $this->optValues['sections']['rl1_' . $mR['uid']] = trim($this->pi_getLL('opt_RL1') . ' ' . $mR['title']); - if ($this->conf['show.']['L2sections']) { - $secondLevelMenu = $this->getMenu($mR['uid']); - foreach ($secondLevelMenu as $kk2 => $mR2) { - if (!$mR2['nav_hide']) { - $this->optValues['sections']['rl2_' . $mR2['uid']] = trim($this->pi_getLL('opt_RL2') . ' ' . $mR2['title']); - } else { - unset($secondLevelMenu[$kk2]); - } - } - $this->optValues['sections']['rl2_' . implode(',', array_keys($secondLevelMenu))] = $this->pi_getLL('opt_RL2ALL'); - } - } else { - unset($firstLevelMenu[$optionName]); - } - } - $this->optValues['sections']['rl1_' . implode(',', array_keys($firstLevelMenu))] = $this->pi_getLL('opt_RL1ALL'); - } - // Setting the list of root IDs for the search. Notice, these page IDs MUST have a TypoScript template with root flag on them! Basically this list is used to select on the "rl0" field and page ids are registered as "rl0" only if a TypoScript template record with root flag is there. - // This happens AFTER the use of $this->wholeSiteIdList above because the above will then fetch the menu for the CURRENT site - regardless of this kind of searching here. Thus a general search will lookup in the WHOLE database while a specific section search will take the current sections... - if ($this->conf['search.']['rootPidList']) { - $this->wholeSiteIdList = implode(',', GeneralUtility::intExplode(',', $this->conf['search.']['rootPidList'])); - } - // Load the template - $template = $this->getTypoScriptFrontendController()->tmpl->getFileName($this->conf['templateFile']); - if ($template !== null && file_exists($template)) { - $this->templateCode = file_get_contents($template); - } - // Add search languages: - $res = $this->databaseConnection->exec_SELECTquery('*', 'sys_language', '1=1' . $this->cObj->enableFields('sys_language')); - while (false !== ($data = $this->databaseConnection->sql_fetch_assoc($res))) { - $this->optValues['lang'][$data['uid']] = $data['title']; - } - $this->databaseConnection->sql_free_result($res); - // Calling hook for modification of initialized content - if ($hookObj = $this->hookRequest('initialize_postProc')) { - $hookObj->initialize_postProc(); - } - // Default values set: - // Setting first values in optValues as default values IF there is not corresponding piVar value set already. - foreach ($this->optValues as $optionName => $optionValue) { - if (!isset($this->piVars[$optionName])) { - reset($optionValue); - $this->piVars[$optionName] = key($optionValue); - } - } - // Blind selectors: - if (is_array($this->conf['blind.'])) { - foreach ($this->conf['blind.'] as $optionName => $optionValue) { - if (is_array($optionValue)) { - foreach ($optionValue as $optionValueSubKey => $optionValueSubValue) { - if (!is_array($optionValueSubValue) && $optionValueSubValue && is_array($this->optValues[substr($optionName, 0, -1)])) { - unset($this->optValues[substr($optionName, 0, -1)][$optionValueSubKey]); - } - } - } elseif ($optionValue) { - // If value is not set, unset the option array - unset($this->optValues[$optionName]); - } - } - } - // This gets the search-words into the $sWArr: - $this->sWArr = $this->getSearchWords($this->piVars['defOp']); - } - - /** - * Splits the search word input into an array where each word is represented by an array with key "sword" holding the search word and key "oper" holding the SQL operator (eg. AND, OR) - * - * Only words with 2 or more characters are accepted - * Max 200 chars total - * Space is used to split words, "" can be used search for a whole string - * AND, OR and NOT are prefix words, overruling the default operator - * +/|/- equals AND, OR and NOT as operators. - * All search words are converted to lowercase. - * - * $defOp is the default operator. 1=OR, 0=AND - * - * @param bool $defOp If TRUE, the default operator will be OR, not AND - * @return array Returns array with search words if any found - */ - public function getSearchWords($defOp) - { - // Shorten search-word string to max 200 bytes (does NOT take multibyte charsets into account - but never mind, shortening the string here is only a run-away feature!) - $inSW = substr($this->piVars['sword'], 0, 200); - // Convert to UTF-8 + conv. entities (was also converted during indexing!) - $inSW = $this->charsetConverter->conv($inSW, $this->frontendController->metaCharset, 'utf-8'); - $inSW = $this->charsetConverter->entities_to_utf8($inSW); - $sWordArray = false; - if ($hookObj = $this->hookRequest('getSearchWords')) { - $sWordArray = $hookObj->getSearchWords_splitSWords($inSW, $defOp); - } else { - if ($this->piVars['type'] == 20) { - // type = Sentence - $sWordArray = [['sword' => trim($inSW), 'oper' => 'AND']]; - } else { - $searchWords = \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::getExplodedSearchString($inSW, $defOp == 1 ? 'OR' : 'AND', $this->operator_translate_table); - if (is_array($searchWords)) { - $sWordArray = $this->procSearchWordsByLexer($searchWords); - } - } - } - return $sWordArray; - } - - /** - * Post-process the search word array so it will match the words that was indexed (including case-folding if any) - * If any words are split into multiple words (eg. CJK will be!) the operator of the main word will remain. - * - * @param array $SWArr Search word array - * @return array Search word array, processed through lexer - */ - public function procSearchWordsByLexer($SWArr) - { - // Init output variable: - $newSWArr = []; - // Traverse the search word array: - foreach ($SWArr as $wordDef) { - if (!strstr($wordDef['sword'], ' ')) { - // No space in word (otherwise it might be a sentense in quotes like "there is"). - // Split the search word by lexer: - $res = $this->lexerObj->split2Words($wordDef['sword']); - // Traverse lexer result and add all words again: - foreach ($res as $word) { - $newSWArr[] = ['sword' => $word, 'oper' => $wordDef['oper']]; - } - } else { - $newSWArr[] = $wordDef; - } - } - // Return result: - return $newSWArr; - } - - /***************************** - * - * Main functions - * - *****************************/ - /** - * Performs the search, the display and writing stats - * - * @param array $sWArr Search words in array, see ->getSearchWords() for details - * @return string HTML for result display. - */ - public function doSearch($sWArr) - { - // Find free index uid: - $freeIndexUid = $this->piVars['freeIndexUid']; - if ($freeIndexUid == -2) { - $freeIndexUid = $this->conf['search.']['defaultFreeIndexUidList']; - } - $indexCfgs = GeneralUtility::intExplode(',', $freeIndexUid); - $accumulatedContent = ''; - foreach ($indexCfgs as $freeIndexUid) { - // Get result rows: - $pt1 = GeneralUtility::milliseconds(); - if ($hookObj = $this->hookRequest('getResultRows')) { - $resData = $hookObj->getResultRows($sWArr, $freeIndexUid); - } else { - $resData = $this->getResultRows($sWArr, $freeIndexUid); - } - // Display search results: - $pt2 = GeneralUtility::milliseconds(); - if ($hookObj = $this->hookRequest('getDisplayResults')) { - $content = $hookObj->getDisplayResults($sWArr, $resData, $freeIndexUid); - } else { - $content = $this->getDisplayResults($sWArr, $resData, $freeIndexUid); - } - $pt3 = GeneralUtility::milliseconds(); - // Create header if we are searching more than one indexing configuration: - if (count($indexCfgs) > 1) { - if ($freeIndexUid > 0) { - $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('title', 'index_config', 'uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config')); - $titleString = $indexCfgRec['title']; - } else { - $titleString = $this->pi_getLL('opt_freeIndexUid_header_' . $freeIndexUid); - } - $content = '<h1 class="tx-indexedsearch-category">' . htmlspecialchars($titleString) . '</h1>' . $content; - } - $accumulatedContent .= $content; - } - // Write search statistics - $this->writeSearchStat($sWArr, $resData['count'], [$pt1, $pt2, $pt3]); - // Return content: - return $accumulatedContent; - } - - /** - * Get search result rows / data from database. Returned as data in array. - * - * @param array $searchWordArray Search word array - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return array False if no result, otherwise an array with keys for first row, result rows and total number of results found. - */ - public function getResultRows($searchWordArray, $freeIndexUid = -1) - { - // unserializing the configuration of indexed_search (!) to see if - // the extension is configured to use the mysql fulltext feature - $extConf = []; - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search'])) { - $extConf = unserialize( - $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search'], - ['allowed_classes' => false] - ); - } - - // Getting SQL result pointer. This fetches ALL results (1,000,000 if found) - $this->timeTracker->push('Searching result'); - if ($hookObj = &$this->hookRequest('getResultRows_SQLpointer')) { - $res = $hookObj->getResultRows_SQLpointer($searchWordArray, $freeIndexUid); - } elseif (isset($extConf['useMysqlFulltext']) && $extConf['useMysqlFulltext'] === '1') { - $res = $this->getResultRows_SQLpointerMysqlFulltext($searchWordArray, $freeIndexUid); - } else { - $res = $this->getResultRows_SQLpointer($searchWordArray, $freeIndexUid); - } - $this->timeTracker->pull(); - // Organize and process result: - $result = false; - if ($res) { - $totalSearchResultCount = $this->databaseConnection->sql_num_rows($res); - // Total search-result count - $currentPageNumber = MathUtility::forceIntegerInRange($this->piVars['pointer'], 0, floor($totalSearchResultCount / $this->piVars['results'])); - // The pointer is set to the result page that is currently being viewed - // Initialize result accumulation variables: - $positionInSearchResults = 0; - $groupingPhashes = []; - // Used for filtering out duplicates - $groupingChashes = []; - // Used for filtering out duplicates BASED ON cHash - $firstRow = []; - // Will hold the first row in result - used to calculate relative hit-ratings. - $resultRows = []; - // Will hold the results rows for display. - // Should we continue counting and checking of results even if - // we are sure they are not displayed in this request? - // This will slow down your page rendering, but it allows - // precise search result counters. - $calculateExactCount = (bool)$this->conf['search.']['exactCount']; - $lastResultNumberOnPreviousPage = $currentPageNumber * $this->piVars['results']; - $firstResultNumberOnNextPage = ($currentPageNumber + 1) * $this->piVars['results']; - $lastResultNumberToAnalyze = ($currentPageNumber + 1) * $this->piVars['results'] + $this->piVars['results']; - // Now, traverse result and put the rows to be displayed into an array - // Each row should contain the fields from 'ISEC.*, IP.*' combined + artificial fields "show_resume" (bool) and "result_number" (counter) - while (false !== ($row = $this->databaseConnection->sql_fetch_assoc($res))) { - // Set first row: - if ($positionInSearchResults === 0) { - $firstRow = $row; - } - $row['show_resume'] = $this->checkResume($row); - // Tells whether we can link directly to a document or not (depends on possible right problems) - $phashGr = !in_array($row['phash_grouping'], $groupingPhashes); - $chashGr = !in_array(($row['contentHash'] . '.' . $row['data_page_id']), $groupingChashes); - if ($phashGr && $chashGr) { - if ($row['show_resume'] || $this->conf['show.']['forbiddenRecords']) { - // Only if the resume may be shown are we going to filter out duplicates... - if (!$this->multiplePagesType($row['item_type'])) { - // Only on documents which are not multiple pages documents - $groupingPhashes[] = $row['phash_grouping']; - } - $groupingChashes[] = $row['contentHash'] . '.' . $row['data_page_id']; - $positionInSearchResults++; - // Check if we are inside result range for current page - if ($positionInSearchResults > $lastResultNumberOnPreviousPage && $positionInSearchResults <= $lastResultNumberToAnalyze) { - // Collect results to display - $row['result_number'] = $positionInSearchResults; - $resultRows[] = $row; - // This may lead to a problem: If the result - // check is not stopped here, the search will - // take longer. However the result counter - // will not filter out grouped cHashes/pHashes - // that were not processed yet. You can change - // this behavior using the "search.exactCount" - // property (see above). - $nextResultPosition = $positionInSearchResults + 1; - if (!$calculateExactCount && $nextResultPosition > $firstResultNumberOnNextPage) { - break; - } - } - } else { - // Skip this row if the user cannot view it (missing permission) - $totalSearchResultCount--; - } - } else { - // For each time a phash_grouping document is found - // (which is thus not displayed) the search-result count - // is reduced, so that it matches the number of rows displayed. - $totalSearchResultCount--; - } - } - $this->databaseConnection->sql_free_result($res); - $result = [ - 'resultRows' => $resultRows, - 'firstRow' => $firstRow, - 'count' => $totalSearchResultCount - ]; - } - return $result; - } - - /** - * Gets a SQL result pointer to traverse for the search records. - * - * @param array $sWArr Search words - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return bool|\mysqli_result Query result pointer - */ - public function getResultRows_SQLpointer($sWArr, $freeIndexUid = -1) - { - // This SEARCHES for the searchwords in $sWArr AND returns a COMPLETE list of phash-integers of the matches. - $list = $this->getPhashList($sWArr); - // Perform SQL Search / collection of result rows array: - if ($list) { - // Do the search: - $this->timeTracker->push('execFinalQuery'); - $res = $this->execFinalQuery($list, $freeIndexUid); - $this->timeTracker->pull(); - return $res; - } else { - return false; - } - } - - /** - * Gets a SQL result pointer to traverse for the search records. - * - * @param array $searchWordsArray Search words - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return bool|\mysqli_result|object MySQLi result object / DBAL object - */ - protected function getResultRows_SQLpointerMysqlFulltext($searchWordsArray, $freeIndexUid = -1) - { - // Build the search string, detect which fulltext index to use, and decide whether boolean search is needed or not - $searchData = $this->getSearchString($searchWordsArray); - // Perform SQL Search / collection of result rows array: - $resource = false; - if ($searchData) { - /** @var TimeTracker $timeTracker */ - $timeTracker = GeneralUtility::makeInstance(TimeTracker::class); - // Do the search: - $timeTracker->push('execFinalQuery'); - $resource = $this->execFinalQuery_fulltext($searchData, $freeIndexUid); - $timeTracker->pull(); - } - return $resource; - } - - /** - * Returns a search string for use with MySQL FULLTEXT query - * - * @param array $searchWordArray Search word array - * @return string Search string - */ - protected function getSearchString($searchWordArray) - { - // Initialize variables: - $count = 0; - // Change this to TRUE to force BOOLEAN SEARCH MODE (useful if fulltext index is still empty) - $searchBoolean = false; - $fulltextIndex = 'index_fulltext.fulltextdata'; - // This holds the result if the search is natural (doesn't contain any boolean operators) - $naturalSearchString = ''; - // This holds the result if the search is boolen (contains +/-/| operators) - $booleanSearchString = ''; - - $searchType = (string)$this->getSearchType(); - - // Traverse searchwords and prefix them with corresponding operator - foreach ($searchWordArray as $searchWordData) { - // Making the query for a single search word based on the search-type - $searchWord = $searchWordData['sword']; - $wildcard = ''; - if (strstr($searchWord, ' ')) { - $searchType = '20'; - } - switch ($searchType) { - case '1': - case '2': - case '3': - // First part of word - $wildcard = '*'; - // Part-of-word search requires boolean mode! - $searchBoolean = true; - break; - case '10': - $indexerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class); - // Initialize the indexer-class - /** @var \TYPO3\CMS\IndexedSearch\Indexer $indexerObj */ - $searchWord = $indexerObj->metaphone($searchWord, $indexerObj->storeMetaphoneInfoAsWords); - unset($indexerObj); - $fulltextIndex = 'index_fulltext.metaphonedata'; - break; - case '20': - $searchBoolean = true; - // Remove existing quotes and fix misplaced quotes. - $searchWord = trim(str_replace('"', ' ', $searchWord)); - break; - } - // Perform search for word: - switch ($searchWordData['oper']) { - case 'AND NOT': - $booleanSearchString .= ' -' . $searchWord . $wildcard; - $searchBoolean = true; - break; - case 'OR': - $booleanSearchString .= ' ' . $searchWord . $wildcard; - $searchBoolean = true; - break; - default: - $booleanSearchString .= ' +' . $searchWord . $wildcard; - $naturalSearchString .= ' ' . $searchWord; - } - $count++; - } - if ($searchType == '20') { - $searchString = '"' . trim($naturalSearchString) . '"'; - } elseif ($searchBoolean) { - $searchString = trim($booleanSearchString); - } else { - $searchString = trim($naturalSearchString); - } - return [ - 'searchBoolean' => $searchBoolean, - 'searchString' => $searchString, - 'fulltextIndex' => $fulltextIndex - ]; - } - - /** - * Execute final query, based on phash integer list. The main point is sorting the result in the right order. - * - * @param array $searchData Array with search string, boolean indicator, and fulltext index reference - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return bool|\mysqli_result|object MySQLi result object / DBAL object - */ - protected function execFinalQuery_fulltext($searchData, $freeIndexUid = -1) - { - // Setting up methods of filtering results based on page types, access, etc. - $pageJoin = ''; - // Indexing configuration clause: - $freeIndexUidClause = $this->freeIndexUidWhere($freeIndexUid); - // Calling hook for alternative creation of page ID list - $searchRootPageIdList = $this->getSearchRootPageIdList(); - if ($hookObj = &$this->hookRequest('execFinalQuery_idList')) { - $pageWhere = $hookObj->execFinalQuery_idList(''); - } elseif ($this->getJoinPagesForQuery()) { - // Alternative to getting all page ids by ->getTreeList() where "excludeSubpages" is NOT respected. - $pageJoin = ', - pages'; - $pageWhere = 'pages.uid = ISEC.page_id - ' . $GLOBALS['TSFE']->cObj->enableFields('pages') . ' - AND pages.no_search=0 - AND pages.doktype<200 - '; - } elseif ($searchRootPageIdList[0] >= 0) { - - // Collecting all pages IDs in which to search; - // filtering out ALL pages that are not accessible due to enableFields. Does NOT look for "no_search" field! - $idList = []; - foreach ($searchRootPageIdList as $rootId) { - /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj */ - $cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class); - $idList[] = $cObj->getTreeList(-1 * $rootId, 9999); - } - $pageWhere = ' ISEC.page_id IN (' . implode(',', $idList) . ')'; - } else { - // Disable everything... (select all) - $pageWhere = ' 1=1'; - } - $searchBoolean = ''; - if ($searchData['searchBoolean']) { - $searchBoolean = ' IN BOOLEAN MODE'; - } - $resource = $GLOBALS['TYPO3_DB']->exec_SELECTquery( - 'index_fulltext.*, ISEC.*, IP.*', - 'index_fulltext, index_section ISEC, index_phash IP' . $pageJoin, - 'MATCH (' . $searchData['fulltextIndex'] . ') - AGAINST (' . $GLOBALS['TYPO3_DB']->fullQuoteStr($searchData['searchString'], 'index_fulltext') . $searchBoolean . ') ' . - $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . ' - AND index_fulltext.phash = IP.phash - AND ISEC.phash = IP.phash - AND ' . $pageWhere . $this->sectionTableWhere(), - 'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,IP.data_filename ,IP.data_page_id ,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,IP.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId' - ); - return $resource; - } - - /** - * Compiles the HTML display of the incoming array of result rows. - * - * @param array $sWArr Search words array (for display of text describing what was searched for) - * @param array $resData Array with result rows, count, first row. - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return string HTML content to display result. - */ - public function getDisplayResults($sWArr, $resData, $freeIndexUid = -1) - { - $content = ''; - // Perform display of result rows array: - if ($resData) { - $this->timeTracker->push('Display Final result'); - // Set first selected row (for calculation of ranking later) - $this->firstRow = $resData['firstRow']; - // Result display here: - $rowcontent = ''; - $rowcontent .= $this->compileResult($resData['resultRows'], $freeIndexUid); - // Browsing box: - if ($resData['count']) { - $this->internal['res_count'] = $resData['count']; - $this->internal['results_at_a_time'] = $this->piVars['results']; - $this->internal['maxPages'] = MathUtility::forceIntegerInRange($this->conf['search.']['page_links'], 1, 100, 10); - $resultSectionsCount = count($this->resultSections); - $addString = $resData['count'] && $this->piVars['group'] === 'sections' && $freeIndexUid <= 0 ? ' ' . sprintf($this->pi_getLL(($resultSectionsCount > 1 ? 'inNsections' : 'inNsection')), $resultSectionsCount) : ''; - $browseBox1 = $this->renderPagination(1, $addString, $this->printResultSectionLinks(), $freeIndexUid); - $browseBox2 = $this->renderPagination(0, '', '', $freeIndexUid); - // Browsing nav, bottom. - $content = $browseBox1 . $rowcontent . $browseBox2; - } else { - $content = '<p' . $this->pi_classParam('noresults') . '>' . htmlspecialchars($this->pi_getLL('noResults')) . '</p>'; - } - $this->timeTracker->pull(); - } else { - $content .= '<p' . $this->pi_classParam('noresults') . '>' . htmlspecialchars($this->pi_getLL('noResults')) . '</p>'; - } - // Print a message telling which words we searched for, and in which sections etc. - $what = $this->tellUsWhatIsSeachedFor($sWArr) . (substr($this->piVars['sections'], 0, 2) === 'rl' ? ' ' . htmlspecialchars($this->pi_getLL('inSection')) . ' "' . $this->getPathFromPageId(substr($this->piVars['sections'], 4)) . '"' : ''); - $what = '<div' . $this->pi_classParam('whatis') . '>' . $this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']) . '</div>'; - $content = $what . $content; - // Return content: - return $content; - } - - /** - * Takes the array with resultrows as input and returns the result-HTML-code - * Takes the "group" var into account: Makes a "section" or "flat" display. - * - * @param array $resultRows Result rows - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return string HTML - */ - public function compileResult($resultRows, $freeIndexUid = -1) - { - $content = ''; - // Transfer result rows to new variable, performing some mapping of sub-results etc. - $newResultRows = []; - foreach ($resultRows as $row) { - $id = md5($row['phash_grouping']); - if (is_array($newResultRows[$id])) { - if (!$newResultRows[$id]['show_resume'] && $row['show_resume']) { - // swapping: - // Remove old - $subrows = $newResultRows[$id]['_sub']; - unset($newResultRows[$id]['_sub']); - $subrows[] = $newResultRows[$id]; - // Insert new: - $newResultRows[$id] = $row; - $newResultRows[$id]['_sub'] = $subrows; - } else { - $newResultRows[$id]['_sub'][] = $row; - } - } else { - $newResultRows[$id] = $row; - } - } - $resultRows = $newResultRows; - $this->resultSections = []; - if ($freeIndexUid <= 0) { - switch ($this->piVars['group']) { - case 'sections': - $rl2flag = substr($this->piVars['sections'], 0, 2) === 'rl'; - $sections = []; - foreach ($resultRows as $row) { - $id = $row['rl0'] . '-' . $row['rl1'] . ($rl2flag ? '-' . $row['rl2'] : ''); - $sections[$id][] = $row; - } - $this->resultSections = []; - foreach ($sections as $id => $resultRows) { - $rlParts = explode('-', $id); - $theId = $rlParts[2] ? $rlParts[2] : ($rlParts[1] ? $rlParts[1] : $rlParts[0]); - $theRLid = $rlParts[2] ? 'rl2_' . $rlParts[2] : ($rlParts[1] ? 'rl1_' . $rlParts[1] : '0'); - $sectionName = $this->getPathFromPageId($theId); - if ($sectionName[0] === '/') { - $sectionName = substr($sectionName, 1); - } - if (!trim($sectionName)) { - $sectionTitleLinked = htmlspecialchars($this->pi_getLL('unnamedSection')) . ':'; - } elseif ($this->conf['linkSectionTitles']) { - $quotedPrefix = GeneralUtility::quoteJSvalue($this->prefixId); - $onclick = 'document.forms[' . $quotedPrefix . '][' . GeneralUtility::quoteJSvalue($this->prefixId . '[_sections]') . '].value=' . GeneralUtility::quoteJSvalue($theRLid) . ';document.forms[' . $quotedPrefix . '].submit();return false;'; - $sectionTitleLinked = '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $sectionName . ':</a>'; - } else { - $sectionTitleLinked = $sectionName; - } - $resultRowsCount = count($resultRows); - $this->resultSections[$id] = [$sectionName, $resultRowsCount]; - // Add content header: - $content .= $this->makeSectionHeader($id, $sectionTitleLinked, $resultRowsCount); - // Render result rows: - $resultlist = ''; - foreach ($resultRows as $row) { - $resultlist .= $this->printResultRow($row); - } - $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']); - } - break; - default: - // flat: - $resultlist = ''; - foreach ($resultRows as $row) { - $resultlist .= $this->printResultRow($row); - } - $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']); - } - } else { - $resultlist = ''; - foreach ($resultRows as $row) { - $resultlist .= $this->printResultRow($row); - } - $content .= $this->cObj->stdWrap($resultlist, $this->conf['resultlist_stdWrap.']); - } - return '<div' . $this->pi_classParam('res') . '>' . $content . '</div>'; - } - - /*********************************** - * - * Searching functions (SQL) - * - ***********************************/ - /** - * Returns a COMPLETE list of phash-integers matching the search-result composed of the search-words in the sWArr array. - * The list of phash integers are unsorted and should be used for subsequent selection of index_phash records for display of the result. - * - * @param array $sWArr Search word array - * @return string List of integers - */ - public function getPhashList($sWArr) - { - // Initialize variables: - $c = 0; - $totalHashList = []; - // This array accumulates the phash-values - // Traverse searchwords; for each, select all phash integers and merge/diff/intersect them with previous word (based on operator) - foreach ($sWArr as $k => $v) { - // Making the query for a single search word based on the search-type - $sWord = $v['sword']; - $theType = (string)$this->piVars['type']; - if (strstr($sWord, ' ')) { - // If there are spaces in the search-word, make a full text search instead. - $theType = 20; - } - $this->timeTracker->push('SearchWord "' . $sWord . '" - $theType=' . $theType); - // Perform search for word: - switch ($theType) { - case '1': - // Part of word - $res = $this->searchWord($sWord, Utility\LikeWildcard::BOTH); - break; - case '2': - // First part of word - $res = $this->searchWord($sWord, Utility\LikeWildcard::RIGHT); - break; - case '3': - // Last part of word - $res = $this->searchWord($sWord, Utility\LikeWildcard::LEFT); - break; - case '10': - // Sounds like - /** - * Indexer object - * - * @var \TYPO3\CMS\IndexedSearch\Indexer - */ - // Initialize the indexer-class - $indexerObj = GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class); - // Perform metaphone search - $res = $this->searchMetaphone($indexerObj->metaphone($sWord, $this->storeMetaphoneInfoAsWords)); - unset($indexerObj); - break; - case '20': - // Sentence - $res = $this->searchSentence($sWord); - $this->piVars['order'] = 'mtime'; - // If there is a fulltext search for a sentence there is a likeliness that sorting cannot be done by the rankings from the rel-table (because no relations will exist for the sentence in the word-table). So therefore mtime is used instead. It is not required, but otherwise some hits may be left out. - break; - default: - // Distinct word - $res = $this->searchDistinct($sWord); - } - // If there was a query to do, then select all phash-integers which resulted from this. - if ($res) { - // Get phash list by searching for it: - $phashList = []; - while ($row = $this->databaseConnection->sql_fetch_assoc($res)) { - $phashList[] = $row['phash']; - } - $this->databaseConnection->sql_free_result($res); - // Here the phash list are merged with the existing result based on whether we are dealing with OR, NOT or AND operations. - if ($c) { - switch ($v['oper']) { - case 'OR': - $totalHashList = array_unique(array_merge($phashList, $totalHashList)); - break; - case 'AND NOT': - $totalHashList = array_diff($totalHashList, $phashList); - break; - default: - // AND... - $totalHashList = array_intersect($totalHashList, $phashList); - } - } else { - $totalHashList = $phashList; - } - } - $this->timeTracker->pull(); - $c++; - } - return implode(',', $totalHashList); - } - - /** - * Returns a query which selects the search-word from the word/rel tables. - * - * @param string $wordSel WHERE clause selecting the word from phash - * @param string $plusQ Additional AND clause in the end of the query. - * @return bool|\mysqli_result SQL result pointer - */ - public function execPHashListQuery($wordSel, $plusQ = '') - { - return $this->databaseConnection->exec_SELECTquery('IR.phash', 'index_words IW, - index_rel IR, - index_section ISEC', $wordSel . ' - AND IW.wid=IR.wid - AND ISEC.phash = IR.phash - ' . $this->sectionTableWhere() . ' - ' . $plusQ, 'IR.phash'); - } - - /** - * Search for a word - * - * @param string $sWord Word to search for - * @param int $wildcard Bit-field of Utility\LikeWildcard - * @return bool|\mysqli_result SQL result pointer - */ - public function searchWord($sWord, $wildcard) - { - $likeWildcard = Utility\LikeWildcard::cast($wildcard); - $wSel = $likeWildcard->getLikeQueryPart( - 'index_words', - 'IW.baseword', - $sWord - ); - - $this->wSelClauses[] = $wSel; - $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0'); - return $res; - } - - /** - * Search for one distinct word - * - * @param string $sWord Word to search for - * @return bool|\mysqli_result SQL result pointer - */ - public function searchDistinct($sWord) - { - $wSel = 'IW.wid=' . \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash($sWord); - $this->wSelClauses[] = $wSel; - $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0'); - return $res; - } - - /** - * Search for a sentence - * - * @param string $sSentence Sentence to search for - * @return bool|\mysqli_result SQL result pointer - */ - public function searchSentence($sSentence) - { - $this->wSelClauses[] = '1=1'; - $likeWildcard = Utility\LikeWildcard::cast(Utility\LikeWildcard::BOTH); - $likePart = $likeWildcard->getLikeQueryPart( - 'index_fulltext', - 'IFT.fulltextdata', - $sSentence - ); - - return $this->databaseConnection->exec_SELECTquery('ISEC.phash', - 'index_section ISEC, index_fulltext IFT', - $likePart . ' AND ISEC.phash = IFT.phash' . $this->sectionTableWhere(), 'ISEC.phash' - ); - } - - /** - * Search for a metaphone word - * - * @param string $sWord Word to search for - * @return \mysqli_result SQL result pointer - */ - public function searchMetaphone($sWord) - { - $wSel = 'IW.metaphone=' . $sWord; - $this->wSelClauses[] = $wSel; - return $this->execPHashListQuery($wSel, ' AND is_stopword=0'); - } - - /** - * Returns AND statement for selection of section in database. (rootlevel 0-2 + page_id) - * - * @return string AND clause for selection of section in database. - */ - public function sectionTableWhere() - { - $out = $this->wholeSiteIdList < 0 ? '' : ' AND ISEC.rl0 IN (' . $this->wholeSiteIdList . ')'; - $match = ''; - if (substr($this->piVars['sections'], 0, 4) === 'rl1_') { - $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], 4))); - $out .= ' AND ISEC.rl1 IN (' . $list . ')'; - $match = true; - } elseif (substr($this->piVars['sections'], 0, 4) === 'rl2_') { - $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], 4))); - $out .= ' AND ISEC.rl2 IN (' . $list . ')'; - $match = true; - } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) { - // Traversing user configured fields to see if any of those are used to limit search to a section: - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) { - if (substr($this->piVars['sections'], 0, strlen($fieldName) + 1) == $fieldName . '_') { - $list = implode(',', GeneralUtility::intExplode(',', substr($this->piVars['sections'], strlen($fieldName) + 1))); - $out .= ' AND ISEC.' . $fieldName . ' IN (' . $list . ')'; - $match = true; - break; - } - } - } - // If no match above, test the static types: - if (!$match) { - switch ((string)$this->piVars['sections']) { - case '-1': - // '-1' => 'Only this page', - $out .= ' AND ISEC.page_id=' . $this->frontendController->id; - break; - case '-2': - // '-2' => 'Top + level 1', - $out .= ' AND ISEC.rl2=0'; - break; - case '-3': - // '-3' => 'Level 2 and out', - $out .= ' AND ISEC.rl2>0'; - break; - } - } - return $out; - } - - /** - * Returns AND statement for selection of media type - * - * @return string AND statement for selection of media type - */ - public function mediaTypeWhere() - { - switch ((string)$this->piVars['media']) { - case '0': - // '0' => 'Kun TYPO3 sider', - $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr('0', 'index_phash'); - break; - case '-2': - // All external documents - $out = ' AND IP.item_type<>' . $this->databaseConnection->fullQuoteStr('0', 'index_phash'); - break; - case '-1': - // All content - $out = ''; - break; - default: - $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr($this->piVars['media'], 'index_phash'); - } - return $out; - } - - /** - * Returns AND statement for selection of language - * - * @return string AND statement for selection of language - */ - public function languageWhere() - { - $languageWhere = ''; - if ($this->piVars['lang'] >= 0) { - // -1 is the same as ALL language. - $languageWhere = 'AND IP.sys_language_uid=' . (int)$this->piVars['lang']; - } - return $languageWhere; - } - - /** - * Where-clause for free index-uid value. - * - * @param int $freeIndexUid Free Index UID value to limit search to. - * @return string WHERE SQL clause part. - */ - public function freeIndexUidWhere($freeIndexUid) - { - if ($freeIndexUid < 0) { - return ''; - } - // First, look if the freeIndexUid is a meta configuration: - $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('indexcfgs', 'index_config', 'type=5 AND uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config')); - if (is_array($indexCfgRec)) { - $refs = GeneralUtility::trimExplode(',', $indexCfgRec['indexcfgs']); - $list = [-99]; - // Default value to protect against empty array. - foreach ($refs as $ref) { - list($table, $uid) = GeneralUtility::revExplode('_', $ref, 2); - switch ($table) { - case 'index_config': - $idxRec = $this->databaseConnection->exec_SELECTgetSingleRow('uid', 'index_config', 'uid=' . (int)$uid . $this->cObj->enableFields('index_config')); - if ($idxRec) { - $list[] = $uid; - } - break; - case 'pages': - $indexCfgRecordsFromPid = $this->databaseConnection->exec_SELECTgetRows('uid', 'index_config', 'pid=' . (int)$uid . $this->cObj->enableFields('index_config')); - foreach ($indexCfgRecordsFromPid as $idxRec) { - $list[] = $idxRec['uid']; - } - break; - } - } - $list = array_unique($list); - } else { - $list = [(int)$freeIndexUid]; - } - return ' AND IP.freeIndexUid IN (' . implode(',', $list) . ')'; - } - - /** - * Execute final query, based on phash integer list. The main point is sorting the result in the right order. - * - * @param string $list List of phash integers which match the search. - * @param int $freeIndexUid Pointer to which indexing configuration you want to search in. -1 means no filtering. 0 means only regular indexed content. - * @return bool|\mysqli_result Query result pointer - */ - public function execFinalQuery($list, $freeIndexUid = -1) - { - // Setting up methods of filtering results based on page types, access, etc. - $page_join = ''; - $page_where = ''; - // Calling hook for alternative creation of page ID list - if ($hookObj = $this->hookRequest('execFinalQuery_idList')) { - $page_where = $hookObj->execFinalQuery_idList($list); - } elseif ($this->join_pages) { - // Alternative to getting all page ids by ->getTreeList() where "excludeSubpages" is NOT respected. - $page_join = ', - pages'; - $page_where = 'pages.uid = ISEC.page_id - ' . $this->cObj->enableFields('pages') . ' - AND pages.no_search=0 - AND pages.doktype<200 - '; - } elseif ($this->wholeSiteIdList >= 0) { - // Collecting all pages IDs in which to search; filtering out ALL pages that are not accessible due to enableFields. Does NOT look for "no_search" field! - $siteIdNumbers = GeneralUtility::intExplode(',', $this->wholeSiteIdList); - $id_list = []; - foreach ($siteIdNumbers as $rootId) { - $id_list[] = $this->cObj->getTreeList(-1 * $rootId, 9999); - } - $page_where = 'ISEC.page_id IN (' . implode(',', $id_list) . ')'; - } else { - // Disable everything... (select all) - $page_where = '1=1'; - } - // Indexing configuration clause: - $freeIndexUidClause = $this->freeIndexUidWhere($freeIndexUid); - // If any of the ranking sortings are selected, we must make a join with the word/rel-table again, because we need to calculate ranking based on all search-words found. - if (substr($this->piVars['order'], 0, 5) === 'rank_') { - switch ($this->piVars['order']) { - case 'rank_flag': - // This gives priority to word-position (max-value) so that words in title, keywords, description counts more than in content. - // The ordering is refined with the frequency sum as well. - $grsel = 'MAX(IR.flags) AS order_val1, SUM(IR.freq) AS order_val2'; - $orderBy = 'order_val1' . $this->isDescending() . ',order_val2' . $this->isDescending(); - break; - case 'rank_first': - // Results in average position of search words on page. Must be inversely sorted (low numbers are closer to top) - $grsel = 'AVG(IR.first) AS order_val'; - $orderBy = 'order_val' . $this->isDescending(1); - break; - case 'rank_count': - // Number of words found - $grsel = 'SUM(IR.count) AS order_val'; - $orderBy = 'order_val' . $this->isDescending(); - break; - default: - // Frequency sum. I'm not sure if this is the best way to do it (make a sum...). Or should it be the average? - $grsel = 'SUM(IR.freq) AS order_val'; - $orderBy = 'order_val' . $this->isDescending(); - } - - // So, words are imploded into an OR statement (no "sentence search" should be done here - may deselect results) - $wordSel = '(' . implode(' OR ', $this->wSelClauses) . ') AND '; - - $res = $this->databaseConnection->exec_SELECTquery( - 'ISEC.*, IP.*, ' . $grsel, - 'index_words IW, - index_rel IR, - index_section ISEC, - index_phash IP' . $page_join, - $wordSel . - 'IP.phash IN (' . $list . ') ' . - $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . ' - AND IW.wid=IR.wid - AND ISEC.phash = IR.phash - AND IP.phash = IR.phash - AND ' . $page_where, - 'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,IP.data_filename ,IP.data_page_id ,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,IP.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', - $orderBy - ); - } else { - // Otherwise, if sorting are done with the pages table or other fields, there is no need for joining with the rel/word tables: - $orderBy = ''; - switch ((string)$this->piVars['order']) { - case 'title': - $orderBy = 'IP.item_title' . $this->isDescending(); - break; - case 'crdate': - $orderBy = 'IP.item_crdate' . $this->isDescending(); - break; - case 'mtime': - $orderBy = 'IP.item_mtime' . $this->isDescending(); - break; - } - $res = $this->databaseConnection->exec_SELECTquery('ISEC.*, IP.*', 'index_phash IP,index_section ISEC' . $page_join, 'IP.phash IN (' . $list . ') ' . $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . ' - AND IP.phash = ISEC.phash - AND ' . $page_where, 'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,IP.data_filename ,IP.data_page_id ,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,IP.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', $orderBy); - } - return $res; - } - - /** - * Checking if the resume can be shown for the search result (depending on whether the rights are OK) - * ? Should it also check for gr_list "0,-1"? - * - * @param array $row Result row array. - * @return bool Returns TRUE if resume can safely be shown - */ - public function checkResume($row) - { - // If the record is indexed by an indexing configuration, just show it. - // At least this is needed for external URLs and files. - // For records we might need to extend this - for instance block display if record is access restricted. - if ($row['freeIndexUid']) { - return true; - } - // Evaluate regularly indexed pages based on item_type: - if ($row['item_type']) { - // External media: - // For external media we will check the access of the parent page on which the media was linked from. - // "phash_t3" is the phash of the parent TYPO3 page row which initiated the indexing of the documents in this section. - // So, selecting for the grlist records belonging to the parent phash-row where the current users gr_list exists will help us to know. - // If this is NOT found, there is still a theoretical possibility that another user accessible page would display a link, so maybe the resume of such a document here may be unjustified hidden. But better safe than sorry. - if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) { - $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash_t3'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist')); - } else { - $res = false; - } - if ($res && $this->databaseConnection->sql_num_rows($res)) { - return true; - } else { - return false; - } - } else { - // Ordinary TYPO3 pages: - if ((string)$row['gr_list'] !== (string)$this->frontendController->gr_list) { - // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists. If it is found it is proof that this user has direct access to the phash-rows content although he did not himself initiate the indexing... - if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) { - $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist')); - } else { - $res = false; - } - if ($res && $this->databaseConnection->sql_num_rows($res)) { - return true; - } else { - return false; - } - } else { - return true; - } - } - } - - /** - * Returns "DESC" or "" depending on the settings of the incoming highest/lowest result order (piVars['desc'] - * - * @param bool $inverse If TRUE, inverse the order which is defined by piVars['desc'] - * @return string " DESC" or - */ - public function isDescending($inverse = false) - { - $desc = $this->piVars['desc']; - if ($inverse) { - $desc = !$desc; - } - return !$desc ? ' DESC' : ''; - } - - /** - * Write statistics information to database for the search operation - * - * @param array $sWArr Search Word array - * @param int $count Number of hits - * @param int $pt Milliseconds the search took - * @return void - */ - public function writeSearchStat($sWArr, $count, $pt) - { - $insertFields = [ - 'searchstring' => $this->piVars['sword'], - 'searchoptions' => serialize([$this->piVars, $sWArr, $pt]), - 'feuser_id' => (int)$GLOBALS['TSFE']->user['uid'], - // fe_user id, integer - 'cookie' => (string)$GLOBALS['TSFE']->id, - // cookie as set or retrieve. If people has cookies disabled this will vary all the time... - 'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'), - // Remote IP address - 'hits' => (int)$count, - // Number of hits on the search. - 'tstamp' => $GLOBALS['EXEC_TIME'] - ]; - $this->databaseConnection->exec_INSERTquery('index_stat_search', $insertFields); - $newId = $this->databaseConnection->sql_insert_id(); - if ($newId) { - foreach ($sWArr as $val) { - $insertFields = [ - 'word' => $val['sword'], - 'index_stat_search_id' => $newId, - 'tstamp' => $GLOBALS['EXEC_TIME'], - // Time stamp - 'pageid' => $this->frontendController->id - ]; - $this->databaseConnection->exec_INSERTquery('index_stat_word', $insertFields); - } - } - } - - /*********************************** - * - * HTML output functions - * - ***********************************/ - /** - * Make search form HTML - * - * @param array $optValues Value/Labels pairs for search form selector boxes. - * @return string Search form HTML - */ - public function makeSearchForm($optValues) - { - $html = $this->cObj->getSubpart($this->templateCode, '###SEARCH_FORM###'); - // Multilangual text - $substituteArray = ['legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid']; - foreach ($substituteArray as $marker) { - $markerArray['###FORM_' . strtoupper($marker) . '###'] = htmlspecialchars($this->pi_getLL('form_' . $marker)); - } - $markerArray['###FORM_SUBMIT###'] = htmlspecialchars($this->pi_getLL('submit_button_label')); - // Adding search field value - $markerArray['###SWORD_VALUE###'] = ''; - $markerArray['###PLACEHOLDER###'] = ''; - if (!empty($this->piVars['sword'])) { - $markerArray['###SWORD_VALUE###'] = htmlspecialchars($this->piVars['sword']); - } else { - // Add a HTML5 placeholder attribute if the configured doctype allows it - if ($GLOBALS['TSFE']->config['config']['doctype'] === 'html5') { - $markerArray['###PLACEHOLDER###'] = 'placeholder="' . $this->pi_getLL('default_search_word_entry') . '"'; - } else { - $markerArray['###SWORD_VALUE###'] = $this->pi_getLL('default_search_word_entry'); - } - } - // Additional keyword => "Add to current search words" - if ($this->conf['show.']['clearSearchBox'] && $this->conf['show.']['clearSearchBox.']['enableSubSearchCheckBox']) { - $markerArray['###SWORD_PREV_VALUE###'] = htmlspecialchars($this->conf['show.']['clearSearchBox'] ? '' : $this->piVars['sword']); - $markerArray['###SWORD_PREV_INCLUDE_CHECKED###'] = $this->piVars['sword_prev_include'] ? ' checked="checked"' : ''; - $markerArray['###ADD_TO_CURRENT_SEARCH###'] = htmlspecialchars($this->pi_getLL('makerating_addToCurrentSearch')); - } else { - $html = $this->cObj->substituteSubpart($html, '###ADDITONAL_KEYWORD###', ''); - } - $markerArray['###ACTION_URL###'] = htmlspecialchars($this->getSearchFormActionURL()); - $hiddenFieldCode = $this->cObj->getSubpart($this->templateCode, '###HIDDEN_FIELDS###'); - $hiddenFieldCode = preg_replace('/^\\n\\t(.+)/ms', '$1', $hiddenFieldCode); - // Remove first newline and tab (cosmetical issue) - $hiddenFieldArr = []; - foreach (GeneralUtility::trimExplode(',', $this->hiddenFieldList) as $fieldName) { - $hiddenFieldMarkerArray = []; - $hiddenFieldMarkerArray['###HIDDEN_FIELDNAME###'] = $this->prefixId . '[' . $fieldName . ']'; - $hiddenFieldMarkerArray['###HIDDEN_VALUE###'] = htmlspecialchars((string)$this->piVars[$fieldName]); - $hiddenFieldArr[$fieldName] = $this->cObj->substituteMarkerArrayCached($hiddenFieldCode, $hiddenFieldMarkerArray, [], []); - } - // Extended search - if ($this->piVars['ext']) { - // Search for - if (!is_array($optValues['type']) && !is_array($optValues['defOp']) || $this->conf['blind.']['type'] && $this->conf['blind.']['defOp']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_FOR###', ''); - } else { - if (is_array($optValues['type']) && !$this->conf['blind.']['type']) { - unset($hiddenFieldArr['type']); - $markerArray['###SELECTBOX_TYPE_VALUES###'] = $this->renderSelectBoxValues($this->piVars['type'], $optValues['type']); - } else { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_TYPE###', ''); - } - if (is_array($optValues['defOp']) || !$this->conf['blind.']['defOp']) { - $markerArray['###SELECTBOX_DEFOP_VALUES###'] = $this->renderSelectBoxValues($this->piVars['defOp'], $optValues['defOp']); - } else { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_DEFOP###', ''); - } - } - // Search in - if (!is_array($optValues['media']) && !is_array($optValues['lang']) || $this->conf['blind.']['media'] && $this->conf['blind.']['lang']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_IN###', ''); - } else { - if (is_array($optValues['media']) && !$this->conf['blind.']['media']) { - unset($hiddenFieldArr['media']); - $markerArray['###SELECTBOX_MEDIA_VALUES###'] = $this->renderSelectBoxValues($this->piVars['media'], $optValues['media']); - } else { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_MEDIA###', ''); - } - if (is_array($optValues['lang']) || !$this->conf['blind.']['lang']) { - unset($hiddenFieldArr['lang']); - $markerArray['###SELECTBOX_LANG_VALUES###'] = $this->renderSelectBoxValues($this->piVars['lang'], $optValues['lang']); - } else { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SEARCH_LANG###', ''); - } - } - // Sections - if (!is_array($optValues['sections']) || $this->conf['blind.']['sections']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_SECTION###', ''); - } else { - $markerArray['###SELECTBOX_SECTIONS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['sections'], $optValues['sections']); - } - // Free Indexing Configurations: - if (!is_array($optValues['freeIndexUid']) || $this->conf['blind.']['freeIndexUid']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_FREEINDEXUID###', ''); - } else { - $markerArray['###SELECTBOX_FREEINDEXUIDS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['freeIndexUid'], $optValues['freeIndexUid']); - } - // Sorting - if (!is_array($optValues['order']) || !is_array($optValues['desc']) || $this->conf['blind.']['order']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_ORDER###', ''); - } else { - unset($hiddenFieldArr['order']); - unset($hiddenFieldArr['desc']); - unset($hiddenFieldArr['results']); - $markerArray['###SELECTBOX_ORDER_VALUES###'] = $this->renderSelectBoxValues($this->piVars['order'], $optValues['order']); - $markerArray['###SELECTBOX_DESC_VALUES###'] = $this->renderSelectBoxValues($this->piVars['desc'], $optValues['desc']); - $markerArray['###SELECTBOX_RESULTS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['results'], $optValues['results']); - } - // Limits - if (!is_array($optValues['results']) || !is_array($optValues['results']) || $this->conf['blind.']['results']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_RESULTS###', ''); - } else { - $markerArray['###SELECTBOX_RESULTS_VALUES###'] = $this->renderSelectBoxValues($this->piVars['results'], $optValues['results']); - } - // Grouping - if (!is_array($optValues['group']) || $this->conf['blind.']['group']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_GROUP###', ''); - } else { - unset($hiddenFieldArr['group']); - $markerArray['###SELECTBOX_GROUP_VALUES###'] = $this->renderSelectBoxValues($this->piVars['group'], $optValues['group']); - } - if ($this->conf['blind.']['extResume']) { - $html = $this->cObj->substituteSubpart($html, '###SELECT_EXTRESUME###', ''); - } else { - $markerArray['###EXT_RESUME_CHECKED###'] = $this->piVars['extResume'] ? ' checked="checked"' : ''; - } - } else { - // Extended search - $html = $this->cObj->substituteSubpart($html, '###SEARCH_FORM_EXTENDED###', ''); - } - if ($this->conf['show.']['advancedSearchLink']) { - $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre) : $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre, [$this->prefixId . '[ext]' => 1]); - $markerArray['###LINKTOOTHERMODE###'] = '<a href="' . htmlspecialchars($linkToOtherMode) . '">' . htmlspecialchars($this->pi_getLL(($this->piVars['ext'] ? 'link_regularSearch' : 'link_advancedSearch'))) . '</a>'; - } else { - $markerArray['###LINKTOOTHERMODE###'] = ''; - } - // Write all hidden fields - $html = $this->cObj->substituteSubpart($html, '###HIDDEN_FIELDS###', implode('', $hiddenFieldArr)); - $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, [], []); - return $substitutedContent; - } - - /** - * Function, rendering selector box values. - * - * @param string $value Current value - * @param array $optValues Array with the options as key=>value pairs - * @return string <options> imploded. - */ - public function renderSelectBoxValues($value, $optValues) - { - if (!is_array($optValues)) { - return ''; - } - $opt = []; - $isSelFlag = 0; - foreach ($optValues as $k => $v) { - $sel = (string)$k === (string)$value ? ' selected="selected"' : ''; - if ($sel) { - $isSelFlag++; - } - $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>'; - } - return implode('', $opt); - } - - /** - * Print the searching rules - * - * @return string Rules for the search - */ - public function printRules() - { - if (!$this->conf['show.']['rules']) { - return ''; - } - $html = $this->cObj->getSubpart($this->templateCode, '###RULES###'); - $markerArray['###RULES_HEADER###'] = htmlspecialchars($this->pi_getLL('rules_header')); - $markerArray['###RULES_TEXT###'] = nl2br(trim(htmlspecialchars($this->pi_getLL('rules_text')))); - $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, [], []); - return $this->cObj->stdWrap($substitutedContent, $this->conf['rules_stdWrap.']); - } - - /** - * Returns the anchor-links to the sections inside the displayed result rows. - * - * @return string - */ - public function printResultSectionLinks() - { - if (empty($this->resultSections)) { - return ''; - } - $links = []; - $html = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS###'); - $item = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS_LINK###'); - $anchorPrefix = $GLOBALS['TSFE']->baseUrl ? substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), strlen(GeneralUtility::getIndpEnv('TYPO3_SITE_URL'))) : ''; - foreach ($this->resultSections as $id => $dat) { - $markerArray = []; - $aBegin = '<a href="' . htmlspecialchars($anchorPrefix . '#anchor_' . md5($id)) . '">'; - $aContent = (trim($dat[0]) ? trim($dat[0]) : htmlspecialchars($this->pi_getLL('unnamedSection'))) . ' (' . $dat[1] . ' ' . htmlspecialchars($this->pi_getLL(($dat[1] > 1 ? 'word_pages' : 'word_page'))) . ')'; - $aEnd = '</a>'; - $markerArray['###LINK###'] = $aBegin . $aContent . $aEnd; - $links[] = $this->cObj->substituteMarkerArrayCached($item, $markerArray, [], []); - } - $html = $this->cObj->substituteMarkerArrayCached($html, ['###LINKS###' => implode('', $links)], [], []); - return '<div' . $this->pi_classParam('sectionlinks') . '>' . $this->cObj->stdWrap($html, $this->conf['sectionlinks_stdWrap.']) . '</div>'; - } - - /** - * Returns the section header of the search result. - * - * @param string $id ID for the section (used for anchor link) - * @param string $sectionTitleLinked Section title with linked wrapped around - * @param int $countResultRows Number of results in section - * @return string HTML output - */ - public function makeSectionHeader($id, $sectionTitleLinked, $countResultRows) - { - $html = $this->cObj->getSubpart($this->templateCode, '###SECTION_HEADER###'); - $markerArray['###ANCHOR_URL###'] = 'anchor_' . md5($id); - $markerArray['###SECTION_TITLE###'] = $sectionTitleLinked; - $markerArray['###RESULT_COUNT###'] = $countResultRows; - $markerArray['###RESULT_NAME###'] = $this->pi_getLL('word_page' . ($countResultRows > 1 ? 's' : '')); - $substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, [], []); - return $substitutedContent; - } - - /** - * This prints a single result row, including a recursive call for subrows. - * - * @param array $row Search result row - * @param int $headerOnly 1=Display only header (for sub-rows!), 2=nothing at all - * @return string HTML code - */ - public function printResultRow($row, $headerOnly = 0) - { - // Get template content: - $tmplContent = $this->prepareResultRowTemplateData($row, $headerOnly); - if ($hookObj = $this->hookRequest('printResultRow')) { - return $hookObj->printResultRow($row, $headerOnly, $tmplContent); - } else { - $html = $this->cObj->getSubpart($this->templateCode, '###RESULT_OUTPUT###'); - if (!is_array($row['_sub'])) { - $html = $this->cObj->substituteSubpart($html, '###ROW_SUB###', ''); - } - if (!$headerOnly) { - $html = $this->cObj->substituteSubpart($html, '###ROW_SHORT###', ''); - } elseif ($headerOnly == 1) { - $html = $this->cObj->substituteSubpart($html, '###ROW_LONG###', ''); - } elseif ($headerOnly == 2) { - $html = $this->cObj->substituteSubpart($html, '###ROW_SHORT###', ''); - $html = $this->cObj->substituteSubpart($html, '###ROW_LONG###', ''); - } - if (is_array($tmplContent)) { - foreach ($tmplContent as $k => $v) { - $markerArray['###' . strtoupper($k) . '###'] = $v; - } - } - // Description text - $markerArray['###TEXT_ITEM_SIZE###'] = htmlspecialchars($this->pi_getLL('res_size')); - $markerArray['###TEXT_ITEM_CRDATE###'] = htmlspecialchars($this->pi_getLL('res_created')); - $markerArray['###TEXT_ITEM_MTIME###'] = htmlspecialchars($this->pi_getLL('res_modified')); - $markerArray['###TEXT_ITEM_PATH###'] = htmlspecialchars($this->pi_getLL('res_path')); - $html = $this->cObj->substituteMarkerArrayCached($html, $markerArray, [], []); - // If there are subrows (eg. subpages in a PDF-file or if a duplicate page is selected due to user-login (phash_grouping)) - if (is_array($row['_sub'])) { - if ($this->multiplePagesType($row['item_type'])) { - $html = str_replace('###TEXT_ROW_SUB###', htmlspecialchars($this->pi_getLL('res_otherMatching')), $html); - foreach ($row['_sub'] as $subRow) { - $html .= $this->printResultRow($subRow, 1); - } - } else { - $markerArray['###TEXT_ROW_SUB###'] = htmlspecialchars($this->pi_getLL('res_otherMatching')); - $html = str_replace('###TEXT_ROW_SUB###', htmlspecialchars($this->pi_getLL('res_otherPageAsWell')), $html); - } - } - return $html; - } - } - - /** - * Returns a results browser, former method name: pi_list_browseresults - * - * @param bool $showResultCount Show result count - * @param string $addString String appended to "displaying results..." notice. - * @param string $addPart String appended after section "displaying results... - * @param string $freeIndexUid List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration! - * @return string HTML output - */ - protected function renderPagination($showResultCount = true, $addString = '', $addPart = '', $freeIndexUid = -1) - { - // Initializing variables: - $pointer = (int)$this->piVars['pointer']; - $count = (int)$this->internal['res_count']; - $results_at_a_time = MathUtility::forceIntegerInRange($this->internal['results_at_a_time'], 1, 1000); - $pageCount = (int)ceil($count / $results_at_a_time); - - $links = []; - // only show the result browser if more than one page is needed - if ($pageCount > 1) { - $maxPages = MathUtility::forceIntegerInRange($this->internal['maxPages'], 1, $pageCount); - - // Make browse-table/links: - if ($pointer > 0) { - // all pages after the 1st one - $links[] = '<li>' . $this->makePointerSelector_link(htmlspecialchars($this->pi_getLL('pi_list_browseresults_prev', '< Previous')), $pointer - 1, $freeIndexUid) . '</li>'; - } - $minPage = $pointer - (int)floor($maxPages / 2); - $maxPage = $minPage + $maxPages - 1; - // Check if the indexes are within the page limits - if ($minPage < 0) { - $maxPage -= $minPage; - $minPage = 0; - } elseif ($maxPage >= $pageCount) { - $minPage -= $maxPage - $pageCount + 1; - $maxPage = $pageCount - 1; - } - $pageLabel = htmlspecialchars($this->pi_getLL('pi_list_browseresults_page', 'Page')); - for ($a = $minPage; $a <= $maxPage; $a++) { - $label = trim($pageLabel . ' ' . ($a + 1)); - $link = $this->makePointerSelector_link($label, $a, $freeIndexUid); - if ($a === $pointer) { - $links[] = '<li' . $this->pi_classParam('browselist-currentPage') . '><strong>' . $link . '</strong></li>'; - } else { - $links[] = '<li>' . $link . '</li>'; - } - } - if ($pointer + 1 < $pageCount) { - $links[] = '<li>' . $this->makePointerSelector_link(htmlspecialchars($this->pi_getLL('pi_list_browseresults_next', 'Next >')), $pointer + 1, $freeIndexUid) . '</li>'; - } - } - if (!empty($links)) { - $addPart .= ' - <ul class="browsebox"> - ' . implode('', $links) . ' - </ul>'; - } - $label = str_replace( - ['###TAG_BEGIN###', '###TAG_END###'], - ['<strong>', '</strong>'], - $this->pi_getLL('pi_list_browseresults_display', 'Displaying results ###TAG_BEGIN###%1$s to %2$s###TAG_END### out of ###TAG_BEGIN###%3$s###TAG_END###') - ); - $resultsFrom = $pointer * $results_at_a_time + 1; - $resultsTo = min($resultsFrom + $results_at_a_time - 1, $count); - $resultCountText = ''; - if ($showResultCount) { - $resultCountText = '<p>' . sprintf($label, $resultsFrom, $resultsTo, $count) . $addString . '</p>'; - } - $sTables = '<div' . $this->pi_classParam('browsebox') . '>' - . $resultCountText - . $addPart . '</div>'; - return $sTables; - } - - /*********************************** - * - * Support functions for HTML output (with a minimum of fixed markup) - * - ***********************************/ - /** - * Preparing template data for the result row output - * - * @param array $row Result row - * @param bool $headerOnly If set, display only header of result (for sub-results) - * @return array Array with data to insert in result row template - */ - public function prepareResultRowTemplateData($row, $headerOnly) - { - // Initialize: - $specRowConf = $this->getSpecialConfigForRow($row); - $CSSsuffix = $specRowConf['CSSsuffix'] ? '-' . $specRowConf['CSSsuffix'] : ''; - // If external media, link to the media-file instead. - if ($row['item_type']) { - // External media - if ($row['show_resume']) { - // Can link directly. - $targetAttribute = ''; - if ($this->frontendController->config['config']['fileTarget']) { - $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"'; - } - $title = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($this->makeTitle($row)) . '</a>'; - } else { - // Suspicious, so linking to page instead... - $copy_row = $row; - unset($copy_row['cHashParams']); - $title = $this->linkPage($row['page_id'], htmlspecialchars($this->makeTitle($row)), $copy_row); - } - } else { - // Else the page: - // Prepare search words for markup in content: - if ($this->conf['forwardSearchWordsInResultLink']) { - if ($this->conf['forwardSearchWordsInResultLink.']['no_cache']) { - $markUpSwParams = ['no_cache' => 1]; - } else { - $markUpSwParams = []; - } - foreach ($this->sWArr as $d) { - $markUpSwParams['sword_list'][] = $d['sword']; - } - } else { - $markUpSwParams = []; - } - $title = $this->linkPage($row['data_page_id'], htmlspecialchars($this->makeTitle($row)), $row, $markUpSwParams); - } - $tmplContent = []; - $tmplContent['title'] = $title; - $tmplContent['result_number'] = $this->conf['show.']['resultNumber'] ? $row['result_number'] . ': ' : ' '; - $tmplContent['icon'] = $this->makeItemTypeIcon($row['item_type'], '', $specRowConf); - $tmplContent['rating'] = $this->makeRating($row); - $tmplContent['description'] = $this->makeDescription( - $row, - !($this->piVars['extResume'] && !$headerOnly), - $this->conf['results.']['summaryCropAfter'] - ); - $tmplContent = $this->makeInfo($row, $tmplContent); - $tmplContent['access'] = $this->makeAccessIndication($row['page_id']); - $tmplContent['language'] = $this->makeLanguageIndication($row); - $tmplContent['CSSsuffix'] = $CSSsuffix; - // Post processing with hook. - if ($hookObj = $this->hookRequest('prepareResultRowTemplateData_postProc')) { - $tmplContent = $hookObj->prepareResultRowTemplateData_postProc($tmplContent, $row, $headerOnly); - } - return $tmplContent; - } - - /** - * Returns a string that tells which search words are searched for. - * - * @param array Array of search words - * @return string HTML telling what is searched for. - */ - public function tellUsWhatIsSeachedFor($sWArr) - { - // Init: - $searchingFor = ''; - $c = 0; - // Traverse search words: - foreach ($sWArr as $k => $v) { - if ($c) { - switch ($v['oper']) { - case 'OR': - $searchingFor .= ' ' . htmlspecialchars($this->pi_getLL('searchFor_or')) . ' ' . $this->wrapSW($v['sword']); - break; - case 'AND NOT': - $searchingFor .= ' ' . htmlspecialchars($this->pi_getLL('searchFor_butNot')) . ' ' . $this->wrapSW($v['sword']); - break; - default: - // AND... - $searchingFor .= ' ' . htmlspecialchars($this->pi_getLL('searchFor_and')) . ' ' . $this->wrapSW($v['sword']); - } - } else { - $searchingFor = htmlspecialchars($this->pi_getLL('searchFor')) . ' ' . $this->wrapSW($v['sword']); - } - $c++; - } - return $searchingFor; - } - - /** - * Wraps the search words in the search-word list display (from ->tellUsWhatIsSeachedFor()) - * - * @param string $str search word to wrap (in local charset!) - * @return string Search word wrapped in <span> tag. - */ - public function wrapSW($str) - { - return '"<span' . $this->pi_classParam('sw') . '>' . htmlspecialchars($str) . '</span>"'; - } - - /** - * Makes a selector box - * - * @param string $name Name of selector box - * @param string $value Current value - * @param array $optValues Array of options in the selector box (value => label pairs) - * @return string HTML of selector box - */ - public function renderSelectBox($name, $value, $optValues) - { - if (is_array($optValues)) { - $opt = []; - $isSelFlag = 0; - foreach ($optValues as $k => $v) { - $sel = (string)$k === (string)$value ? ' selected="selected"' : ''; - if ($sel) { - $isSelFlag++; - } - $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>'; - } - return '<select name="' . $name . '">' . implode('', $opt) . '</select>'; - } - } - - /** - * Used to make the link for the result-browser. - * Notice how the links must resubmit the form after setting the new pointer-value in a hidden formfield. - * - * @param string $str String to wrap in <a> tag - * @param int $p Pointer value - * @param string $freeIndexUid List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration! - * @return string Input string wrapped in <a> tag with onclick event attribute set. - */ - public function makePointerSelector_link($str, $p, $freeIndexUid) - { - $onclick = 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId . '_pointer') . ').value=' . GeneralUtility::quoteJSvalue($p) . ';' . 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId . '_freeIndexUid') . ').value=' . GeneralUtility::quoteJSvalue($freeIndexUid) . ';' . 'document.getElementById(' . GeneralUtility::quoteJSvalue($this->prefixId) . ').submit();return false;'; - return '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $str . '</a>'; - } - - /** - * Return icon for file extension - * - * @param string $it File extension / item type - * @param string $alt Title attribute value in icon. - * @param array $specRowConf TypoScript configuration specifically for search result. - * @return string <img> tag for icon - */ - public function makeItemTypeIcon($it, $alt = '', $specRowConf) - { - // Build compound key if item type is 0, iconRendering is not used - // and specConfs.[pid].pageIcon was set in TS - if ($it === '0' && $specRowConf['_pid'] && is_array($specRowConf['pageIcon.']) && !is_array($this->conf['iconRendering.'])) { - $it .= ':' . $specRowConf['_pid']; - } - if (!isset($this->iconFileNameCache[$it])) { - $this->iconFileNameCache[$it] = ''; - // If TypoScript is used to render the icon: - if (is_array($this->conf['iconRendering.'])) { - $this->cObj->setCurrentVal($it); - $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle($this->conf['iconRendering'], $this->conf['iconRendering.']); - } else { - // Default creation / finding of icon: - $icon = ''; - if ($it === '0' || substr($it, 0, 2) === '0:') { - if (is_array($specRowConf['pageIcon.'])) { - $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle('IMAGE', $specRowConf['pageIcon.']); - } else { - $icon = 'EXT:indexed_search/Resources/Public/Icons/FileTypes/pages.gif'; - } - } elseif ($this->external_parsers[$it]) { - $icon = $this->external_parsers[$it]->getIcon($it); - } - if ($icon) { - $fullPath = GeneralUtility::getFileAbsFileName($icon); - if ($fullPath) { - $info = @getimagesize($fullPath); - $iconPath = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($fullPath); - $this->iconFileNameCache[$it] = is_array($info) ? '<img src="' . $iconPath . '" ' . $info[3] . ' title="' . htmlspecialchars($alt) . '" alt="" />' : ''; - } - } - } - } - return $this->iconFileNameCache[$it]; - } - - /** - * Return the rating-HTML code for the result row. This makes use of the $this->firstRow - * - * @param array $row Result row array - * @return string String showing ranking value - */ - public function makeRating($row) - { - switch ((string)$this->piVars['order']) { - case 'rank_count': - // Number of occurencies on page - return $row['order_val'] . ' ' . $this->pi_getLL('maketitle_matches'); - break; - case 'rank_first': - // Close to top of page - return ceil(MathUtility::forceIntegerInRange((255 - $row['order_val']), 1, 255) / 255 * 100) . '%'; - break; - case 'rank_flag': - // Based on priority assigned to <title> / <meta-keywords> / <meta-description> / <body> - if ($this->firstRow['order_val2']) { - $base = $row['order_val1'] * 256; - // (3 MSB bit, 224 is highest value of order_val1 currently) - $freqNumber = $row['order_val2'] / $this->firstRow['order_val2'] * pow(2, 12); - // 15-3 MSB = 12 - $total = MathUtility::forceIntegerInRange($base + $freqNumber, 0, 32767); - return ceil(log($total) / log(32767) * 100) . '%'; - } - break; - case 'rank_freq': - // Based on frequency - $max = 10000; - $total = MathUtility::forceIntegerInRange($row['order_val'], 0, $max); - return ceil(log($total) / log($max) * 100) . '%'; - break; - case 'crdate': - // Based on creation date - return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_crdate'], 0); - break; - case 'mtime': - // Based on modification time - return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_mtime'], 0); - break; - default: - // fx. title - return ' '; - } - } - - /** - * Returns the resume for the search-result. - * - * @param array $row Search result row - * @param bool $noMarkup If noMarkup is FALSE, then the index_fulltext table is used to select the content of the page, split it with regex to display the search words in the text. - * @param int $lgd String length - * @return string HTML string - */ - public function makeDescription($row, $noMarkup = false, $lgd = 180) - { - if ($row['show_resume']) { - $markedSW = ''; - $outputStr = ''; - if (!$noMarkup) { - if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_fulltext')) { - $res = $this->databaseConnection->exec_SELECTquery('*', 'index_fulltext', 'phash=' . (int)$row['phash']); - } else { - $res = false; - } - if ($res) { - if ($ftdrow = $this->databaseConnection->sql_fetch_assoc($res)) { - // Cut HTTP references after some length - $content = preg_replace('/(http:\\/\\/[^ ]{' . $this->conf['results.']['hrefInSummaryCropAfter'] . '})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']); - $markedSW = $this->markupSWpartsOfString($content); - } - $this->databaseConnection->sql_free_result($res); - } - } - if (!trim($markedSW)) { - $outputStr = $this->charsetConverter->crop('utf-8', $row['item_description'], $lgd, $this->conf['results.']['summaryCropSignifier']); - $outputStr = htmlspecialchars($outputStr); - } - $output = $outputStr ?: $markedSW; - } else { - $output = '<span class="noResume">' . htmlspecialchars($this->pi_getLL('res_noResume')) . '</span>'; - } - return $output; - } - - /** - * Marks up the search words from $this->sWarr in the $str with a color. - * - * @param string $str Text in which to find and mark up search words. This text is assumed to be UTF-8 like the search words internally is. - * @return string Processed content. - */ - public function markupSWpartsOfString($str) - { - $htmlParser = GeneralUtility::makeInstance(HtmlParser::class); - // Init: - $str = str_replace(' ', ' ', $htmlParser->bidir_htmlspecialchars($str, -1)); - $str = preg_replace('/\\s\\s+/', ' ', $str); - $swForReg = []; - // Prepare search words for regex: - foreach ($this->sWArr as $d) { - $swForReg[] = preg_quote($d['sword'], '/'); - } - $regExString = '(' . implode('|', $swForReg) . ')'; - // Split and combine: - $parts = preg_split('/' . $regExString . '/ui', ' ' . $str . ' ', 20000, PREG_SPLIT_DELIM_CAPTURE); - // Constants: - $summaryMax = $this->conf['results.']['markupSW_summaryMax']; - $postPreLgd = $this->conf['results.']['markupSW_postPreLgd']; - $postPreLgd_offset = $this->conf['results.']['markupSW_postPreLgd_offset']; - $divider = $this->conf['results.']['markupSW_divider']; - $occurencies = (count($parts) - 1) / 2; - if ($occurencies) { - $postPreLgd = MathUtility::forceIntegerInRange($summaryMax / $occurencies, $postPreLgd, $summaryMax / 2); - } - // Variable: - $summaryLgd = 0; - $output = []; - // Shorten in-between strings: - foreach ($parts as $k => $strP) { - if ($k % 2 == 0) { - // Find length of the summary part: - $strLen = mb_strlen($parts[$k], 'utf-8'); - $output[$k] = $parts[$k]; - // Possibly shorten string: - if (!$k) { - // First entry at all (only cropped on the frontside) - if ($strLen > $postPreLgd) { - $output[$k] = $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->charsetConverter->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset))); - } - } elseif ($summaryLgd > $summaryMax || !isset($parts[$k + 1])) { - // In case summary length is exceed OR if there are no more entries at all: - if ($strLen > $postPreLgd) { - $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->charsetConverter->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider; - } - } else { - // In-between search words: - if ($strLen > $postPreLgd * 2) { - $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->charsetConverter->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->charsetConverter->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset))); - } - } - $summaryLgd += mb_strlen($output[$k], 'utf-8'); - // Protect output: - $output[$k] = htmlspecialchars($output[$k]); - // If summary lgd is exceed, break the process: - if ($summaryLgd > $summaryMax) { - break; - } - } else { - $summaryLgd += mb_strlen($strP, 'utf-8'); - $output[$k] = '<strong class="tx-indexedsearch-redMarkup">' . htmlspecialchars($parts[$k]) . '</strong>'; - } - } - // Return result: - return implode('', $output); - } - - /** - * Returns the title of the search result row - * - * @param array $row Result row - * @return string Title from row - */ - public function makeTitle($row) - { - $add = ''; - if ($this->multiplePagesType($row['item_type'])) { - $dat = unserialize($row['cHashParams']); - $pp = explode('-', $dat['key']); - if ($pp[0] != $pp[1]) { - $add = ', ' . $this->pi_getLL('word_pages') . ' ' . $dat['key']; - } else { - $add = ', ' . $this->pi_getLL('word_page') . ' ' . $pp[0]; - } - } - $outputString = $this->charsetConverter->crop('utf-8', $row['item_title'], $this->conf['results.']['titleCropAfter'], $this->conf['results.']['titleCropSignifier']); - return $outputString . $add; - } - - /** - * Returns the info-string in the bottom of the result-row display (size, dates, path) - * - * @param array $row Result row - * @param array $tmplArray Template array to modify - * @return array Modified template array - */ - public function makeInfo($row, $tmplArray) - { - $tmplArray['size'] = GeneralUtility::formatSize($row['item_size']); - $tmplArray['created'] = $this->formatCreatedDate($row['item_crdate']); - $tmplArray['modified'] = $this->formatModifiedDate($row['item_mtime']); - $pathId = $row['data_page_id'] ?: $row['page_id']; - $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : ''; - $pI = parse_url($row['data_filename']); - if ($pI['scheme']) { - $targetAttribute = ''; - if ($this->frontendController->config['config']['fileTarget']) { - $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"'; - } - $tmplArray['path'] = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($row['data_filename']) . '</a>'; - } else { - $pathStr = $this->getPathFromPageId($pathId, $pathMP); - $tmplArray['path'] = $this->linkPage($pathId, $pathStr, [ - 'cHashParams' => $row['cHashParams'], - 'data_page_type' => $row['data_page_type'], - 'data_page_mp' => $pathMP, - 'sys_language_uid' => $row['sys_language_uid'] - ]); - } - return $tmplArray; - } - - /** - * Returns configuration from TypoScript for result row based on ID / location in page tree! - * - * @param array $row Result row - * @return array Configuration array - */ - public function getSpecialConfigForRow($row) - { - $pathId = $row['data_page_id'] ?: $row['page_id']; - $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : ''; - $rl = $this->getRootLine($pathId, $pathMP); - $specConf = $this->conf['specConfs.']['0.']; - if (is_array($rl)) { - foreach ($rl as $dat) { - if (is_array($this->conf['specConfs.'][$dat['uid'] . '.'])) { - $specConf = $this->conf['specConfs.'][$dat['uid'] . '.']; - $specConf['_pid'] = $dat['uid']; - break; - } - } - } - return $specConf; - } - - /** - * Returns the HTML code for language indication. - * - * @param array $row Result row - * @return string HTML code for result row. - */ - public function makeLanguageIndication($row) - { - // If search result is a TYPO3 page: - if ((string)$row['item_type'] === '0') { - // If TypoScript is used to render the flag: - if (is_array($this->conf['flagRendering.'])) { - $this->cObj->setCurrentVal($row['sys_language_uid']); - return $this->cObj->cObjGetSingle($this->conf['flagRendering'], $this->conf['flagRendering.']); - } - } - return ' '; - } - - /** - * Returns the HTML code for the locking symbol. - * NOTICE: Requires a call to ->getPathFromPageId() first in order to work (done in ->makeInfo() by calling that first) - * - * @param int $id Page id for which to find answer - * @return string <img> tag if access is limited. - */ - public function makeAccessIndication($id) - { - if (is_array($this->fe_groups_required[$id]) && !empty($this->fe_groups_required[$id])) { - return '<img src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('indexed_search') . 'Resources/Public/Icons/FileTypes/locked.gif" width="12" height="15" vspace="5" title="' . sprintf(htmlspecialchars($this->pi_getLL('res_memberGroups')), implode(',', array_unique($this->fe_groups_required[$id]))) . '" alt="" />'; - } - - return ''; - } - - /** - * Links the $str to page $id - * - * @param int $id Page id - * @param string $str Title String to link - * @param array $row Result row - * @param array $markUpSwParams Additional parameters for marking up search words - * @return string <A> tag wrapped title string. - */ - public function linkPage($id, $str, $row = [], $markUpSwParams = []) - { - // Parameters for link: - $urlParameters = (array)unserialize($row['cHashParams']); - // Add &type and &MP variable: - if ($row['data_page_type']) { - $urlParameters['type'] = $row['data_page_type']; - } - if ($row['data_page_mp']) { - $urlParameters['MP'] = $row['data_page_mp']; - } - $urlParameters['L'] = intval($row['sys_language_uid']); - // markup-GET vars: - $urlParameters = array_merge($urlParameters, $markUpSwParams); - // This will make sure that the path is retrieved if it hasn't been already. Used only for the sake of the domain_record thing... - if (!is_array($this->domain_records[$id])) { - $this->getPathFromPageId($id); - } - // If external domain, then link to that: - if (!empty($this->domain_records[$id])) { - reset($this->domain_records[$id]); - $firstDom = current($this->domain_records[$id]); - $scheme = GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://'; - $addParams = ''; - if (is_array($urlParameters) && !empty($urlParameters)) { - $addParams .= GeneralUtility::implodeArrayForUrl('', $urlParameters); - } - if ($target = $this->conf['search.']['detect_sys_domain_records.']['target']) { - $target = ' target="' . $target . '"'; - } - return '<a href="' . htmlspecialchars(($scheme . $firstDom . '/index.php?id=' . $id . $addParams)) . '"' . $target . '>' . htmlspecialchars($str) . '</a>'; - } else { - return $this->pi_linkToPage($str, $id, $this->conf['result_link_target'], $urlParameters); - } - } - - /** - * Returns the path to the page $id - * - * @param int $id Page ID - * @param string $pathMP MP variable content. - * @return string Root line for result. - */ - public function getRootLine($id, $pathMP = '') - { - $identStr = $id . '|' . $pathMP; - if (!isset($this->cache_path[$identStr])) { - $this->cache_rl[$identStr] = $this->frontendController->sys_page->getRootLine($id, $pathMP); - } - return $this->cache_rl[$identStr]; - } - - /** - * Gets the first sys_domain record for the page, $id - * - * @param int $id Page id - * @return string Domain name - */ - public function getFirstSysDomainRecordForPage($id) - { - $res = $this->databaseConnection->exec_SELECTquery('domainName', 'sys_domain', 'pid=' . (int)$id . $this->cObj->enableFields('sys_domain'), '', 'sorting'); - $row = $this->databaseConnection->sql_fetch_assoc($res); - return rtrim($row['domainName'], '/'); - } - - /** - * Returns the path to the page $id - * - * @param int $id Page ID - * @param string $pathMP MP variable content - * @return string Path (HTML-escaped) - */ - public function getPathFromPageId($id, $pathMP = '') - { - $identStr = $id . '|' . $pathMP; - if (!isset($this->cache_path[$identStr])) { - $this->fe_groups_required[$id] = []; - $this->domain_records[$id] = []; - $rl = $this->getRootLine($id, $pathMP); - $path = ''; - $pageCount = count($rl); - if (is_array($rl) && !empty($rl)) { - $breadcrumbWrap = isset($this->conf['breadcrumbWrap']) ? $this->conf['breadcrumbWrap'] : '/'; - $breadcrumbWraps = $GLOBALS['TSFE']->tmpl->splitConfArray(['wrap' => $breadcrumbWrap], $pageCount); - foreach ($rl as $k => $v) { - // Check fe_user - if ($v['fe_group'] && ($v['uid'] == $id || $v['extendToSubpages'])) { - $this->fe_groups_required[$id][] = $v['fe_group']; - } - // Check sys_domain. - if ($this->conf['search.']['detect_sys_domain_records']) { - $sysDName = $this->getFirstSysDomainRecordForPage($v['uid']); - if ($sysDName) { - $this->domain_records[$id][] = $sysDName; - // Set path accordingly: - $path = $sysDName . $path; - break; - } - } - // Stop, if we find that the current id is the current root page. - if ($v['uid'] == $this->frontendController->config['rootLine'][0]['uid']) { - array_pop($breadcrumbWraps); - break; - } - $path = $this->cObj->wrap(htmlspecialchars($v['title']), array_pop($breadcrumbWraps)['wrap']) . $path; - } - } - $this->cache_path[$identStr] = $path; - if (is_array($this->conf['path_stdWrap.'])) { - $this->cache_path[$identStr] = $this->cObj->stdWrap($this->cache_path[$identStr], $this->conf['path_stdWrap.']); - } - } - return $this->cache_path[$identStr]; - } - - /** - * Return the menu of pages used for the selector. - * - * @param int $id Page ID for which to return menu - * @return array Menu items (for making the section selector box) - */ - public function getMenu($id) - { - if ($this->conf['show.']['LxALLtypes']) { - $output = []; - $res = $this->databaseConnection->exec_SELECTquery('title,uid', 'pages', 'pid=' . (int)$id . $this->cObj->enableFields('pages'), '', 'sorting'); - while ($row = $this->databaseConnection->sql_fetch_assoc($res)) { - $output[$row['uid']] = $this->frontendController->sys_page->getPageOverlay($row); - } - $this->databaseConnection->sql_free_result($res); - return $output; - } else { - return $this->frontendController->sys_page->getMenu($id); - } - } - - /** - * Returns if an item type is a multipage item type - * - * @param string $item_type Item type - * @return bool TRUE if multipage capable - */ - public function multiplePagesType($item_type) - { - return is_object($this->external_parsers[$item_type]) && $this->external_parsers[$item_type]->isMultiplePageExtension($item_type); - } - - /** - * Converts the input string from utf-8 to the backend charset. - * - * @param string String to convert (utf-8) - * @return string Converted string (backend charset if different from utf-8) - * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 - */ - public function utf8_to_currentCharset($str) - { - GeneralUtility::logDeprecatedFunction(); - return $str; - } - - /** - * Returns an object reference to the hook object if any - * - * @param string $functionName Name of the function you want to call / hook key - * @return object|NULL Hook object, if any. Otherwise NULL. - */ - public function hookRequest($functionName) - { - // Hook: menuConfig_preProcessModMenu - if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]) { - $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]); - if (method_exists($hookObj, $functionName)) { - $hookObj->pObj = $this; - return $hookObj; - } - } - } - - /** - * Obtains the URL of the search target page - * - * @return string - */ - protected function getSearchFormActionURL() - { - $targetUrlPid = $this->getSearchFormActionPidFromTS(); - if ($targetUrlPid == 0) { - $targetUrlPid = $this->frontendController->id; - } - return $this->pi_getPageLink($targetUrlPid, $this->frontendController->sPre); - } - - /** - * Obtains search form target pid from the TypoScript configuration - * - * @return int - */ - protected function getSearchFormActionPidFromTS() - { - $result = 0; - if (isset($this->conf['search.']['targetPid']) || isset($this->conf['search.']['targetPid.'])) { - if (is_array($this->conf['search.']['targetPid.'])) { - $result = $this->cObj->stdWrap($this->conf['search.']['targetPid'], $this->conf['search.']['targetPid.']); - } else { - $result = $this->conf['search.']['targetPid']; - } - $result = (int)$result; - } - return $result; - } - - /** - * Formats date as 'created' date - * - * @param int $date - * @return string - */ - protected function formatCreatedDate($date) - { - $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']; - return $this->formatDate($date, 'created', $defaultFormat); - } - - /** - * Formats date as 'modified' date - * - * @param int $date - * @return string - */ - protected function formatModifiedDate($date) - { - $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; - return $this->formatDate($date, 'modified', $defaultFormat); - } - - /** - * Formats the date using format string from TypoScript or default format - * if TypoScript format is not set - * - * @param int $date - * @param string $tsKey - * @param string $defaultFormat - * @return string - */ - protected function formatDate($date, $tsKey, $defaultFormat) - { - $strftimeFormat = $this->conf['dateFormat.'][$tsKey]; - if ($strftimeFormat) { - $result = strftime($strftimeFormat, $date); - } else { - $result = date($defaultFormat, $date); - } - return $result; - } - - /** - * Search type - * e.g. sentence (20), any part of the word (1) - * - * @return int - */ - public function getSearchType() - { - return (int)$this->piVars['type']; - } - - /** - * A list of integer which should be root-pages to search from - * - * @return int[] - */ - public function getSearchRootPageIdList() - { - return \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->wholeSiteIdList); - } - - /** - * Getter for join_pages flag - * enabled through $this->conf['search.']['skipExtendToSubpagesChecking'] - * - * @return bool - */ - public function getJoinPagesForQuery() - { - return (bool)$this->join_pages; - } - - /** - * Load settings and apply stdWrap to them - */ - protected function loadSettings() - { - if (!is_array($this->conf['results.'])) { - $this->conf['results.'] = []; - } - $this->conf['results.']['summaryCropAfter'] = MathUtility::forceIntegerInRange( - $this->cObj->stdWrap($this->conf['results.']['summaryCropAfter'], $this->conf['results.']['summaryCropAfter.']), - 10, 5000, 180 - ); - $this->conf['results.']['summaryCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['summaryCropSignifier'], $this->conf['results.']['summaryCropSignifier.']); - $this->conf['results.']['titleCropAfter'] = MathUtility::forceIntegerInRange( - $this->cObj->stdWrap($this->conf['results.']['titleCropAfter'], $this->conf['results.']['titleCropAfter.']), - 10, 500, 50 - ); - $this->conf['results.']['titleCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['titleCropSignifier'], $this->conf['results.']['titleCropSignifier.']); - $this->conf['results.']['markupSW_summaryMax'] = MathUtility::forceIntegerInRange( - $this->cObj->stdWrap($this->conf['results.']['markupSW_summaryMax'], $this->conf['results.']['markupSW_summaryMax.']), - 10, 5000, 300 - ); - $this->conf['results.']['markupSW_postPreLgd'] = MathUtility::forceIntegerInRange( - $this->cObj->stdWrap($this->conf['results.']['markupSW_postPreLgd'], $this->conf['results.']['markupSW_postPreLgd.']), - 1, 500, 60 - ); - $this->conf['results.']['markupSW_postPreLgd_offset'] = MathUtility::forceIntegerInRange( - $this->cObj->stdWrap($this->conf['results.']['markupSW_postPreLgd_offset'], $this->conf['results.']['markupSW_postPreLgd_offset.']), - 1, 50, 5 - ); - $this->conf['results.']['markupSW_divider'] = $this->cObj->stdWrap($this->conf['results.']['markupSW_divider'], $this->conf['results.']['markupSW_divider.']); - $this->conf['results.']['hrefInSummaryCropAfter'] = MathUtility::forceIntegerInRange( - $this->cObj->stdWrap($this->conf['results.']['hrefInSummaryCropAfter'], $this->conf['results.']['hrefInSummaryCropAfter.']), - 10, 400, 60 - ); - $this->conf['results.']['hrefInSummaryCropSignifier'] = $this->cObj->stdWrap($this->conf['results.']['hrefInSummaryCropSignifier'], $this->conf['results.']['hrefInSummaryCropSignifier.']); - } - - /** - * Get TypoScriptFrontendController - * - * @return TypoScriptFrontendController - */ - protected function getTypoScriptFrontendController() - { - return $GLOBALS['TSFE']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/Controller/VersionModuleController.php b/typo3/sysext/compatibility7/Classes/Controller/VersionModuleController.php deleted file mode 100644 index f30a04081588..000000000000 --- a/typo3/sysext/compatibility7/Classes/Controller/VersionModuleController.php +++ /dev/null @@ -1,635 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Controller; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Backend\Template\ModuleTemplate; -use TYPO3\CMS\Backend\Utility\BackendUtility; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; -use TYPO3\CMS\Core\Imaging\Icon; -use TYPO3\CMS\Core\Utility\ArrayUtility; -use TYPO3\CMS\Core\Utility\DiffUtility; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Lang\LanguageService; - -/** - * Versioning module, including workspace management - */ -class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass -{ - /** - * Module configuration - * - * @var array - */ - public $MCONF = []; - - /** - * Module menu items - * - * @var array - */ - public $MOD_MENU = []; - - /** - * Module session settings - * - * @var array - */ - public $MOD_SETTINGS = []; - - /** - * document template object - * - * @var \TYPO3\CMS\Backend\Template\DocumentTemplate - */ - public $doc; - - /** - * @var string - */ - public $content; - - /** - * @var string - */ - public $table; - - /** - * @var string - */ - public $details; - - /** - * @var string - */ - public $diffOnly; - - /** - * @var int - */ - public $uid; - - /** - * @var array|bool - */ - public $pageinfo; - - /** - * @var bool - */ - public $recordFound; - - /** - * Accumulated content - * - * @var int - */ - public $showWorkspaceCol = 0; - - /** - * @var array - */ - public $formatWorkspace_cache = []; - - /** - * @var array - */ - public $formatCount_cache = []; - - /** - * @var array - */ - public $targets = []; - - /** - * Accumulation of online targets. - * - * @var string - */ - public $pageModule = ''; - - /** - * Name of page module - * - * @var bool - */ - public $publishAccess = false; - - /** - * @var array - */ - public $stageIndex = []; - - /** - * @var array - */ - public $recIndex = []; - - /** - * @var string - */ - public $REQUEST_URI = ''; - - /** - * The name of the module - * - * @var string - */ - protected $moduleName = 'web_txversionM1'; - - /** - * ModuleTemplate object - * - * @var ModuleTemplate - */ - protected $moduleTemplate; - - /** - * Initialize language files - */ - public function __construct() - { - $GLOBALS['SOBE'] = $this; - $this->getLanguageService()->includeLLFile('EXT:compatibility7/Resources/Private/Language/locallang_version.xlf'); - $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); - } - - /** - * Initialize menu configuration - * - * @return void - */ - public function menuConfig() - { - // CLEANSE SETTINGS - $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName, 'ses'); - } - - /** - * Main function of the module. Write the content to $this->content - * - * @return void - */ - public function main() - { - // Template markers - $markers = [ - 'CSH' => '', - 'FUNC_MENU' => '', - 'WS_MENU' => '', - 'CONTENT' => '' - ]; - // Setting module configuration: - $this->MCONF['name'] = $this->moduleName; - $this->REQUEST_URI = str_replace('&sendToReview=1', '', GeneralUtility::getIndpEnv('REQUEST_URI')); - // Draw the header. - $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); - $this->doc->setModuleTemplate('EXT:compatibility7/Resources/Private/Templates/Version.html'); - - // Setting up the context sensitive menu: - $this->getPageRenderer()->loadJquery(); - $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu'); - // Getting input data: - $this->id = (int)GeneralUtility::_GP('id'); - - // Record uid. Goes with table name to indicate specific record - $this->uid = (int)GeneralUtility::_GP('uid'); - // // Record table. Goes with uid to indicate specific record - $this->table = GeneralUtility::_GP('table'); - - $this->details = GeneralUtility::_GP('details'); - // Page id. If set, indicates activation from Web>Versioning module - $this->diffOnly = GeneralUtility::_GP('diffOnly'); - // Flag. If set, shows only the offline version and with diff-view - // Force this setting: - $this->MOD_SETTINGS['expandSubElements'] = true; - $this->MOD_SETTINGS['diff'] = $this->details || $this->MOD_SETTINGS['diff'] ? 1 : 0; - // Reading the record: - $record = BackendUtility::getRecord($this->table, $this->uid); - if ($record['pid'] == -1) { - $record = BackendUtility::getRecord($this->table, $record['t3ver_oid']); - } - $this->recordFound = is_array($record); - $pidValue = $this->table === 'pages' ? $this->uid : $record['pid']; - // Checking access etc. - if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] && !$this->id) { - $this->uid = $record['uid']; - // Might have changed if new live record was found! - // Access check! - // The page will show only if there is a valid page and if this page may be viewed by the user - $this->pageinfo = BackendUtility::readPageAccess($pidValue, $this->perms_clause); - $access = is_array($this->pageinfo) ? 1 : 0; - if ($pidValue && $access || $GLOBALS['BE_USER']->user['admin'] && !$pidValue) { - // If another page module was specified, replace the default Page module with the new one - $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule')); - $this->pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout'; - // Setting publish access permission for workspace: - $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace); - $this->versioningMgm(); - } - // Setting up the buttons and markers for docheader - $docHeaderButtons = $this->getButtons(); - $markers['CSH'] = $docHeaderButtons['csh']; - $markers['FUNC_MENU'] = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); - $markers['CONTENT'] = $this->content; - } else { - // If no access or id value, create empty document - $this->content = '<h2>' . htmlspecialchars($this->getLanguageService()->getLL('clickAPage_header')) . '</h2><div>' . $this->getLanguageService()->getLL('clickAPage_content') . '</div>'; - // Setting up the buttons and markers for docheader - $docHeaderButtons = $this->getButtons(); - $markers['CONTENT'] = $this->content; - } - // Build the <body> for the module - $this->content = $this->doc->startPage($this->getLanguageService()->getLL('title')); - $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); - $this->content .= $this->doc->endPage(); - $this->content = $this->doc->insertStylesAndJS($this->content); - } - - /** - * Create the panel of buttons for submitting the form or otherwise perform operations. - * - * @return array All available buttons as an assoc. array - */ - protected function getButtons() - { - $buttons = [ - 'csh' => '', - 'view' => '', - 'record_list' => '', - 'shortcut' => '' - ]; - // CSH - if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) { - // View page - $buttons['view'] = ' - <a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showPage')) . '"> - ' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . ' - </a>'; - // Shortcut - if ($GLOBALS['BE_USER']->mayMakeShortcut()) { - $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->moduleName); - } - // If access to Web>List for user, then link to that module. - $buttons['record_list'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl( - 'web_list', - [ - 'id' => $this->pageinfo['uid'], - 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') - ] - )) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render() . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showList')) . '</a>'; - } - return $buttons; - } - - /****************************** - * - * Versioning management - * - ******************************/ - /** - * Management of versions for record - * - * @return void - */ - public function versioningMgm() - { - $lang = $this->getLanguageService(); - // Diffing: - $diff_1 = GeneralUtility::_POST('diff_1'); - $diff_2 = GeneralUtility::_POST('diff_2'); - $content = ''; - if (GeneralUtility::_POST('do_diff')) { - $content .= '<div class="panel panel-space panel-default">'; - $content .= '<div class="panel-heading">' . $lang->getLL('diffing') . '</div>'; - if ($diff_1 && $diff_2) { - $diff_1_record = BackendUtility::getRecord($this->table, $diff_1); - $diff_2_record = BackendUtility::getRecord($this->table, $diff_2); - if (is_array($diff_1_record) && is_array($diff_2_record)) { - $diffUtility = GeneralUtility::makeInstance(DiffUtility::class); - $diffUtility->stripTags = false; - $rows = []; - $rows[] = ' - <tr> - <th>' . $lang->getLL('fieldname') . '</th> - <th width="98%">' . $lang->getLL('coloredDiffView') . ':</th> - </tr> - '; - foreach ($diff_1_record as $fN => $fV) { - if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough' && $fN !== 't3ver_label') { - if ((string)$diff_1_record[$fN] !== (string)$diff_2_record[$fN]) { - $diffres = $diffUtility->makeDiffDisplay( - BackendUtility::getProcessedValue($this->table, $fN, $diff_2_record[$fN], 0, 1), - BackendUtility::getProcessedValue($this->table, $fN, $diff_1_record[$fN], 0, 1) - ); - $rows[] = ' - <tr> - <td>' . $fN . '</td> - <td width="98%">' . $diffres . '</td> - </tr> - '; - } - } - } - if (count($rows) > 1) { - $content .= '<div class="table-fit"><table class="table">' . implode('', $rows) . '</table></div>'; - } else { - $content .= '<div class="panel-body">' . $lang->getLL('recordsMatchesCompletely') . '</div>'; - } - } else { - $content .= '<div class="panel-body">' . $lang->getLL('errorRecordsNotFound') . '</div>'; - } - } else { - $content .= '<div class="panel-body">' . $lang->getLL('errorDiffSources') . '</div>'; - } - $content .= '</div>'; - } - // Element: - $record = BackendUtility::getRecord($this->table, $this->uid); - $recTitle = BackendUtility::getRecordTitle($this->table, $record, true); - // Display versions: - $content .= ' - <form name="theform" action="' . str_replace('&sendToReview=1', '', $this->REQUEST_URI) . '" method="post"> - <div class="panel panel-space panel-default"> - <div class="panel-heading">' . $recTitle . '</div> - <div class="table-fit"> - <table class="table"> - <thead> - <tr> - <th colspan="2" class="col-icon"></th> - <th title="' . $lang->getLL('tblHeaderDesc_title') . '">' . $lang->getLL('tblHeader_title') . '</th> - <th title="' . $lang->getLL('tblHeaderDesc_uid') . '"><i>' . $lang->getLL('tblHeader_uid') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_t3ver_oid') . '"><i>' . $lang->getLL('tblHeader_t3ver_oid') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_t3ver_id') . '"><i>' . $lang->getLL('tblHeader_t3ver_id') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_t3ver_wsid') . '"><i>' . $lang->getLL('tblHeader_t3ver_wsid') . '</i></th> - <th title="' . htmlspecialchars($lang->getLL('tblHeaderDesc_t3ver_state')) . '"><i>' . $lang->getLL('tblHeader_t3ver_state') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_t3ver_stage') . '"><i>' . $lang->getLL('tblHeader_t3ver_stage') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_t3ver_count') . '"><i>' . $lang->getLL('tblHeader_t3ver_count') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_pid') . '"><i>' . $lang->getLL('tblHeader_pid') . '</i></th> - <th title="' . $lang->getLL('tblHeaderDesc_t3ver_label') . '"><i>' . $lang->getLL('tblHeader_t3ver_label') . '</i></th> - <th></th> - <th colspan="2"> - <button class="btn btn-default btn-sm" type="submit" name="do_diff" value="true"> - ' . $lang->getLL('diff') . ' - </button> - </th> - </tr> - </thead> - <tbody> - '; - $versions = BackendUtility::selectVersionsOfRecord($this->table, $this->uid, '*', $GLOBALS['BE_USER']->workspace); - foreach ($versions as $row) { - $adminLinks = $this->adminLinks($this->table, $row); - - $editUrl = BackendUtility::getModuleUrl('record_edit', [ - 'edit' => [ - $this->table => [ - $row['uid'] => 'edit' - ] - ], - 'columnsOnly' => 't3ver_label', - 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') - ]); - $content .= ' - <tr' . ($row['uid'] != $this->uid ? '' : ' class="active"') . '> - <td class="col-icon">' . - ($row['uid'] != $this->uid ? - '<a href="' . BackendUtility::getLinkToDataHandlerAction('&cmd[' . $this->table . '][' . $this->uid . '][version][swapWith]=' . $row['uid'] . '&cmd[' . $this->table . '][' . $this->uid . '][version][action]=swap') . '" title="' . htmlspecialchars($lang->getLL('swapWithCurrent')) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-version-swap-version', Icon::SIZE_SMALL)->render() . '</a>' : - '<span title="' . htmlspecialchars($lang->getLL('currentOnlineVersion')) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('status-status-current', Icon::SIZE_SMALL)->render() . '</span>' - ) . ' - </td> - <td class="col-icon">' . $this->moduleTemplate->getIconFactory()->getIconForRecord($this->table, $row, Icon::SIZE_SMALL)->render() . '</td> - <td>' . BackendUtility::getRecordTitle($this->table, $row, true) . '</td> - <td>' . $row['uid'] . '</td> - <td>' . $row['t3ver_oid'] . '</td> - <td>' . $row['t3ver_id'] . '</td> - <td>' . $row['t3ver_wsid'] . '</td> - <td>' . $row['t3ver_state'] . '</td> - <td>' . $row['t3ver_stage'] . '</td> - <td>' . $row['t3ver_count'] . '</td> - <td>' . $row['pid'] . '</td> - <td> - <a href="' . htmlspecialchars($editUrl) . '" title="' . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.edit')) . '"> - ' . $this->moduleTemplate->getIconFactory()->getIcon('actions-open', Icon::SIZE_SMALL)->render() . ' - </a>' . htmlspecialchars($row['t3ver_label']) . ' - </td> - <td class="col-control">' . $adminLinks . '</td> - <td class="text-center success"><input type="radio" name="diff_1" value="' . $row['uid'] . '"' . ($diff_1 == $row['uid'] ? ' checked="checked"' : '') . '/></td> - <td class="text-center danger"><input type="radio" name="diff_2" value="' . $row['uid'] . '"' . ($diff_2 == $row['uid'] ? ' checked="checked"' : '') . '/></td> - </tr>'; - // Show sub-content if the table is pages AND it is not the online branch (because that will mostly render the WHOLE tree below - not smart;) - if ($this->table === 'pages' && $row['uid'] != $this->uid) { - $sub = $this->pageSubContent($row['uid']); - if ($sub) { - $content .= ' - <tr> - <td colspan="2"></td> - <td colspan="11">' . $sub . '</td> - <td class="success"></td> - <td class="danger"></td> - </tr>'; - } - } - } - $content .= ' - </tbody> - </table> - </div> - </div> - </form>'; - $this->content .= '<h2>' . htmlspecialchars($lang->getLL('title')) . '</h2><div>' . $content . '</div>'; - // Create new: - $content = ' - <form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db')) . '" method="post"> - <div class="row"> - <div class="col-sm-6 col-md-4 col-lg-3"> - <div class="form-group"> - <label for="typo3-new-version-label">' . $lang->getLL('tblHeader_t3ver_label') . '</label> - <input id="typo3-new-version-label" class="form-control" type="text" name="cmd[' . $this->table . '][' . $this->uid . '][version][label]" /> - </div> - <div class="form-group"> - <input type="hidden" name="cmd[' . $this->table . '][' . $this->uid . '][version][action]" value="new" /> - <input type="hidden" name="prErr" value="1" /> - <input type="hidden" name="redirect" value="' . htmlspecialchars($this->REQUEST_URI) . '" /> - <input class="btn btn-default" type="submit" name="_" value="' . $lang->getLL('createNewVersion') . '" /> - </div> - </div> - </div> - </form> - - '; - $this->content .= '<h2>' . htmlspecialchars($lang->getLL('createNewVersion')) . '</h2><div>' . $content . '</div>'; - } - - /** - * Recursively look for children for page version with $pid - * - * @param int $pid UID of page record for which to look up sub-elements following that version - * @param int $c Counter, do not set (limits to 100 levels) - * @return string Table with content if any - */ - public function pageSubContent($pid, $c = 0) - { - $tableNames = ArrayUtility::removeArrayEntryByValue(array_keys($GLOBALS['TCA']), 'pages'); - $tableNames[] = 'pages'; - $content = ''; - foreach ($tableNames as $table) { - // Basically list ALL tables - not only those being copied might be found! - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) - ->getQueryBuilderForTable($table); - $queryBuilder->getRestrictions() - ->removeAll() - ->add(GeneralUtility::makeInstance(DeletedRestriction::class)); - - $queryBuilder - ->select('*') - ->from($table) - ->where( - $queryBuilder->expr()->eq( - 'pid', - $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT) - ) - ); - - if (!empty($GLOBALS['TCA'][$table]['ctrl']['sortby'])) { - $queryBuilder->orderBy($GLOBALS['TCA'][$table]['ctrl']['sortby']); - } - - $result = $queryBuilder->execute(); - if ($result->rowCount()) { - $content .= ' - <table class="table"> - <tr> - <th class="col-icon">' . $this->moduleTemplate->getIconFactory()->getIconForRecord($table, [], Icon::SIZE_SMALL)->render() . '</th> - <th class="col-title">' . htmlspecialchars($this->getLanguageService()->sL($GLOBALS['TCA'][$table]['ctrl']['title'])) . '</th> - <th></th> - <th></th> - </tr>'; - while ($subrow = $result->fetch()) { - $ownVer = $this->lookForOwnVersions($table, $subrow['uid']); - $content .= ' - <tr> - <td class="col-icon">' . $this->moduleTemplate->getIconFactory()->getIconForRecord($table, $subrow, Icon::SIZE_SMALL)->render() . '</td> - <td class="col-title">' . BackendUtility::getRecordTitle($table, $subrow, true) . '</td> - <td>' . ($ownVer > 1 ? '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_txversionM1', ['table' => $table, 'uid' => $subrow['uid']])) . '">' . ($ownVer - 1) . '</a>' : '') . '</td> - <td class="col-control">' . $this->adminLinks($table, $subrow) . '</td> - </tr>'; - if ($table === 'pages' && $c < 100) { - $sub = $this->pageSubContent($subrow['uid'], $c + 1); - if ($sub) { - $content .= ' - <tr> - <td></td> - <td></td> - <td></td> - <td width="98%">' . $sub . '</td> - </tr>'; - } - } - } - $content .= '</table>'; - } - } - return $content; - } - - /** - * Look for number of versions of a record - * - * @param string $table Table name - * @param int $uid Record uid - * @return int Number of versions for record, FALSE if none. - */ - public function lookForOwnVersions($table, $uid) - { - $versions = BackendUtility::selectVersionsOfRecord($table, $uid, 'uid', null); - if (is_array($versions)) { - return count($versions); - } - return false; - } - - /** - * Administrative links for a table / record - * - * @param string $table Table name - * @param array $row Record for which administrative links are generated. - * @return string HTML link tags. - */ - public function adminLinks($table, $row) - { - // Edit link: - $editUrl = BackendUtility::getModuleUrl('record_edit', [ - 'edit' => [ - $table => [ - $row['uid'] => 'edit' - ] - ], - 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') - ]); - $adminLink = '<div class="btn-group btn-group-sm" role="group">'; - $adminLink .= '<a class="btn btn-default" href="' . htmlspecialchars($editUrl) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.edit')) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>'; - // Delete link: - $adminLink .= '<a class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getLinkToDataHandlerAction('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.delete')) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</a>'; - $adminLink .= '</div>'; - if ($table === 'pages') { - // If another page module was specified, replace the default Page module with the new one - $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule')); - $pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout'; - $adminLink .= '<div class="btn-group btn-group-sm">'; - $adminLink .= '<a class="btn btn-default" href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(' . GeneralUtility::quoteJSvalue($pageModule) . '); return false;">' - . $this->moduleTemplate->getIconFactory()->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() - . '</a>'; - $adminLink .= '<a class="btn btn-default" href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'web_list\'); return false;">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render() . '</a>'; - // "View page" icon is added: - $adminLink .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['uid'], '', BackendUtility::BEgetRootLine($row['uid']))) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>'; - $adminLink .= '</div>'; - } else { - if ($row['pid'] == -1) { - $getVars = '&ADMCMD_vPrev[' . rawurlencode(($table . ':' . $row['t3ver_oid'])) . ']=' . $row['uid']; - // "View page" icon is added: - $adminLink .= '<div class="btn-group btn-group-sm" role="group"><a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['_REAL_PID'], '', BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a></div>'; - } - } - return $adminLink; - } - - /** - * Injects the request object for the current request and gathers all data. - * - * @param ServerRequestInterface $request the current request - * @param ResponseInterface $response the prepared response - * @return ResponseInterface the response with the content - */ - public function mainAction(ServerRequestInterface $request, ResponseInterface $response) - { - $this->init(); - $this->main(); - - $response->getBody()->write($this->content); - return $response; - } - - /** - * @return LanguageService - */ - protected function getLanguageService() - { - return $GLOBALS['LANG']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/Hooks/BackendLoginLinkHook.php b/typo3/sysext/compatibility7/Classes/Hooks/BackendLoginLinkHook.php deleted file mode 100644 index 06152b5cfdf3..000000000000 --- a/typo3/sysext/compatibility7/Classes/Hooks/BackendLoginLinkHook.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Hooks; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; - -/** - * Hook to validate the TypoScript option - * config.beLoginLinkIPList, config beLoginLinkIPList_login and config.beLoginLinkIPList_logout - */ -class BackendLoginLinkHook -{ - /** - * Echoes a link to the BE login screen with redirect to the front-end - * if the option config.beLoginLinkIPList is set. - * - * @param array $parameters left empty, not in use - * @param TypoScriptFrontendController $parentObject - */ - public function renderBackendLoginLink(array $parameters, TypoScriptFrontendController $parentObject) - { - if (empty($parentObject->config['config']['beLoginLinkIPList'])) { - return; - } - if (!GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $parentObject->config['config']['beLoginLinkIPList'])) { - return; - } - $label = !$parentObject->isBackendUserLoggedIn() ? $parentObject->config['config']['beLoginLinkIPList_login'] : $parentObject->config['config']['beLoginLinkIPList_logout']; - if ($label) { - if (!$parentObject->isBackendUserLoggedIn()) { - $link = '<a href="' . htmlspecialchars((TYPO3_mainDir . 'index.php?redirect_url=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')))) . '">' . $label . '</a>'; - } else { - $link = '<a href="' . htmlspecialchars((TYPO3_mainDir . 'index.php?L=OUT&redirect_url=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')))) . '">' . $label . '</a>'; - } - echo $link; - } - } -} diff --git a/typo3/sysext/compatibility7/Classes/Hooks/EnforceUrlSchemeHook.php b/typo3/sysext/compatibility7/Classes/Hooks/EnforceUrlSchemeHook.php deleted file mode 100644 index 131cd811b4e7..000000000000 --- a/typo3/sysext/compatibility7/Classes/Hooks/EnforceUrlSchemeHook.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Hooks; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\HttpUtility; -use TYPO3\CMS\Frontend\ContentObject\TypolinkModifyLinkConfigForPageLinksHookInterface; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; - -/** - * Hooks for - * - TypoLink when linking to a page and sets forceAbsoluteUrl if the page has - * - TSFE to do a redirect if the url_scheme does not match - */ -class EnforceUrlSchemeHook implements TypolinkModifyLinkConfigForPageLinksHookInterface -{ - /** - * Hooks in typolink when linking to a page - * - * Checks if pages.url_scheme has a value and then enforces an absolute URL with the scheme set in there - * - * @param array $linkConfiguration the typolink configuration - * @param array $linkDetails - * @param array $pageRow the fetched page record - * @return array the modified link configuration - */ - public function modifyPageLinkConfiguration(array $linkConfiguration, array $linkDetails, array $pageRow): array - { - // If pages.url_scheme is not set or not greater than zero, do not process - if (!isset($pageRow['url_scheme']) || !($pageRow['url_scheme'] > 0)) { - return $linkConfiguration; - } - - // If an absolute URL with explicit scheme is already set, don't do anything - if (isset($linkConfiguration['forceAbsoluteUrl']) && $linkConfiguration['forceAbsoluteUrl'] - && isset($conf['forceAbsoluteUrl.']['scheme']) && $conf['forceAbsoluteUrl.']['scheme']) { - return $linkConfiguration; - } - - // Enable forceAbsoluteUrl so the link configuration actually enters the if() clause in TypoLink - $linkConfiguration['forceAbsoluteUrl'] = 1; - - // Now explicitly override the scheme - if (!isset($linkConfiguration['forceAbsoluteUrl.'])) { - $linkConfiguration['forceAbsoluteUrl.'] = []; - } - $linkConfiguration['forceAbsoluteUrl.']['scheme'] = (int)$pageRow['url_scheme'] === HttpUtility::SCHEME_HTTP ? 'http' : 'https'; - return $linkConfiguration; - } - - /** - * Checks if pages.url_scheme is set, and then redirects to enforce HTTP / HTTPS if it does not match - * - * @param array $parameters not in use, as it does not contain useful information for this hook - * @param TypoScriptFrontendController $parentObject - */ - public function redirectIfUrlSchemeDoesNotMatch($parameters, $parentObject) - { - if (isset($parentObject->page['url_scheme']) && $parentObject->page['url_scheme'] > 0) { - $newUrl = ''; - $requestUrlScheme = parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME); - if ((int)$parentObject->page['url_scheme'] === HttpUtility::SCHEME_HTTP && $requestUrlScheme === 'https') { - $newUrl = 'http://' . substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 8); - } elseif ((int)$parentObject->page['url_scheme'] === HttpUtility::SCHEME_HTTPS && $requestUrlScheme === 'http') { - $newUrl = 'https://' . substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 7); - } - if ($newUrl !== '') { - if ($_SERVER['REQUEST_METHOD'] === 'POST') { - $headerCode = HttpUtility::HTTP_STATUS_303; - } else { - $headerCode = HttpUtility::HTTP_STATUS_301; - } - HttpUtility::redirect($newUrl, $headerCode); - } - } - } -} diff --git a/typo3/sysext/compatibility7/Classes/Hooks/PageLayoutActionHook.php b/typo3/sysext/compatibility7/Classes/Hooks/PageLayoutActionHook.php deleted file mode 100644 index f40ffc5d458c..000000000000 --- a/typo3/sysext/compatibility7/Classes/Hooks/PageLayoutActionHook.php +++ /dev/null @@ -1,682 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Hooks; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Backend\Controller\PageLayoutController; -use TYPO3\CMS\Backend\Form\FormDataCompiler; -use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord; -use TYPO3\CMS\Backend\Form\FormResultCompiler; -use TYPO3\CMS\Backend\Form\NodeFactory; -use TYPO3\CMS\Backend\Template\Components\ButtonBar; -use TYPO3\CMS\Backend\Tree\View\ContentLayoutPagePositionMap; -use TYPO3\CMS\Backend\Utility\BackendUtility; -use TYPO3\CMS\Core\Database\Connection; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; -use TYPO3\CMS\Core\Imaging\Icon; -use TYPO3\CMS\Core\Messaging\FlashMessage; -use TYPO3\CMS\Core\Messaging\FlashMessageService; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\MathUtility; -use TYPO3\CMS\Core\Versioning\VersionState; - -/** - * Adds the action `QuickEdit to the module `Web > Layout` - */ -class PageLayoutActionHook -{ - - /** - * @var bool - */ - protected $undoButton; - - /** - * @var array - */ - protected $undoButtonR; - - /** - * @var bool - */ - protected $deleteButton; - - /** - * @var string - */ - protected $closeUrl; - - /** - * @var array - */ - protected $eRParts = []; - - /** - * The name of the module - * - * @var string - */ - protected $moduleName = 'web_layout'; - - /** - * @var string - */ - protected $R_URI; - - /** - * @var PageLayoutController - */ - protected $controller; - - /** - * Initializes the action - * - * @param array $parameters the hook parameters - * @param PageLayoutController $controller the page layout controller - * @return void - */ - public function initAction(array $parameters, PageLayoutController $controller) - { - $this->controller = $controller; - // Add function to MOD_MENU - $this->controller->MOD_MENU['function'] = array_slice($this->controller->MOD_MENU['function'], 0, 1, true) - + ['0' => $this->getLanguageService()->getLL('m_function_0')] + $this->controller->MOD_MENU['function']; - // Remove QuickEdit as option if page type is not... - if (GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'] . ',6', $this->controller->pageinfo['doktype'])) { - array_unshift($parameters['actions'], $this->getLanguageService()->getLL('m_function_0')); - } - // TSconfig settings and blinding of menu-items - if ($this->controller->modTSconfig['properties']['QEisDefault']) { - ksort($parameters['actions']); - } - } - - /** - * Renders the content of the action - * - * @param array $parameters the hook parameters - * @param PageLayoutController $controller the page layout controller - * @return string the module content - */ - public function renderAction(array $parameters, PageLayoutController $controller) - { - $this->controller = $controller; - - $content = $this->renderContent(); - $this->makeButtons(); - - return $content; - } - - /** - * Makes the action buttons - * - * @return void - */ - protected function makeButtons() - { - $buttonBar = $this->controller->getModuleTemplate()->getDocHeaderComponent()->getButtonBar(); - $iconFactory = $this->controller->getModuleTemplate()->getIconFactory(); - $lang = $this->getLanguageService(); - // Add CSH (Context Sensitive Help) icon to tool bar - $contextSensitiveHelpButton = $buttonBar->makeHelpButton() - ->setModuleName($this->controller->descrTable) - ->setFieldName('quickEdit'); - $buttonBar->addButton($contextSensitiveHelpButton); - - if (!$this->controller->modTSconfig['properties']['disableIconToolbar']) { - // Move record - if (MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) { - $urlParameters = [ - 'table' => $this->eRParts[0], - 'uid' => $this->eRParts[1], - 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') - ]; - $moveButton = $buttonBar->makeLinkButton() - ->setHref(BackendUtility::getModuleUrl('move_element', $urlParameters)) - ->setTitle($lang->getLL('move_' . ($this->eRParts[0] === 'tt_content' ? 'record' : 'page'))) - ->setIcon($iconFactory->getIcon('actions-' . ($this->eRParts[0] === 'tt_content' ? 'document' : 'page') . '-move', Icon::SIZE_SMALL)); - $buttonBar->addButton($moveButton, ButtonBar::BUTTON_POSITION_LEFT, 2); - } - } - - // Close Record - $closeButton = $buttonBar->makeLinkButton() - ->setHref('#') - ->setOnClick('jumpToUrl(' . GeneralUtility::quoteJSvalue($this->closeUrl) . '); return false;') - ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.closeDoc')) - ->setIcon($iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL)); - $buttonBar->addButton($closeButton, ButtonBar::BUTTON_POSITION_LEFT, 0); - - // Save Record - $saveButtonDropdown = $buttonBar->makeSplitButton(); - $saveButton = $buttonBar->makeInputButton() - ->setName('_savedok') - ->setValue('1') - ->setForm('PageLayoutController') - ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.saveDoc')) - ->setIcon($iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL)); - $saveButtonDropdown->addItem($saveButton); - $saveAndCloseButton = $buttonBar->makeInputButton() - ->setName('_saveandclosedok') - ->setValue('1') - ->setForm('PageLayoutController') - ->setOnClick('document.editform.redirect.value=\'' . $this->closeUrl . '\';') - ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.saveCloseDoc')) - ->setIcon($iconFactory->getIcon('actions-document-save-close', Icon::SIZE_SMALL)); - $saveButtonDropdown->addItem($saveAndCloseButton); - $saveAndShowPageButton = $buttonBar->makeInputButton() - ->setName('_savedokview') - ->setValue('1') - ->setForm('PageLayoutController') - ->setOnClick('document.editform.redirect.value+=\'&popView=1\';') - ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.saveDocShow')) - ->setIcon($iconFactory->getIcon('actions-document-save-view', Icon::SIZE_SMALL)); - $saveButtonDropdown->addItem($saveAndShowPageButton); - $buttonBar->addButton($saveButtonDropdown, ButtonBar::BUTTON_POSITION_LEFT, 1); - - // Delete record - if ($this->deleteButton) { - $dataAttributes = []; - $dataAttributes['table'] = $this->eRParts[0]; - $dataAttributes['uid'] = $this->eRParts[1]; - $dataAttributes['return-url'] = BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->controller->id; - $deleteButton = $buttonBar->makeLinkButton() - ->setHref('#') - ->setClasses('t3js-editform-delete-record') - ->setDataAttributes($dataAttributes) - ->setTitle($lang->getLL('deleteItem')) - ->setIcon($iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)); - $buttonBar->addButton($deleteButton, ButtonBar::BUTTON_POSITION_LEFT, 4); - } - - // History - if ($this->undoButton) { - $undoButton = $buttonBar->makeLinkButton() - ->setHref('#') - ->setOnClick('window.location.href=' . - GeneralUtility::quoteJSvalue( - BackendUtility::getModuleUrl( - 'record_history', - [ - 'element' => $this->eRParts[0] . ':' . $this->eRParts[1], - 'revert' => 'ALL_FIELDS', - 'returnUrl' => $this->R_URI, - ] - ) - ) . '; return false;') - ->setTitle(sprintf($lang->getLL('undoLastChange'), BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $this->undoButtonR['tstamp'], $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears')))) - ->setIcon($iconFactory->getIcon('actions-edit-undo', Icon::SIZE_SMALL)); - $buttonBar->addButton($undoButton, ButtonBar::BUTTON_POSITION_LEFT, 5); - $historyButton = $buttonBar->makeLinkButton() - ->setHref('#') - ->setOnClick('jumpToUrl(' . - GeneralUtility::quoteJSvalue( - BackendUtility::getModuleUrl( - 'record_history', - [ - 'element' => $this->eRParts[0] . ':' . $this->eRParts[1], - 'returnUrl' => $this->R_URI, - ] - ) . '#latest' - ) . ');return false;') - ->setTitle($lang->getLL('recordHistory')) - ->setIcon($iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)); - $buttonBar->addButton($historyButton, ButtonBar::BUTTON_POSITION_LEFT, 3); - } - } - - /** - * Makes the action menu - * - * @param array $edit_record the record to make the menu for - * - * @return array - */ - protected function makeMenu($edit_record) - { - $lang = $this->getLanguageService(); - $beUser = $this->getBackendUser(); - - $quickEditMenu = $this->controller->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu(); - $quickEditMenu->setIdentifier('quickEditMenu'); - $quickEditMenu->setLabel(''); - - // Setting close url/return url for exiting this script: - // Goes to 'Columns' view if close is pressed (default) - $this->closeUrl = $this->controller->local_linkThisScript(['SET' => ['function' => 1]]); - if ($this->returnUrl) { - $this->closeUrl = $this->returnUrl; - } - $retUrlStr = $this->returnUrl ? '&returnUrl=' . rawurlencode($this->returnUrl) : ''; - - // Creating the selector box, allowing the user to select which element to edit: - $isSelected = 0; - $languageOverlayRecord = ''; - if ($this->current_sys_language) { - list($languageOverlayRecord) = BackendUtility::getRecordsByField( - 'pages_language_overlay', - 'pid', - $this->id, - 'AND sys_language_uid=' . (int)$this->current_sys_language - ); - } - if (is_array($languageOverlayRecord)) { - $inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid']; - $isSelected += (int)$edit_record == $inValue; - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle('[ ' . $lang->getLL('editLanguageHeader') . ' ]') - ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $inValue . $retUrlStr) - ->setActive($edit_record == $inValue); - $quickEditMenu->addMenuItem($menuItem); - } else { - $inValue = 'pages:' . $this->id; - $isSelected += (int)$edit_record == $inValue; - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle('[ ' . $lang->getLL('editPageProperties') . ' ]') - ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $inValue . $retUrlStr) - ->setActive($edit_record == $inValue); - $quickEditMenu->addMenuItem($menuItem); - } - - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content'); - if ($this->controller->MOD_SETTINGS['tt_content_showHidden']) { - $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class)); - } - $queryBuilder->select('*') - ->from('tt_content') - ->where( - $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($this->controller->id, \PDO::PARAM_INT)), - $queryBuilder->expr()->eq( - 'sys_language_uid', - $queryBuilder->createNamedParameter($this->controller->current_sys_language, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->in( - 'colPos', - $queryBuilder->createNamedParameter( - GeneralUtility::intExplode(',', $this->controller->colPosList, true), - Connection::PARAM_INT_ARRAY - ) - ), - $queryBuilder->expr()->orX( - $queryBuilder->expr()->gte( - 't3ver_state', - $queryBuilder->createNamedParameter( - (string)new VersionState(VersionState::DEFAULT_STATE), - \PDO::PARAM_INT - ) - ), - $queryBuilder->expr()->eq( - 't3ver_wsid', - $queryBuilder->createNamedParameter( - (string)new VersionState(VersionState::DEFAULT_STATE), - \PDO::PARAM_INT - ) - ) - ) - ) - ->orderBy('colPos') - ->addOrderBy('sorting'); - if (!$beUser->user['admin']) { - $queryBuilder->andWhere( - $queryBuilder->expr()->eq( - 'editlock', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) - ) - ); - } - $statement = $queryBuilder->execute(); - $colPos = null; - $first = 1; - // Page is the pid if no record to put this after. - $prev = $this->controller->id; - while ($cRow = $statement->fetch()) { - BackendUtility::workspaceOL('tt_content', $cRow); - if (is_array($cRow)) { - if ($first) { - if (!$edit_record) { - $edit_record = 'tt_content:' . $cRow['uid']; - } - $first = 0; - } - if (!isset($colPos) || $cRow['colPos'] !== $colPos) { - $colPos = $cRow['colPos']; - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle(' ') - ->setHref('#'); - $quickEditMenu->addMenuItem($menuItem); - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle('__' . $lang->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $colPos)) . ':__') - ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->controller->id . '&edit_record=_EDIT_COL:' . $colPos . $retUrlStr); - $quickEditMenu->addMenuItem($menuItem); - } - $inValue = 'tt_content:' . $cRow['uid']; - $isSelected += (int)$edit_record == $inValue; - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle(GeneralUtility::fixed_lgd_cs(($cRow['header'] ? $cRow['header'] : '[' . $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.no_title') . '] ' . strip_tags($cRow['bodytext'])), $beUser->uc['titleLen'])) - ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->controller->id . '&edit_record=' . $inValue . $retUrlStr) - ->setActive($edit_record == $inValue); - $quickEditMenu->addMenuItem($menuItem); - $prev = -$cRow['uid']; - } - } - // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element: - if (!$edit_record) { - $edit_record = 'tt_content:new/' . $prev . '/' . $colPos; - $inValue = 'tt_content:new/' . $prev . '/' . $colPos; - $isSelected += (int)$edit_record == $inValue; - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle('[ ' . $lang->getLL('newLabel') . ' ]') - ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->controller->id . '&edit_record=' . $inValue . $retUrlStr) - ->setActive($edit_record == $inValue); - $quickEditMenu->addMenuItem($menuItem); - } - // If none is yet selected... - if (!$isSelected) { - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle('__________') - ->setHref('#'); - $quickEditMenu->addMenuItem($menuItem); - $menuItem = $quickEditMenu->makeMenuItem() - ->setTitle('[ ' . $lang->getLL('newLabel') . ' ]') - ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->controller->id . '&edit_record=' . $edit_record . $retUrlStr) - ->setActive($edit_record == $inValue); - $quickEditMenu->addMenuItem($menuItem); - } - $this->controller->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($quickEditMenu); - return $edit_record; - } - - /** - * Renders the action content - * - * @return string the content - */ - protected function renderContent() - { - $beUser = $this->getBackendUser(); - $lang = $this->getLanguageService(); - // Set the edit_record value for internal use in this function: - $edit_record = $this->controller->edit_record; - // If a command to edit all records in a column is issue, then select all those elements, and redirect to FormEngine - if (substr($edit_record, 0, 9) === '_EDIT_COL') { - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content'); - if ($this->controller->MOD_SETTINGS['tt_content_showHidden']) { - $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class)); - } - $statement = $queryBuilder->select('*') - ->from('tt_content') - ->orderBy('sorting') - ->where( - $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($this->controller->id, \PDO::PARAM_INT)), - $queryBuilder->expr()->eq( - 'colPos', - $queryBuilder->createNamedParameter(substr($edit_record, 10), \PDO::PARAM_INT) - ), - $queryBuilder->expr()->eq( - 'sys_language_uid', - $queryBuilder->createNamedParameter($this->controller->current_sys_language, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->orX( - $queryBuilder->expr()->gte( - 't3ver_state', - $queryBuilder->createNamedParameter( - (string)new VersionState(VersionState::DEFAULT_STATE), - \PDO::PARAM_INT - ) - ), - $queryBuilder->expr()->eq( - 't3ver_wsid', - $queryBuilder->createNamedParameter($beUser->workspace, \PDO::PARAM_INT) - ) - ) - ) - ->execute(); - $idListA = []; - while ($cRow = $statement->fetch()) { - $idListA[] = $cRow['uid']; - } - $url = BackendUtility::getModuleUrl('record_edit', [ - 'edit[tt_content][' . implode(',', $idListA) . ']' => 'edit', - 'returnUrl' => $this->controller->local_linkThisScript(['edit_record' => '']) - ]); - HttpUtility::redirect($url); - } - // If the former record edited was the creation of a NEW record, this will look up the created records uid: - if ($this->controller->new_unique_uid) { - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_log'); - $queryBuilder->getRestrictions()->removeAll(); - $sys_log_row = $queryBuilder->select('tablename', 'recuid') - ->from('sys_log') - ->where( - $queryBuilder->expr()->eq( - 'userid', - $queryBuilder->createNamedParameter($beUser->user['uid'], \PDO::PARAM_INT) - ), - $queryBuilder->expr()->eq( - 'NEWid', - $queryBuilder->createNamedParameter($this->controller->new_unique_uid, \PDO::PARAM_INT) - ) - ) - ->execute() - ->fetch(); - if (is_array($sys_log_row)) { - $edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid']; - } - } - $edit_record = $this->makeMenu($edit_record); - // Splitting the edit-record cmd value into table/uid: - $this->eRParts = explode(':', $edit_record); - $tableName = $this->eRParts[0]; - // Delete-button flag? - $this->deleteButton = MathUtility::canBeInterpretedAsInteger($this->eRParts[1]) && $edit_record && ($tableName !== 'pages' && $this->controller->EDIT_CONTENT || $tableName === 'pages' && $this->controller->CALC_PERMS & Permission::PAGE_DELETE); - // If undo-button should be rendered (depends on available items in sys_history) - $this->undoButton = false; - - // if there is no content on a page - // the parameter $this->eRParts[1] will be set to e.g. /new/1 - // which is not an integer value and it will throw an exception here on certain dbms - // thus let's check that before as there cannot be a history for a new record - $this->undoButtonR = false; - if (MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) { - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_history'); - $queryBuilder->getRestrictions()->removeAll(); - $this->undoButtonR = $queryBuilder->select('tstamp') - ->from('sys_history') - ->where( - $queryBuilder->expr()->eq( - 'tablename', - $queryBuilder->createNamedParameter($tableName, \PDO::PARAM_STR) - ), - $queryBuilder->expr()->eq( - 'recuid', - $queryBuilder->createNamedParameter($this->eRParts[1], \PDO::PARAM_INT) - ) - ) - ->orderBy('tstamp', 'DESC') - ->setMaxResults(1) - ->execute() - ->fetch(); - } - if ($this->undoButtonR) { - $this->undoButton = true; - } - // Setting up the Return URL for coming back to THIS script (if links take the user to another script) - $R_URL_parts = parse_url(GeneralUtility::getIndpEnv('REQUEST_URI')); - $R_URL_getvars = GeneralUtility::_GET(); - unset($R_URL_getvars['popView']); - unset($R_URL_getvars['new_unique_uid']); - $R_URL_getvars['edit_record'] = $edit_record; - $this->R_URI = $R_URL_parts['path'] . '?' . GeneralUtility::implodeArrayForUrl('', $R_URL_getvars); - - // Creating editing form: - if ($edit_record) { - // Splitting uid parts for special features, if new: - list($uidVal, $neighborRecordUid, $ex_colPos) = explode('/', $this->eRParts[1]); - - if ($uidVal === 'new') { - $command = 'new'; - // Page id of this new record - $theUid = $this->controller->id; - if ($neighborRecordUid) { - $theUid = $neighborRecordUid; - } - } else { - $command = 'edit'; - $theUid = $uidVal; - // Convert $uidVal to workspace version if any: - $draftRecord = BackendUtility::getWorkspaceVersionOfRecord($beUser->workspace, $tableName, $theUid, 'uid'); - if ($draftRecord) { - $theUid = $draftRecord['uid']; - } - } - - // @todo: Hack because DatabaseInitializeNewRow reads from _GP directly - $GLOBALS['_GET']['defVals'][$tableName] = [ - 'colPos' => (int)$ex_colPos, - 'sys_language_uid' => (int)$this->controller->current_sys_language - ]; - - /** @var TcaDatabaseRecord $formDataGroup */ - $formDataGroup = GeneralUtility::makeInstance(TcaDatabaseRecord::class); - /** @var FormDataCompiler $formDataCompiler */ - $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup); - /** @var NodeFactory $nodeFactory */ - $nodeFactory = GeneralUtility::makeInstance(NodeFactory::class); - - try { - $formDataCompilerInput = [ - 'tableName' => $tableName, - 'vanillaUid' => (int)$theUid, - 'command' => $command, - ]; - $formData = $formDataCompiler->compile($formDataCompilerInput); - - if ($command !== 'new') { - BackendUtility::lockRecords($tableName, $formData['databaseRow']['uid'], $tableName === 'tt_content' ? $formData['databaseRow']['pid'] : 0); - } - - $formData['renderType'] = 'outerWrapContainer'; - $formResult = $nodeFactory->create($formData)->render(); - - $panel = $formResult['html']; - $formResult['html'] = ''; - - /** @var FormResultCompiler $formResultCompiler */ - $formResultCompiler = GeneralUtility::makeInstance(FormResultCompiler::class); - $formResultCompiler->mergeResult($formResult); - - $row = $formData['databaseRow']; - $new_unique_uid = ''; - if ($command === 'new') { - $new_unique_uid = $row['uid']; - } - - // Add hidden fields: - if ($uidVal === 'new') { - $panel .= '<input type="hidden" name="data[' . $tableName . '][' . $row['uid'] . '][pid]" value="' . $row['pid'] . '" />'; - } - $redirect = ($uidVal === 'new' ? BackendUtility::getModuleUrl( - $this->moduleName, - ['id' => $this->controller->id, 'new_unique_uid' => $new_unique_uid, 'returnUrl' => $this->returnUrl] - ) : $this->R_URI); - $panel .= ' - <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" /> - <input type="hidden" name="edit_record" value="' . $edit_record . '" /> - <input type="hidden" name="redirect" value="' . htmlspecialchars($redirect) . '" /> - '; - // Add JavaScript as needed around the form: - $content = $formResultCompiler->addCssFiles() . $panel . $formResultCompiler->printNeededJSFunctions(); - - // Display "is-locked" message: - if ($command === 'edit') { - $lockInfo = BackendUtility::isRecordLocked($tableName, $formData['databaseRow']['uid']); - if ($lockInfo) { - /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */ - $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $lockInfo['msg'], '', FlashMessage::WARNING); - /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */ - $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); - /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */ - $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); - $defaultFlashMessageQueue->enqueue($flashMessage); - } - } - } catch (AccessDeniedException $e) { - // If no edit access, print error message: - $content = '<h2>' . htmlspecialchars($lang->getLL('noAccess')) . '</h2>'; - $content .= '<div>' . $lang->getLL('noAccess_msg') . '<br /><br />' . ($beUser->errorMsg ? 'Reason: ' . $beUser->errorMsg . '<br /><br />' : '') . '</div>'; - } - } else { - // If no edit access, print error message: - $content = '<h2>' . $lang->getLL('noAccess') . '</h2>'; - $content .= '<div>' . $lang->getLL('noAccess_msg') . '</div>'; - } - - // Element selection matrix: - if ($tableName === 'tt_content' && MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) { - $content .= '<h2>' . $lang->getLL('CEonThisPage') . '</h2>'; - // PositionMap - $posMap = GeneralUtility::makeInstance(ContentLayoutPagePositionMap::class); - $posMap->cur_sys_language = $this->controller->current_sys_language; - $content .= $posMap->printContentElementColumns( - $this->controller->id, - $this->eRParts[1], - $this->controller->colPosList, - $this->controller->MOD_SETTINGS['tt_content_showHidden'], - $this->R_URI - ); - // Toggle hidden ContentElements - $numberOfHiddenElements = $this->controller->getNumberOfHiddenElements(); - if ($numberOfHiddenElements) { - $content .= '<div class="checkbox">'; - $content .= '<label for="checkTt_content_showHidden">'; - $content .= BackendUtility::getFuncCheck($this->controller->id, 'SET[tt_content_showHidden]', $this->controller->MOD_SETTINGS['tt_content_showHidden'], '', '', 'id="checkTt_content_showHidden"'); - $content .= (!$numberOfHiddenElements ? ('<span class="text-muted">' . htmlspecialchars($lang->getLL('hiddenCE')) . '</span>') : htmlspecialchars($lang->getLL('hiddenCE')) . ' (' . $numberOfHiddenElements . ')'); - $content .= '</label>'; - $content .= '</div>'; - } - // CSH - $content .= BackendUtility::cshItem($this->descrTable, 'quickEdit_selElement', null, '<span class="btn btn-default btn-sm">|</span>'); - } - - $content = '<form action="' . - htmlspecialchars(BackendUtility::getModuleUrl('tce_db', ['prErr' => 1, 'uPT' => 1])) . - '" method="post" enctype="multipart/form-data" name="editform" id="PageLayoutController" onsubmit="return TBE_EDITOR.checkSubmit(1);">' . - $content . - '</form>'; - - return $content; - } - - /** - * Returns LanguageService - * - * @return \TYPO3\CMS\Lang\LanguageService - */ - protected function getLanguageService() - { - return $GLOBALS['LANG']; - } - - /** - * Returns the current BE user. - * - * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication - */ - protected function getBackendUser() - { - return $GLOBALS['BE_USER']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/Hooks/TcaSoftExcludeHook.php b/typo3/sysext/compatibility7/Classes/Hooks/TcaSoftExcludeHook.php deleted file mode 100644 index 811a7aac50c0..000000000000 --- a/typo3/sysext/compatibility7/Classes/Hooks/TcaSoftExcludeHook.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Hooks; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; - -/** - * Hook to validate the TypoScript option - * config.sys_language_softExclude - * that allows to set certain table/field combinations to use l10n_mode=exclude which have not set to l10n_mode - * by default. - * - * This option is mostly obsolete with TYPO3 v8 as the database sets for translation modes are handled via - * "allowLanguageSynchronization" where all fields are properly filled in all translations - */ -class TcaSoftExcludeHook -{ - /** - * Hooks in TSFE after the language initialization to set TCA l10n_mode=exclude on certain fields - * on runtime, called "softExclude" - * - * @param array $parameters left empty, not in use - * @param TypoScriptFrontendController $parentObject - */ - public function setCustomExcludeFields(array $parameters, TypoScriptFrontendController $parentObject) - { - if (isset($parentObject->config['config']['sys_language_softExclude']) - && !empty($parentObject->config['config']['sys_language_softExclude'])) { - $tableFieldCombinations = GeneralUtility::trimExplode(',', $parentObject->config['config']['sys_language_softExclude'], true); - foreach ($tableFieldCombinations as $tableFieldCombination) { - list($tableName, $fieldName) = explode(':', $tableFieldCombination); - $GLOBALS['TCA'][$tableName]['columns'][$fieldName]['l10n_mode'] = 'exclude'; - } - } - } -} diff --git a/typo3/sysext/compatibility7/Classes/Report/Status/SystemStatus.php b/typo3/sysext/compatibility7/Classes/Report/Status/SystemStatus.php deleted file mode 100644 index 2278f20ffa36..000000000000 --- a/typo3/sysext/compatibility7/Classes/Report/Status/SystemStatus.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Report\Status; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Registry; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Lang\LanguageService; -use TYPO3\CMS\Reports\Status as ReportStatus; -use TYPO3\CMS\Reports\StatusProviderInterface; - -/** - * Adds peak memory stats from frontend call. - */ -class SystemStatus implements StatusProviderInterface -{ - /** - * Main API method - * - * @return array List of statuses - */ - public function getStatus() - { - $this->executeAdminCommand(); - $statuses = [ - 'PhpPeakMemory' => $this->getPhpPeakMemoryStatus(), - ]; - return $statuses; - } - - /** - * Executes commands like clearing the memory status flag - * - * @return void - */ - protected function executeAdminCommand() - { - $command = GeneralUtility::_GET('adminCmd'); - switch ($command) { - case 'clear_peak_memory_usage_flag': - /** @var Registry $registry */ - $registry = GeneralUtility::makeInstance(Registry::class); - $registry->remove('core', 'reports-peakMemoryUsage'); - break; - default: - // Do nothing - } - } - - /** - * Checks if there was a request in the past which approached the memory limit - * - * @return \TYPO3\CMS\Reports\Status A status of whether the memory limit was approached by one of the requests - */ - protected function getPhpPeakMemoryStatus() - { - /** @var Registry $registry */ - $registry = GeneralUtility::makeInstance(Registry::class); - $peakMemoryUsage = $registry->get('core', 'reports-peakMemoryUsage'); - $memoryLimit = GeneralUtility::getBytesFromSizeMeasurement(ini_get('memory_limit')); - $value = $this->getLanguageService()->getLL('status_ok'); - $message = ''; - $severity = ReportStatus::OK; - $bytesUsed = $peakMemoryUsage['used']; - $percentageUsed = $memoryLimit ? number_format($bytesUsed / $memoryLimit * 100, 1) . '%' : '?'; - $dateOfPeak = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $peakMemoryUsage['tstamp']); - $urlOfPeak = '<a href="' . htmlspecialchars($peakMemoryUsage['url']) . '">' . htmlspecialchars($peakMemoryUsage['url']) . '</a>'; - $clearFlagUrl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') . '&adminCmd=clear_peak_memory_usage_flag'; - if ($peakMemoryUsage['used']) { - $message = sprintf($this->getLanguageService()->getLL('status_phpPeakMemoryTooHigh'), GeneralUtility::formatSize($peakMemoryUsage['used']), $percentageUsed, GeneralUtility::formatSize($memoryLimit), $dateOfPeak, $urlOfPeak); - $message .= ' <a href="' . $clearFlagUrl . '">' . $this->getLanguageService()->getLL('status_phpPeakMemoryClearFlag') . '</a>.'; - $severity = ReportStatus::WARNING; - $value = $percentageUsed; - } - return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_phpPeakMemory'), $value, $message, $severity); - } - - /** - * @return LanguageService - */ - protected function getLanguageService() - { - return $GLOBALS['LANG']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/Utility/MonitorUtility.php b/typo3/sysext/compatibility7/Classes/Utility/MonitorUtility.php deleted file mode 100644 index 57965ebf43b7..000000000000 --- a/typo3/sysext/compatibility7/Classes/Utility/MonitorUtility.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\Utility; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Utility\GeneralUtility; - -/** - * Class to handle monitoring actions. - */ -class MonitorUtility -{ - /** - * Checks peak memory usage and stores data in cache for use in the report module - * - * @return void - */ - public static function peakMemoryUsage() - { - $peakUsage = memory_get_peak_usage(true); - $memoryLimit = GeneralUtility::getBytesFromSizeMeasurement(ini_get('memory_limit')); - if (is_float($memoryLimit) && $memoryLimit != 0) { - if ($peakUsage / $memoryLimit >= 0.9) { - /** @var $registry \TYPO3\CMS\Core\Registry */ - $registry = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Registry::class); - $data = [ - 'used' => $peakUsage, - 'tstamp' => $GLOBALS['EXEC_TIME'], - 'url' => GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') - ]; - $registry->set('core', 'reports-peakMemoryUsage', $data); - } - } - } - - /** - * Hook called by TypoScriptFrontendController - * - * @return void - */ - public function monitorUtilityFrontendHook() - { - self::peakMemoryUsage(); - } -} diff --git a/typo3/sysext/compatibility7/Classes/View/VersionView.php b/typo3/sysext/compatibility7/Classes/View/VersionView.php deleted file mode 100644 index 79a53e20a475..000000000000 --- a/typo3/sysext/compatibility7/Classes/View/VersionView.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\View; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Backend\Utility\BackendUtility; -use TYPO3\CMS\Core\Imaging\Icon; -use TYPO3\CMS\Core\Imaging\IconFactory; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Lang\LanguageService; - -/** - * Contains some parts for staging, versioning and workspaces - * to interact with the TYPO3 Core Engine - */ -class VersionView -{ - /** - * Creates the version selector for the page id inputted. - * Moved out of the core file \TYPO3\CMS\Backend\Template\DocumentTemplate - * - * @param int $id Page id to create selector for. - * @param bool $noAction If set, there will be no button for swapping page. - * @return string - * @see \TYPO3\CMS\Backend\Template\DocumentTemplate - */ - public function getVersionSelector($id, $noAction = false) - { - if ($id <= 0) { - return ''; - } - if ($GLOBALS['BE_USER']->workspace == 0) { - $lang = $this->getLanguageService(); - // Get Current page record: - $curPage = BackendUtility::getRecord('pages', $id); - // If the selected page is not online, find the right ID - $onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id; - // Select all versions of online version: - $versions = BackendUtility::selectVersionsOfRecord('pages', $onlineId, 'uid,pid,t3ver_label,t3ver_oid,t3ver_wsid,t3ver_id', null); - // If more than one was found...: - if (count($versions) > 1) { - // Create selector box entries: - $opt = []; - foreach ($versions as $vRow) { - if ($vRow['uid'] == $onlineId) { - // Live version - $label = '[' . htmlspecialchars($lang->sL('LLL:EXT:compatibility7/Resources/Private/Language/locallang_version.xlf:versionSelect.live')) . ']'; - } else { - $label = $vRow['t3ver_label'] . ' (' . htmlspecialchars($lang->sL('LLL:EXT:compatibility7/Resources/Private/Language/locallang_version.xlf:versionId')) . ' ' . $vRow['t3ver_id'] . ($vRow['t3ver_wsid'] != 0 ? ' ' . htmlspecialchars($lang->sL('LLL:EXT:compatibility7/Resources/Private/Language/locallang_version.xlf:workspaceId')) . ' ' . $vRow['t3ver_wsid'] : '') . ')'; - } - $opt[] = '<option value="' . htmlspecialchars(GeneralUtility::linkThisScript(['id' => $vRow['uid']])) . '"' . ($id == $vRow['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>'; - } - /** @var $iconFactory \TYPO3\CMS\Core\Imaging\IconFactory */ - $iconFactory = GeneralUtility::makeInstance(IconFactory::class); - // Add management link: - $management = ' - <a class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_txversionM1', ['table' => 'pages', 'uid' => $onlineId])) . '"> - ' . $iconFactory->getIcon('actions-version-page-open', Icon::SIZE_SMALL)->render() . ' - ' . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:ver.mgm')) . ' - </a>'; - // Create onchange handler: - $onChange = 'window.location.href=this.options[this.selectedIndex].value;'; - // Controls: - if ($id == $onlineId) { - $controls = '<strong class="text-success">' . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:ver.online')) . '</strong>'; - } elseif (!$noAction) { - $href = BackendUtility::getLinkToDataHandlerAction( - '&cmd[pages][' . $onlineId . '][version][swapWith]=' . $id . '&cmd[pages][' . $onlineId . '][version][action]=swap', - GeneralUtility::linkThisScript(['id' => $onlineId]) - ); - $controls = ' - <a href="' . htmlspecialchars($href) . '" class="btn btn-default" title="' . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:ver.swapPage')) . '"> - ' . $iconFactory->getIcon('actions-version-swap-version', Icon::SIZE_SMALL)->render() . ' - ' . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:ver.swap')) . ' - </a>'; - } - // Write out HTML code: - return ' - <!-- - Version selector: - --> - <div id="typo3-version-selector" class="form-inline form-inline-spaced"> - <div class="form-group"> - <label for="version-selector">' . htmlspecialchars($lang->sL('LLL:EXT:compatibility7/Resources/Private/Language/locallang_version.xlf:versionSelect.label')) . '</label> - <select id="version-selector" class="form-control" onchange="' . htmlspecialchars($onChange) . '"> - ' . implode('', $opt) . ' - </select> - </div> - <div class="form-group"> - ' . $controls . ' - </div> - <div class="form-group"> - ' . $management . ' - </div> - </div> - '; - } - } - } - - /** - * @return LanguageService - */ - protected function getLanguageService() - { - return $GLOBALS['LANG']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php deleted file mode 100644 index f6414373e5ed..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * 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\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; -use TYPO3\CMS\Frontend\Page\PageRepository; - -/** - * Class AbstractMenuViewHelper - */ -abstract class AbstractMenuViewHelper extends AbstractViewHelper -{ - /** - * Get the constraints for the page based on doktype and field "nav_hide" - * - * By default the following doktypes are always ignored: - * - 6: Backend User Section - * - > 200: Folder (254) - * Recycler (255) - * - * Optional are: - * - 199: Menu separator - * - nav_hide: Not in menu - * - * @param bool $includeNotInMenu Should pages which are hidden for menu's be included - * @param bool $includeMenuSeparator Should pages of type "Menu separator" be included - * @return string - */ - protected function getPageConstraints($includeNotInMenu = false, $includeMenuSeparator = false) - { - $constraints = []; - - $constraints[] = 'doktype NOT IN (' . PageRepository::DOKTYPE_BE_USER_SECTION . ',' . PageRepository::DOKTYPE_RECYCLER . ',' . PageRepository::DOKTYPE_SYSFOLDER . ')'; - - if (!$includeNotInMenu) { - $constraints[] = 'nav_hide = 0'; - } - - if (!$includeMenuSeparator) { - $constraints[] = 'doktype != ' . PageRepository::DOKTYPE_SPACER; - } - - return 'AND ' . implode(' AND ', $constraints); - } - - /** - * Get a filtered list of page UIDs according to initial list - * of UIDs and entryLevel parameter. - * - * @param array $pageUids - * @param int|null $entryLevel - * @return array - */ - protected function getPageUids(array $pageUids, $entryLevel = 0) - { - $typoScriptFrontendController = $this->getTypoScriptFrontendController(); - - // Remove empty entries from array - $pageUids = array_filter($pageUids); - - // If no pages have been defined, use the current page - if (empty($pageUids)) { - if ($entryLevel !== null) { - if ($entryLevel < 0) { - $entryLevel = count($typoScriptFrontendController->tmpl->rootLine) - 1 + $entryLevel; - } - $pageUids = [$typoScriptFrontendController->tmpl->rootLine[$entryLevel]['uid']]; - } else { - $pageUids = [$typoScriptFrontendController->id]; - } - } - - return $pageUids; - } - - /** - * @param array $variables - * @return mixed - */ - protected function renderChildrenWithVariables(array $variables) - { - foreach ($variables as $name => $value) { - $this->templateVariableContainer->add($name, $value); - } - - $output = $this->renderChildren(); - - foreach ($variables as $name => $_) { - $this->templateVariableContainer->remove($name); - } - - return $output; - } - - /** - * @return TypoScriptFrontendController - */ - protected function getTypoScriptFrontendController() - { - return $GLOBALS['TSFE']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/CategoriesViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/CategoriesViewHelper.php deleted file mode 100644 index 8155be0b0d93..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/CategoriesViewHelper.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * 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\Fluid\Core\ViewHelper\Exception; -use TYPO3\CMS\Frontend\Category\Collection\CategoryCollection; - -/** - * A view helper which returns records with assigned categories - * - * = Example = - * - * <code title="Pages with categories 1 and 2 assigned"> - * <ce:menu.categories categoryUids="{0: 1, 1: 2}" as="pages" relationField="categories" table="pages"> - * <f:for each="{pages}" as="page"> - * {page.title} - * </f:for> - * </ce:menu.categories> - * </code> - * - * <output> - * Page with category 1 assigned - * Page with category 1 and 2 assigned - * </output> - */ -class CategoriesViewHelper extends AbstractMenuViewHelper -{ - /** - * Output escaping is disabled as child content contains HTML by default - * - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize ViewHelper arguments - * - * @return void - */ - public function initializeArguments() - { - $this->registerArgument('categoryUids', 'array', 'The categories assigned', true); - $this->registerArgument('as', 'string', 'Name of the template variable that will contain resolved pages', true); - $this->registerArgument('relationField', 'string', 'The category field for MM relation table', true); - $this->registerArgument('table', 'string', 'The table to which categories are assigned (source table)', true); - } - - /** - * Render the view helper - * - * @return string - */ - public function render() - { - $categoryUids = (array)$this->arguments['categoryUids']; - $as = (string)$this->arguments['as']; - if (empty($categoryUids)) { - return ''; - } - - return $this->renderChildrenWithVariables([ - $as => $this->findByCategories($categoryUids, $this->arguments['relationField'], $this->arguments['table']) - ]); - } - - /** - * Find records from a certain table which have categories assigned - * - * @param array $categoryUids The uids of the categories - * @param string $relationField Field relation in MM table - * @param string $tableName Name of the table to search in - * @return array - * @throws Exception - */ - protected function findByCategories($categoryUids, $relationField, $tableName = 'pages') - { - $result = []; - - foreach ($categoryUids as $categoryUid) { - try { - $collection = CategoryCollection::load( - $categoryUid, - true, - $tableName, - $relationField - ); - if ($collection->count() > 0) { - foreach ($collection as $record) { - $result[$record['uid']] = $record; - } - } - } catch (\RuntimeException $e) { - throw new Exception($e->getMessage(), 1476122186); - } - } - - return $result; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/DirectoryViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/DirectoryViewHelper.php deleted file mode 100644 index e79a23897c0d..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/DirectoryViewHelper.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * 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! - */ - -/** - * A view helper which returns the subpages of the given pages - * - * = Example = - * - * <code title="Directory of pages with uid = 1 and uid = 2"> - * <ce:menu.directory pageUids="{0: 1, 1: 2}" as="pages"> - * <f:for each="{pages}" as="page"> - * {page.title} - * </f:for> - * </ce:menu.directory> - * </code> - * - * <output> - * Subpage 1 of page with uid = 1 - * Subpage 2 of page with uid = 1 - * Subpage 1 of page with uid = 2 - * </output> - */ -class DirectoryViewHelper extends AbstractMenuViewHelper -{ - /** - * Output escaping is disabled as child content contains HTML by default - * - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize ViewHelper arguments - * - * @return void - */ - public function initializeArguments() - { - $this->registerArgument('as', 'string', 'Name of template variable which will contain selected pages', true); - $this->registerArgument('levelAs', 'string', 'Name of template variable which will contain current level', false, null); - $this->registerArgument('pageUids', 'array', 'Page UIDs of parent pages', false, []); - $this->registerArgument('entryLevel', 'integer', 'The entry level', false, null); - $this->registerArgument('maximumLevel', 'integer', 'Maximum level for rendering of nested menus', false, 10); - $this->registerArgument('includeNotInMenu', 'boolean', 'Include pages that are marked "hide in menu"?', false, false); - $this->registerArgument('includeMenuSeparator', 'boolean', 'Include pages of the type "Menu separator"?', false, false); - } - - /** - * Render the view helper - * - * @return string - */ - public function render() - { - $typoScriptFrontendController = $this->getTypoScriptFrontendController(); - $as = $this->arguments['as']; - $pageUids = (array)$this->arguments['pageUids']; - $entryLevel = $this->arguments['entryLevel']; - $levelAs = $this->arguments['levelAs']; - $maximumLevel = $this->arguments['maximumLevel']; - $includeNotInMenu = (bool)$this->arguments['includeNotInMenu']; - $includeMenuSeparator = (bool)$this->arguments['includeMenuSeparator']; - - $pageUids = $this->getPageUids($pageUids, $entryLevel); - $pages = $typoScriptFrontendController->sys_page->getMenu( - $pageUids, - '*', - 'sorting', - $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator) - ); - - $output = ''; - - if (!empty($pages)) { - if (!$typoScriptFrontendController->register['ceMenuLevel_directory']) { - $typoScriptFrontendController->register['ceMenuLevel_directory'] = 1; - $typoScriptFrontendController->register['ceMenuMaximumLevel_directory'] = $maximumLevel; - } else { - $typoScriptFrontendController->register['ceMenuLevel_directory']++; - } - - if ($typoScriptFrontendController->register['ceMenuLevel_directory'] > $typoScriptFrontendController->register['ceMenuMaximumLevel_directory']) { - return ''; - } - - $variables = [ - $as => $pages - ]; - if (!empty($levelAs)) { - $variables[$levelAs] = $typoScriptFrontendController->register['ceMenuLevel_directory']; - } - $output = $this->renderChildrenWithVariables($variables); - - $typoScriptFrontendController->register['ceMenuLevel_directory']--; - - if ($typoScriptFrontendController->register['ceMenuLevel_directory'] === 0) { - unset( - $typoScriptFrontendController->register['ceMenuLevel_directory'], - $typoScriptFrontendController->register['ceMenuMaximumLevel_directory'] - ); - } - } - - return $output; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/KeywordsViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/KeywordsViewHelper.php deleted file mode 100644 index 43d71abfd8a8..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/KeywordsViewHelper.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Utility\GeneralUtility; - -/** - * A view helper which returns pages with one of the same keywords as the given pages - * - * Search default starts at the root of the current page tree. - * With entryLevel this can be adjusted. - * - * = Example = - * - * <code title="Pages with the similar keyword(s) of page uid = 1 and uid = 2"> - * <ce:menu.keywords pageUids="{0: 1, 1: 2}" as="pages"> - * <f:for each="{pages}" as="page"> - * {page.title} - * </f:for> - * </ce:menu.keywords> - * </code> - * - * <output> - * Page with the keywords "typo3" and "fluid" - * Page with the keyword "fluid" - * Page with the keyword "typo3" - * </output> - */ -class KeywordsViewHelper extends AbstractMenuViewHelper -{ - /** - * Output escaping is disabled as child content contains HTML by default - * - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize ViewHelper arguments - * - * @return void - */ - public function initializeArguments() - { - $this->registerArgument('as', 'string', 'Name of template variable which will contain selected pages', true); - $this->registerArgument('entryLevel', 'integer', 'The entry level', false, 0); - $this->registerArgument('pageUids', 'array', 'Page UIDs of pages to fetch the keywords from', false, []); - $this->registerArgument('keywords', 'array', 'Keywords for which to search', false, []); - $this->registerArgument('includeNotInMenu', 'boolean', 'Include pages that are marked "hide in menu"?', false, false); - $this->registerArgument('includeMenuSeparator', 'boolean', 'Include pages of the type "Menu separator"?', false, false); - $this->registerArgument('excludeNoSearchPages', 'boolean', 'Exclude pages that are NOT marked "include in search"?', false, true); - } - - /** - * Render the view helper - * - * @return string - */ - public function render() - { - $typoScriptFrontendController = $this->getTypoScriptFrontendController(); - $as = (string)$this->arguments['as']; - $entryLevel = (int)$this->arguments['entryLevel']; - $pageUids = (array)$this->arguments['pageUids']; - $keywords = (array)$this->arguments['keywords']; - $includeNotInMenu = (bool)$this->arguments['includeNotInMenu']; - $includeMenuSeparator = (bool)$this->arguments['includeMenuSeparator']; - $excludeNoSearchPages = (bool)$this->arguments['excludeNoSearchPages']; - - // If no pages have been defined, use the current page - if (empty($pageUids)) { - $pageUids = [$typoScriptFrontendController->page['uid']]; - } - - // Transform the keywords list into an array - if (!is_array($keywords)) { - $unfilteredKeywords = $this->keywordsToArray($keywords); - } else { - $unfilteredKeywords = $keywords; - } - - // Use the keywords of the page when none has been given - if (empty($keywords)) { - foreach ($pageUids as $pageUid) { - $page = $typoScriptFrontendController->sys_page->getPage($pageUid); - $unfilteredKeywords = array_merge( - $unfilteredKeywords, - $this->keywordsToArray($page['keywords']) - ); - } - } - $filteredKeywords = array_unique($unfilteredKeywords); - - $constraints = $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator); - if ($excludeNoSearchPages) { - $constraints .= ' AND no_search = 0'; - } - - $keywordConstraints = []; - if ($filteredKeywords) { - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages'); - foreach ($filteredKeywords as $keyword) { - $keyword = $queryBuilder->quote('%' . $queryBuilder->escapeLikeWildcards($keyword) . '%'); - $keywordConstraints[] = 'keywords LIKE ' . $keyword; - } - $constraints .= ' AND (' . implode(' OR ', $keywordConstraints) . ')'; - } - - // Start point - if ($entryLevel < 0) { - $entryLevel = count($typoScriptFrontendController->tmpl->rootLine) - 1 + $entryLevel; - } - $startUid = $typoScriptFrontendController->tmpl->rootLine[$entryLevel]['uid']; - $treePageUids = explode( - ',', - $typoScriptFrontendController->cObj->getTreeList($startUid, 20) - ); - - $pages = $typoScriptFrontendController->sys_page->getMenuForPages( - array_merge([$startUid], $treePageUids), - '*', - '', - $constraints - ); - return $this->renderChildrenWithVariables([ - $as => $pages - ]); - } - - /** - * Get a clean array of keywords - * - * The list of keywords can have a separator like comma, semicolon or line feed - * - * @param string $keywords The list of keywords - * @return array Cleaned up list - */ - protected function keywordsToArray($keywords) - { - $keywordList = preg_split('/[,;' . LF . ']/', $keywords); - - return array_filter(array_map('trim', $keywordList)); - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/ListViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/ListViewHelper.php deleted file mode 100644 index f52eb57d495e..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/ListViewHelper.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * 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! - */ - -/** - * A view helper which returns a list of pages - * - * = Example = - * - * <code title="List of pages with uid = 1 and uid = 2"> - * <ce:menu.list pageUids="{0: 1, 1: 2}" as="pages"> - * <f:for each="{pages}" as="page"> - * {page.title} - * </f:for> - * </ce:menu.list> - * </code> - * - * <output> - * Page with uid = 1 - * Page with uid = 2 - * </output> - */ -class ListViewHelper extends AbstractMenuViewHelper -{ - /** - * Output escaping is disabled as child content contains HTML by default - * - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize ViewHelper arguments - */ - public function initializeArguments() - { - $this->registerArgument('as', 'string', 'Name of template variable which will contain selected pages', true); - $this->registerArgument('levelAs', 'string', 'Name of template variable which will contain current level', false, null); - $this->registerArgument('pageUids', 'array', 'Page UIDs of parent pages', false, []); - $this->registerArgument('entryLevel', 'integer', 'The entry level', false, null); - $this->registerArgument('maximumLevel', 'integer', 'Maximum level for rendering of nested menus', false, 10); - $this->registerArgument('includeNotInMenu', 'boolean', 'Include pages that are marked "hide in menu"?', false, false); - $this->registerArgument('includeMenuSeparator', 'boolean', 'Include pages of the type "Menu separator"?', false, false); - } - - /** - * Render the view helper - * - * @return string - * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception - */ - public function render() - { - $typoScriptFrontendController = $this->getTypoScriptFrontendController(); - $as = $this->arguments['as']; - $pageUids = (array)$this->arguments['pageUids']; - $entryLevel = $this->arguments['entryLevel']; - $levelAs = $this->arguments['levelAs']; - $maximumLevel = $this->arguments['maximumLevel']; - $includeNotInMenu = (bool)$this->arguments['includeNotInMenu']; - $includeMenuSeparator = (bool)$this->arguments['includeMenuSeparator']; - - $pageUids = $this->getPageUids($pageUids, $entryLevel); - $pages = $typoScriptFrontendController->sys_page->getMenuForPages( - $pageUids, - '*', - '', - $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator) - ); - - $tempPagesForSort = []; - foreach ($pageUids as $pageUid) { - if ($pages[$pageUid]) { - $tempPagesForSort[$pageUid] = $pages[$pageUid]; - } - } - $pages = $tempPagesForSort; - - $output = ''; - - if (!empty($pages)) { - if (!$typoScriptFrontendController->register['ceMenuLevel_list']) { - $typoScriptFrontendController->register['ceMenuLevel_list'] = 1; - $typoScriptFrontendController->register['ceMenuMaximumLevel_list'] = $maximumLevel; - } else { - $typoScriptFrontendController->register['ceMenuLevel_list']++; - } - - if ($typoScriptFrontendController->register['ceMenuLevel_list'] > $typoScriptFrontendController->register['ceMenuMaximumLevel_list']) { - return ''; - } - - $variables = [ - $as => $pages - ]; - if (!empty($levelAs)) { - $variables[$levelAs] = $typoScriptFrontendController->register['ceMenuLevel_list']; - } - $output = $this->renderChildrenWithVariables($variables); - - $typoScriptFrontendController->register['ceMenuLevel_list']--; - - if ($typoScriptFrontendController->register['ceMenuLevel_list'] === 0) { - unset($typoScriptFrontendController->register['ceMenuLevel_list']); - unset($typoScriptFrontendController->register['ceMenuMaximumLevel_list']); - } - } - - return $output; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/MenuViewHelperTrait.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/MenuViewHelperTrait.php deleted file mode 100644 index da1566e02b71..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/MenuViewHelperTrait.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; -use TYPO3\CMS\Frontend\Page\PageRepository; - -/** - * Trait for Menu-ViewHelpers that require support functions for - * working with menus that require page selection constraints. - * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 - */ -trait MenuViewHelperTrait -{ - /** - * Get the constraints for the page based on doktype and field "nav_hide" - * - * By default the following doktypes are always ignored: - * - 6: Backend User Section - * - > 200: Folder (254) - * Recycler (255) - * - * Optional are: - * - 199: Menu separator - * - nav_hide: Not in menu - * - * @param bool $includeNotInMenu Should pages which are hidden for menu's be included - * @param bool $includeMenuSeparator Should pages of type "Menu separator" be included - * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, use AbstractMenuViewHelper instead of MenuViewHelperTrait - * @return string - */ - protected function getPageConstraints($includeNotInMenu = false, $includeMenuSeparator = false) - { - GeneralUtility::logDeprecatedFunction(); - $constraints = []; - - $constraints[] = 'doktype NOT IN (' . PageRepository::DOKTYPE_BE_USER_SECTION . ',' . PageRepository::DOKTYPE_RECYCLER . ',' . PageRepository::DOKTYPE_SYSFOLDER . ')'; - - if (!$includeNotInMenu) { - $constraints[] = 'nav_hide = 0'; - } - - if (!$includeMenuSeparator) { - $constraints[] = 'doktype != ' . PageRepository::DOKTYPE_SPACER; - } - - return 'AND ' . implode(' AND ', $constraints); - } - - /** - * Get a filtered list of page UIDs according to initial list - * of UIDs and entryLevel parameter. - * - * @param array $pageUids - * @param int|NULL $entryLevel - * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, use AbstractMenuViewHelper instead of MenuViewHelperTrait - * @return array - */ - protected function getPageUids(array $pageUids, $entryLevel = 0) - { - GeneralUtility::logDeprecatedFunction(); - $typoScriptFrontendController = $this->getTypoScriptFrontendController(); - - // Remove empty entries from array - $pageUids = array_filter($pageUids); - - // If no pages have been defined, use the current page - if (empty($pageUids)) { - if ($entryLevel !== null) { - if ($entryLevel < 0) { - $entryLevel = count($typoScriptFrontendController->tmpl->rootLine) - 1 + $entryLevel; - } - $pageUids = [$typoScriptFrontendController->tmpl->rootLine[$entryLevel]['uid']]; - } else { - $pageUids = [$typoScriptFrontendController->id]; - } - } - - return $pageUids; - } - - /** - * @param array $variables - * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, use AbstractMenuViewHelper instead of MenuViewHelperTrait - * @return mixed - */ - protected function renderChildrenWithVariables(array $variables) - { - GeneralUtility::logDeprecatedFunction(); - foreach ($variables as $name => $value) { - $this->templateVariableContainer->add($name, $value); - } - - $output = $this->renderChildren(); - - foreach ($variables as $name => $_) { - $this->templateVariableContainer->remove($name); - } - - return $output; - } - - /** - * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, use AbstractMenuViewHelper instead of MenuViewHelperTrait - * @return TypoScriptFrontendController - */ - protected function getTypoScriptFrontendController() - { - GeneralUtility::logDeprecatedFunction(); - return $GLOBALS['TSFE']; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/SectionViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/SectionViewHelper.php deleted file mode 100644 index e5de6da178b7..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/SectionViewHelper.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Utility\GeneralUtility; - -/** - * A view helper which returns content elements with 'Show in Section Menus' enabled - * - * By default only content in colPos=0 will be found. This can be overruled by using "column" - * - * If you set property "type" to 'all', then the 'Show in Section Menus' checkbox is not considered - * and all content elements are selected. - * - * If the property "type" is 'header' then only content elements with a visible header layout - * (and a non-empty 'header' field!) are selected. - * In other words, if the header layout of an element is set to 'Hidden' then the element will not be in the results. - * - * = Example = - * - * <code title="Content elements in page with uid = 1 and 'Show in Section Menu's' enabled"> - * <ce:menu.section pageUid="1" as="contentElements"> - * <f:for each="{contentElements}" as="contentElement"> - * {contentElement.header} - * </f:for> - * </ce:menu.section> - * </code> - * - * <output> - * Content element 1 in page with uid = 1 and "Show in section menu's" enabled - * Content element 2 in page with uid = 1 and "Show in section menu's" enabled - * Content element 3 in page with uid = 1 and "Show in section menu's" enabled - * </output> - */ -class SectionViewHelper extends AbstractMenuViewHelper -{ - /** - * Output escaping is disabled as child content contains HTML by default - * - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize ViewHelper arguments - * - * @return void - */ - public function initializeArguments() - { - $this->registerArgument('as', 'string', 'Name of the template variable that will contain selected pages', true); - $this->registerArgument('column', 'string', 'Column numbers (colPos) from which to select content', false, '0'); - $this->registerArgument('pageUid', 'integer', 'UID of page containing section-objects; defaults to current page', false, null); - $this->registerArgument('type', 'string', 'Search method when selecting indices from page', false, ''); - } - - /** - * Render the view helper - * - * @return string - */ - public function render() - { - $as = (string)$this->arguments['as']; - $pageUid = (int)$this->arguments['pageUid']; - $type = (string)$this->arguments['type']; - - if (empty($pageUid)) { - $pageUid = $this->getTypoScriptFrontendController()->id; - } - - if (!empty($type) && !in_array($type, ['all', 'header'], true)) { - return ''; - } - - return $this->renderChildrenWithVariables([ - $as => $this->findBySection($pageUid, $type, $this->arguments['column']) - ]); - } - - /** - * Find content with 'Show in Section Menus' enabled in a page - * - * By default only content in colPos=0 will be found. This can be overruled by using $column - * - * If you set property type to "all", then the 'Show in Section Menus' checkbox is not considered - * and all content elements are selected. - * - * If the property $type is 'header' then only content elements with a visible header layout - * (and a non-empty 'header' field!) is selected. - * In other words, if the header layout of an element is set to 'Hidden' then the page will not appear in the menu. - * - * @param int $pageUid The page uid - * @param string $type Search method - * @param string $column Restrict content by the column number - * @return array - */ - protected function findBySection($pageUid, $type = '', $column = '') - { - $constraints = []; - if (trim($column) !== '') { - $colPosList = implode(',', GeneralUtility::intExplode(',', $column, true)); - $constraints[] = 'colPos IN(' . ($colPosList !== '' ? $colPosList : '0') . ')'; - } - - switch ($type) { - case 'all': - break; - case 'header': - $constraints[] = 'sectionIndex = 1'; - $constraints[] = 'header <> \'\''; - $constraints[] = 'header_layout <> 100'; - break; - default: - $constraints[] = 'sectionIndex = 1'; - } - - $whereStatement = implode(' AND ', $constraints); - - $contentElements = $this->getTypoScriptFrontendController()->cObj->getRecords('tt_content', [ - 'where' => $whereStatement, - 'orderBy' => 'sorting', - 'languageField' => 'sys_language_uid', - 'pidInList' => (int)$pageUid - ]); - - return $contentElements; - } -} diff --git a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/UpdatedViewHelper.php b/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/UpdatedViewHelper.php deleted file mode 100644 index 9a590d54d74d..000000000000 --- a/typo3/sysext/compatibility7/Classes/ViewHelpers/Menu/UpdatedViewHelper.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php -namespace TYPO3\CMS\Compatibility7\ViewHelpers\Menu; - -/* - * 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! - */ - -/** - * A view helper which returns recently updated subpages (multiple levels) of the given pages - * - * = Example = - * - * <code title="Pages with the similar keyword(s) of page uid = 1 and uid = 2"> - * <ce:menu.updated pageUids="{0: 1, 1: 2}" as="pages"> - * <f:for each="{pages}" as="page"> - * {page.title} - * </f:for> - * </ce:menu.updated> - * </code> - * - * <output> - * Recently updated subpage 1 - * Recently updated subpage 2 - * Recently updated subpage 3 - * </output> - */ -class UpdatedViewHelper extends AbstractMenuViewHelper -{ - /** - * Output escaping is disabled as child content contains HTML by default - * - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize ViewHelper arguments - * - * @return void - */ - public function initializeArguments() - { - $this->registerArgument('as', 'string', 'Name of the template variable that will contain selected pages', true); - $this->registerArgument('pageUids', 'array', 'Page UIDs of parent pages', false, []); - $this->registerArgument('sortField', 'string', 'Field to sort pages; possible values: starttime, lastUpdated, tstamp, crdate', false, 'SYS_LASTCHANGED'); - $this->registerArgument('maximumAge', 'string', 'Maximum age of pages to be included; supports mathematical expressions', false, '604800'); - $this->registerArgument('includeNotInMenu', 'boolean', 'Include pages that are marked "hide in menu"?', false, false); - $this->registerArgument('includeMenuSeparator', 'boolean', 'Include pages of the type "Menu separator"?', false, false); - $this->registerArgument('excludeNoSearchPages', 'boolean', 'Exclude pages that are NOT marked "include in search"?', false, true); - } - - /** - * Render the view helper - * - * @return string - */ - public function render() - { - $typoScriptFrontendController = $this->getTypoScriptFrontendController(); - $as = (string)$this->arguments['as']; - $pageUids = (array)$this->arguments['pageUids']; - $sortField = $this->arguments['sortField']; - $maximumAge = $this->arguments['maximumAge']; - $includeNotInMenu = (bool)$this->arguments['includeNotInMenu']; - $includeMenuSeparator = (bool)$this->arguments['includeMenuSeparator']; - $excludeNoSearchPages = (bool)$this->arguments['excludeNoSearchPages']; - - // If no pages have been defined, use the current page - if (empty($pageUids)) { - $pageUids = [$typoScriptFrontendController->page['uid']]; - } - - $unfilteredPageTreeUids = []; - foreach ($pageUids as $pageUid) { - $unfilteredPageTreeUids = array_merge( - $unfilteredPageTreeUids, - explode( - ',', - $typoScriptFrontendController->cObj->getTreeList($pageUid, 20) - ) - ); - } - $pageTreeUids = array_unique($unfilteredPageTreeUids); - - $constraints = $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator); - - if ($excludeNoSearchPages) { - $constraints .= ' AND no_search = 0'; - } - - if (!in_array($sortField, ['starttime', 'lastUpdated', 'tstamp', 'crdate'])) { - $sortField = 'SYS_LASTCHANGED'; - } - - $minimumTimeStamp = time() - (int)$typoScriptFrontendController->cObj->calc($maximumAge); - $constraints .= ' AND ' . $sortField . ' >=' . $minimumTimeStamp; - - $pages = $typoScriptFrontendController->sys_page->getMenuForPages( - $pageTreeUids, - '*', - $sortField . ' DESC', - $constraints - ); - return $this->renderChildrenWithVariables([ - $as => $pages - ]); - } -} diff --git a/typo3/sysext/compatibility7/Configuration/Backend/Routes.php b/typo3/sysext/compatibility7/Configuration/Backend/Routes.php deleted file mode 100644 index f8dad7f0fd7b..000000000000 --- a/typo3/sysext/compatibility7/Configuration/Backend/Routes.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * Definitions for routes previously provided by EXT:version - */ -return [ - // Register version_click_module entry point - 'web_txversionM1' => [ - 'path' => '/record/versions/', - 'target' => \TYPO3\CMS\Compatibility7\Controller\VersionModuleController::class . '::mainAction' - ] -]; diff --git a/typo3/sysext/compatibility7/Configuration/PageTS/Mod/Wizards/NewContentElementMenu.txt b/typo3/sysext/compatibility7/Configuration/PageTS/Mod/Wizards/NewContentElementMenu.txt deleted file mode 100644 index 08430a55b129..000000000000 --- a/typo3/sysext/compatibility7/Configuration/PageTS/Mod/Wizards/NewContentElementMenu.txt +++ /dev/null @@ -1,17 +0,0 @@ -# -# Define content elements in "New Content Element Wizard" -# -mod.wizards.newContentElement.wizardItems { - menu.elements { - menu { - iconIdentifier = content-special-menu - title = LLL:EXT:backend/Resources/Private/Language/locallang_db_new_content_el.xlf:special_menus_title - description = LLL:EXT:backend/Resources/Private/Language/locallang_db_new_content_el.xlf:special_menus_description - tt_content_defValues { - CType = menu - menu_type = 0 - } - } - } - menu.show := addToList(menu) -} diff --git a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/pages.php b/typo3/sysext/compatibility7/Configuration/TCA/Overrides/pages.php deleted file mode 100644 index b0de2f1f157f..000000000000 --- a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/pages.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -defined('TYPO3_MODE') or die(); - -// add pages.url_scheme -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', [ - 'url_scheme' => [ - 'exclude' => true, - 'label' => 'LLL:EXT:compatibility7/Resources/Private/Language/locallang_tca.xlf:pages.url_scheme', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'items' => [ - [ - 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.default_value', - 0 - ], - [ - 'LLL:EXT:compatibility7/Resources/Private/Language/locallang_tca.xlf:pages.url_scheme.http', - 1 - ], - [ - 'LLL:EXT:compatibility7/Resources/Private/Language/locallang_tca.xlf:pages.url_scheme.https', - 2 - ] - ], - 'default' => 0 - ] - ] -]); - -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('pages', '3', 'url_scheme', 'after:cache_tags'); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('pages', 'links', '--linebreak--, url_scheme;LLL:EXT:compatibility7/Resources/Private/Language/locallang_tca.xlf:pages.url_scheme_formlabel', 'after:target'); diff --git a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/sys_template.php b/typo3/sysext/compatibility7/Configuration/TCA/Overrides/sys_template.php deleted file mode 100644 index 57adc0cf0e8d..000000000000 --- a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/sys_template.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -defined('TYPO3_MODE') or die(); - -if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('css_styled_content')) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( - 'compatibility7', - 'Configuration/TypoScript/ContentElement/CssStyledContent/', - 'CSS Styled Content TYPO3 v7' - ); -} -if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('fluid_styled_content')) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( - 'compatibility7', - 'Configuration/TypoScript/ContentElement/FluidStyledContent/', - 'Fluid Styled Content TYPO3 v7' - ); -} diff --git a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content.php b/typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content.php deleted file mode 100644 index 12788252aa51..000000000000 --- a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -defined('TYPO3_MODE') or die(); - -$fields = [ - 'select_key' => [ - 'exclude' => true, - 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.code', - 'config' => [ - 'type' => 'input', - 'size' => 50, - 'max' => 80, - 'eval' => 'trim' - ] - ], -]; - -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $fields); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'select_key;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:select_key_formlabel', 'list', 'after:list_type'); - -// Register "old" FE plugin and hide layout, select_key and pages fields in BE -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin( - [ - 'LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:mod_indexed_search', - 'indexed_search' - ], - 'list_type', - 'indexed_search' -); -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['indexed_search'] = 'layout,pages'; diff --git a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content_element_menu.php b/typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content_element_menu.php deleted file mode 100644 index 149cc6d61591..000000000000 --- a/typo3/sysext/compatibility7/Configuration/TCA/Overrides/tt_content_element_menu.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -defined('TYPO3_MODE') or die(); - -call_user_func(function () { - // Add the CType - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem( - 'tt_content', - 'CType', - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.I.12', - 'menu', - 'content-special-menu' - ], - 'shortcut', - 'before' - ); - $GLOBALS['TCA']['tt_content']['ctrl']['requestUpdate'] .= ',menu_type'; - $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['menu'] = 'content-special-menu'; - $GLOBALS['TCA']['tt_content']['palettes']['menu'] = [ - 'showitem' => ' - menu_type;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type_formlabel, - --linebreak--, - pages;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:pages.ALT.menu_formlabel - ', - ]; - $GLOBALS['TCA']['tt_content']['types']['menu'] = [ - 'showitem' => ' - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.header;header, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.menu;menu, - --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance, - layout;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:layout_formlabel, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.appearanceLinks;appearanceLinks, - --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.accessibility, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.menu_accessibility;menu_accessibility, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, - --palette--;;language, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, - --palette--;;hidden, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories, - categories, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes, - rowDescription, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended, - ', - 'subtype_value_field' => 'menu_type', - 'subtypes_excludelist' => [ - '2' => 'pages', - 'categorized_pages' => 'pages', - 'categorized_content' => 'pages', - ], - 'subtypes_addlist' => [ - 'categorized_pages' => 'selected_categories, category_field', - 'categorized_content' => 'selected_categories, category_field', - ] - ]; - - // Add additional fields - $additionalColumns = [ - 'menu_type' => [ - 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type', - 'onChange' => 'reload', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'items' => [ - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.0', - '0' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.1', - '1' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.2', - '4' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.3', - '7' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.4', - '2' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.8', - '8' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.5', - '3' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.6', - '5' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.7', - '6' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.categorized_pages', - 'categorized_pages' - ], - [ - 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:menu_type.I.categorized_content', - 'categorized_content' - ] - ], - 'default' => 0 - ] - ] - ]; - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $additionalColumns); -}); diff --git a/typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/CssStyledContent/setup.txt b/typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/CssStyledContent/setup.txt deleted file mode 100644 index 8e39fea03db6..000000000000 --- a/typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/CssStyledContent/setup.txt +++ /dev/null @@ -1,272 +0,0 @@ -# -# Menu configuration for css_styled_content -# -tt_content.stdWrap.innerWrap.cObject.default { - 10.cObject.menu = TEXT - 10.cObject.menu.value = <nav id="c{field:uid}" - 30.cObject.menu = TEXT - 30.cObject.menu.value = >|</nav> -} - - -# -# cType: menu -# -tt_content.menu = COA -tt_content.menu { - 10 = < lib.stdheader - 20 = CASE - 20 { - key.field = menu_type - # "Menu of these pages" - default = HMENU - default { - special = list - special.value.field = pages - stdWrap { - prepend = COA - prepend { - stdWrap { - if.isTrue.field = accessibility_bypass - } - 10 = LOAD_REGISTER - 10 { - accessibility_bypass_text = TEXT - accessibility_bypass_text { - field = accessibility_bypass_text - } - } - 20 = CONTENT - 20 { - table = tt_content - select { - pidInList = this - orderBy = sorting - where { - dataWrap = sorting>{field:sorting} - } - languageField = sys_language_uid - max = 1 - } - renderObj = TEXT - renderObj { - required = 1 - data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:menu.bypassNavigation - override.data = register:accessibility_bypass_text - trim = 1 - htmlSpecialChars = 1 - typolink { - parameter { - field = pid - } - section { - field = uid - } - } - wrap = <li class="csc-nav-bypass">|</li> - } - } - 30 = RESTORE_REGISTER - } - outerWrap = <ul class="csc-menu csc-menu-def">|</ul> - required = 1 - } - 1 = TMENU - 1 { - target < lib.parseTarget - target = - target.override = {$PAGE_TARGET} - NO { - stdWrap.htmlSpecialChars = 1 - wrapItemAndSub = <li>|</li> - ATagTitle.field = description // title - } - } - } - # "Menu of subpages to these pages" - 1 < .default - 1 { - special = directory - stdWrap { - outerWrap = <ul class="csc-menu csc-menu-1">|</ul> - } - } - # "Sitemap - liststyle" - 2 = HMENU - 2 { - stdWrap < tt_content.menu.20.default.stdWrap - stdWrap { - outerWrap = <div class="csc-sitemap">|</div> - } - 1 = TMENU - 1 { - target < lib.parseTarget - target = - target.override = {$PAGE_TARGET} - expAll = 1 - wrap = <ul>|</ul> - NO { - stdWrap.htmlSpecialChars = 1 - wrapItemAndSub = <li>|</li> - ATagTitle.field = description // title - } - } - 2 < .1 - 3 < .1 - 4 < .1 - 5 < .1 - 6 < .1 - 7 < .1 - } - # "Section index (pagecontent w/Index checked - liststyle)" - 3 < .default - 3 { - special { - value { - override { - data = page:uid - if { - isFalse.field = pages - } - } - } - } - stdWrap { - outerWrap = <ul class="csc-menu csc-menu-3">|</ul> - } - 1 = TMENU - 1 { - sectionIndex = 1 - sectionIndex.type = header - NO.wrapItemAndSub = <li class="csc-section">|</li> - } - } - # "Menu of subpages to these pages (with abstract)" - 4 < .1 - 4 { - stdWrap { - prepend.20.renderObj.wrap = <dt class="csc-nav-bypass">|</dt><dd> </dd> - outerWrap = <dl class="csc-menu csc-menu-4">|</dl> - } - 1.NO { - wrapItemAndSub > - linkWrap = <dt>|</dt> - after { - cObject = TEXT - cObject { - data = field : abstract // field : description // field : subtitle - htmlSpecialChars = 1 - required = 1 - } - ifBlank = - wrap = <dd>|</dd> - } - ATagTitle.field = description // title - } - } - # "Recently updated pages" - 5 < .default - 5 { - stdWrap { - outerWrap = <ul class="csc-menu csc-menu-5">|</ul> - } - special = updated - special { - maxAge = 3600*24*7 - excludeNoSearchPages = 1 - } - } - # "Related pages (based on keywords)" - 6 < .default - 6 { - stdWrap { - outerWrap = <ul class="csc-menu csc-menu-6">|</ul> - } - special = keywords - special { - excludeNoSearchPages = 1 - } - } - # "Menu of subpages to these pages + sections - liststyle" - 7 < .1 - 7 { - stdWrap { - outerWrap = <ul class="csc-menu csc-menu-7">|</ul> - } - 1.expAll = 1 - 2 < .1 - 2 { - sectionIndex = 1 - sectionIndex.type = header - wrap = <ul>|</ul> - NO.wrapItemAndSub = <li class="csc-section">|</li> - } - } - # "Sitemaps of selected pages - liststyle" - 8 < .2 - 8 { - special = directory - special.value.field = pages - } - # Menu of categorized pages - categorized_pages < .default - categorized_pages { - special = categories - special.value.field = selected_categories - special.relation.field = category_field - special.sorting = title - special.order = asc - stdWrap { - outerWrap = <ul class="csc-menu csc-menu-categorized-pages">|</ul> - } - } - # Menu of categorized content elements - categorized_content = RECORDS - categorized_content { - categories.field = selected_categories - categories.relation.field = category_field - tables = tt_content - conf.tt_content = TEXT - conf.tt_content { - field = header - typolink.parameter = {field:pid}#{field:uid} - typolink.parameter.insertData = 1 - wrap = <li>|</li> - } - wrap = <ul>|</ul> - } - } - 20.stdWrap { - wrap { - cObject = COA - cObject { - 10 = TEXT - 10 { - field = accessibility_title - htmlSpecialChars = 1 - dataWrap = <map id="map{field:uid}" title="|"> - dataWrap { - override = <map name="map{field:uid}" title="|"> - override { - if { - isFalse.data = TSFE:xhtmlDoctype - } - } - } - } - 20 = TEXT - 20 { - value = |</map> - } - } - if { - isTrue { - field = accessibility_title - } - } - } - editIcons = tt_content: menu_type, pages - editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.menuSitemap - prefixComment = 2 | Menu/Sitemap element: - } -} diff --git a/typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/FluidStyledContent/setup.txt b/typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/FluidStyledContent/setup.txt deleted file mode 100644 index d93104552099..000000000000 --- a/typo3/sysext/compatibility7/Configuration/TypoScript/ContentElement/FluidStyledContent/setup.txt +++ /dev/null @@ -1,47 +0,0 @@ -# -# Default configuration for content elements which are using FLUIDTEMPLATE directly -# -lib.fluidContent { - templateRootPaths { - 1 = EXT:compatibility7/Resources/Private/FluidStyledContent/Templates/ - } - partialRootPaths { - 1 = EXT:compatibility7/Resources/Private/FluidStyledContent/Partials/ - } - layoutRootPaths { - 1 = EXT:compatibility7/Resources/Private/FluidStyledContent/Layouts/ - } -} - - -# -# Special Menus: -# -tt_content.menu =< lib.fluidContent -tt_content.menu { - templateName = Menu - dataProcessing { - 10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor - 10 { - if.isTrue.field = pages - fieldName = pages - delimiter = , - removeEmptyEntries = 1 - filterIntegers = 1 - filterUnique = 1 - as = pageUids - } - 20 < .10 - 20 { - if.isTrue.field = selected_categories - fieldName = selected_categories - as = categoryUids - } - } - stdWrap { - editIcons = tt_content: header [header_layout], menu_type, pages - editIcons { - iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.menu - } - } -} diff --git a/typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php b/typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php deleted file mode 100644 index 410b5a3cc72a..000000000000 --- a/typo3/sysext/compatibility7/Migrations/Code/ClassAliasMap.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -return [ - 'TYPO3\\CMS\\Core\\Utility\\MonitorUtility' => \TYPO3\CMS\Compatibility7\Utility\MonitorUtility::class, - 'TYPO3\\CMS\\IndexedSearch\\Controller\\SearchFormController' => \TYPO3\CMS\Compatibility7\Controller\SearchFormController::class, - 'TYPO3\\CMS\\Version\\ContextMenu\\ItemProvider' => \TYPO3\CMS\Compatibility7\ContextMenu\ItemProvider::class, - 'TYPO3\\CMS\\Version\\Controller\\VersionModuleController' => \TYPO3\CMS\Compatibility7\Controller\VersionModuleController::class, - 'TYPO3\\CMS\\Version\\View\\VersionView' => \TYPO3\CMS\Compatibility7\View\VersionView::class -]; diff --git a/typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php b/typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php deleted file mode 100644 index 2a3a685dcd0e..000000000000 --- a/typo3/sysext/compatibility7/PHP/class.tx_indexed_search_pi_wizicon.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -/** - * Icon for plugin wizard - */ -class tx_indexed_search_pi_wizicon -{ - /** - * Adds the indexed_search pi1 wizard icon - * - * @param array $wizardItems Input array with wizard items for plugins - * @return array Modified input array, having the item for indexed_search pi1 added. - */ - public function proc($wizardItems) - { - $wizardItems['plugins_tx_indexed_search'] = [ - 'iconIdentifier' => 'content-special-indexed_search', - 'title' => $GLOBALS['LANG']->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_title'), - 'description' => $GLOBALS['LANG']->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_description'), - 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=indexed_search' - ]; - return $wizardItems; - } -} diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Directory.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Directory.html deleted file mode 100644 index 51e3161a33dc..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Directory.html +++ /dev/null @@ -1,23 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.directory pageUids="{pageUids}" as="pages" levelAs="level"> - <f:if condition="{pages}"> - <ul> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - <f:render partial="Menu/Directory" arguments="{pageUids: {0: page.uid}}" /> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.directory> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-0.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-0.html deleted file mode 100644 index 3e8dc5190b18..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-0.html +++ /dev/null @@ -1,22 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.list pageUids="{pageUids}" as="pages"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-0"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.list> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-1.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-1.html deleted file mode 100644 index f883e65ce061..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-1.html +++ /dev/null @@ -1,22 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.directory pageUids="{pageUids}" as="pages"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-1"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.directory> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-2.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-2.html deleted file mode 100644 index d3e8b36ea136..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-2.html +++ /dev/null @@ -1,23 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.list entryLevel="0" as="pages" levelAs="level"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-2"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - <f:render partial="Menu/Directory" arguments="{pageUids: {0: page.uid}}" /> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.list> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-3.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-3.html deleted file mode 100644 index b66300ed12b9..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-3.html +++ /dev/null @@ -1,21 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.list pageUids="{pageUids}" as="pages"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-3"> - <f:for each="{pages}" as="page"> - <ce:menu.section pageUid="{page.uid}" as="contentElements" type="header"> - <f:if condition="{contentElements}"> - <f:for each="{contentElements}" as="contentElement"> - <li> - <f:link.page pageUid="{page.uid}" section="c{contentElement.uid}" target="{page.target}"> - {contentElement.header} - </f:link.page> - </li> - </f:for> - </f:if> - </ce:menu.section> - </f:for> - </ul> - </f:if> -</ce:menu.list> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-4.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-4.html deleted file mode 100644 index 59bbfab35497..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-4.html +++ /dev/null @@ -1,46 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.directory pageUids="{pageUids}" as="pages"> - <f:if condition="{pages}"> - <dl class="ce-menu ce-menu-4"> - <f:for each="{pages}" as="page"> - <dt> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </dt> - <dd> - <f:if condition="{page.abstract}"> - <f:then> - {page.abstract} - </f:then> - <f:else> - <f:if condition="{page.description}"> - <f:then> - {page.description} - </f:then> - <f:else> - <f:if condition="{page.subtitle}"> - <f:then> - {page.subtitle} - </f:then> - <f:else> - - </f:else> - </f:if> - </f:else> - </f:if> - </f:else> - </f:if> - </dd> - </f:for> - </dl> - </f:if> -</ce:menu.directory> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-5.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-5.html deleted file mode 100644 index a29ba7a82186..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-5.html +++ /dev/null @@ -1,22 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.updated pageUids="{pageUids}" as="pages" maximumAge="3600*24*7"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-5"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.updated> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-6.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-6.html deleted file mode 100644 index 75d653933c62..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-6.html +++ /dev/null @@ -1,22 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.keywords pageUids="{pageUids}" as="pages"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-6"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.keywords> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-7.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-7.html deleted file mode 100644 index 5889158c0582..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-7.html +++ /dev/null @@ -1,35 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.directory pageUids="{pageUids}" as="pages"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-7"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </li> - <ce:menu.section pageUid="{page.uid}" as="contentElements" type="header"> - <f:if condition="{contentElements}"> - <ul> - <f:for each="{contentElements}" as="contentElement"> - <li> - <f:link.page pageUid="{page.uid}" section="c{contentElement.uid}" target="{page.target}"> - {contentElement.header} - </f:link.page> - </li> - </f:for> - </ul> - </f:if> - </ce:menu.section> - </f:for> - </ul> - </f:if> -</ce:menu.directory> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-8.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-8.html deleted file mode 100644 index f0c7866e4b91..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-8.html +++ /dev/null @@ -1,23 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.directory pageUids="{pageUids}" as="pages" levelAs="level"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-8"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - <f:render partial="Menu/Directory" arguments="{pageUids: {0: page.uid}}" /> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.directory> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_content.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_content.html deleted file mode 100644 index 7a46008afd2d..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_content.html +++ /dev/null @@ -1,17 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.categories categoryUids="{categoryUids}" as="contentElements" relationField="{data.category_field}" table="tt_content"> - <f:if condition="{contentElements}"> - <ul class="ce-menu ce-menu-categorized-content"> - <f:for each="{contentElements}" as="contentElement"> - <f:if condition="{contentElement.header}"> - <li> - <f:link.page pageUid="{contentElement.pid}" section="c{contentElement.uid}" target="{page.target}"> - {contentElement.header} - </f:link.page> - </li> - </f:if> - </f:for> - </ul> - </f:if> -</ce:menu.categories> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_pages.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_pages.html deleted file mode 100644 index eb6406a8ee35..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Partials/Menu/Type-categorized_pages.html +++ /dev/null @@ -1,22 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/Compatibility7/ViewHelpers" data-namespace-typo3-fluid="true"> -<ce:menu.categories categoryUids="{categoryUids}" as="pages" relationField="{data.category_field}" table="pages"> - <f:if condition="{pages}"> - <ul class="ce-menu ce-menu-9"> - <f:for each="{pages}" as="page"> - <li> - <f:link.page pageUid="{page.uid}" target="{page.target}"> - <f:if condition="{page.nav_title}"> - <f:then> - {page.nav_title} - </f:then> - <f:else> - {page.title} - </f:else> - </f:if> - </f:link.page> - </li> - </f:for> - </ul> - </f:if> -</ce:menu.categories> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Templates/Menu.html b/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Templates/Menu.html deleted file mode 100644 index 42fdfc6be5c0..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/FluidStyledContent/Templates/Menu.html +++ /dev/null @@ -1,8 +0,0 @@ -<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> -<f:layout name="Default" /> -<f:section name="Main"> - - <f:render partial="Menu/Type-{data.menu_type}" arguments="{_all}" /> - -</f:section> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/Language/locallang_tca.xlf b/typo3/sysext/compatibility7/Resources/Private/Language/locallang_tca.xlf deleted file mode 100644 index b11523abf539..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/Language/locallang_tca.xlf +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff"> - <file t3:id="1484231191" source-language="en" datatype="plaintext" original="messages" date="2017-10-12T14:22:32Z" product-name="compatibility7"> - <header/> - <body> - <trans-unit id="pages.url_scheme"> - <source>Enforce Protocol:</source> - </trans-unit> - <trans-unit id="pages.url_scheme_formlabel"> - <source>Use Protocol</source> - </trans-unit> - <trans-unit id="pages.url_scheme.http"> - <source>http://</source> - </trans-unit> - <trans-unit id="pages.url_scheme.https"> - <source>https://</source> - </trans-unit> - </body> - </file> -</xliff> diff --git a/typo3/sysext/compatibility7/Resources/Private/Language/locallang_version.xlf b/typo3/sysext/compatibility7/Resources/Private/Language/locallang_version.xlf deleted file mode 100644 index a2eec1cf1f92..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/Language/locallang_version.xlf +++ /dev/null @@ -1,374 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff"> - <file t3:id="1415815009" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:37Z" product-name="version"> - <header/> - <body> - <trans-unit id="title"> - <source>Versioning</source> - </trans-unit> - <trans-unit id="title_review"> - <source>Send to review/pub</source> - </trans-unit> - <trans-unit id="mlang_labels_tablabel"> - <source>Page and content versioning and workspace management for pages.</source> - </trans-unit> - <trans-unit id="mlang_labels_tabdescr"> - <source>The Web>Versioning module provides access to versioning features for the page tree.</source> - </trans-unit> - <trans-unit id="mlang_tabs_tab"> - <source>Versioning</source> - </trans-unit> - <trans-unit id="clickAPage_header"> - <source>Web>Versioning module</source> - </trans-unit> - <trans-unit id="clickAPage_content"> - <source>Please click a page in the pagetree frame to see the versioning module.</source> - </trans-unit> - <trans-unit id="filter_drafts"> - <source>Drafts</source> - </trans-unit> - <trans-unit id="filter_archive"> - <source>Archive</source> - </trans-unit> - <trans-unit id="filter_all"> - <source>All</source> - </trans-unit> - <trans-unit id="diffing"> - <source>DIFFING</source> - </trans-unit> - <trans-unit id="fieldname"> - <source>Fieldname</source> - </trans-unit> - <trans-unit id="coloredDiffView"> - <source>Colored diff-view</source> - </trans-unit> - <trans-unit id="recordsMatchesCompletely"> - <source>Records matches completely on all editable fields!</source> - </trans-unit> - <trans-unit id="errorRecordsNotFound"> - <source>ERROR: Records could strangely not be found!</source> - </trans-unit> - <trans-unit id="errorDiffSources"> - <source>ERROR: You didn't select two sources for diffing!</source> - </trans-unit> - <trans-unit id="tblHeader_title"> - <source>Title</source> - </trans-unit> - <trans-unit id="tblHeader_uid"> - <source>UID</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_oid"> - <source>oid</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_id"> - <source>id</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_wsid"> - <source>wsid</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_state"> - <source>state</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_stage"> - <source>stage</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_count"> - <source>count</source> - </trans-unit> - <trans-unit id="tblHeader_pid"> - <source>pid</source> - </trans-unit> - <trans-unit id="tblHeader_t3ver_label"> - <source>Label</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_title"> - <source>Header of element</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_uid"> - <source>Unique ID of element</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_oid"> - <source>t3ver_oid - Reference to live version UID</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_id"> - <source>t3ver_id - Version number, incremental integer</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_wsid"> - <source>t3ver_wsid - Workspace ID. There can be only one version of an element per ID (except ID zero).</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_state"> - <source>t3ver_state - Special states of a version: 1=Placeholder for "New". 2=Marked deleted.</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_stage"> - <source>t3ver_stage - Publishing stage: Editing (0), review (1), publish (10), rejected (-1).</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_count"> - <source>t3ver_count - Life cycle counter. Incremented each time element is unpublished.</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_pid"> - <source>Page ID</source> - </trans-unit> - <trans-unit id="tblHeaderDesc_t3ver_label"> - <source>Label</source> - </trans-unit> - <trans-unit id="diff"> - <source>Diff</source> - </trans-unit> - <trans-unit id="swapWithCurrent"> - <source>SWAP with current</source> - </trans-unit> - <trans-unit id="currentOnlineVersion"> - <source>CURRENT ONLINE VERSION!</source> - </trans-unit> - <trans-unit id="cmdPid0"> - <source>Page: Page + content</source> - </trans-unit> - <trans-unit id="cmdPid100"> - <source>Branch: All subpages</source> - </trans-unit> - <trans-unit id="cmdPid1"> - <source>Element: Just record</source> - </trans-unit> - <trans-unit id="createNewVersion"> - <source>Create new version</source> - </trans-unit> - <trans-unit id="previewLink"> - <source>Preview Link</source> - </trans-unit> - <trans-unit id="publishPage"> - <source>Publish Page</source> - </trans-unit> - <trans-unit id="swapPage"> - <source>Swap page</source> - </trans-unit> - <trans-unit id="publishPageQuestion"> - <source>Are you sure you want to publish all content %sfrom this page?</source> - </trans-unit> - <trans-unit id="swapPageQuestion"> - <source>Are you sure you want to publish (swap) all content %sfrom this page?</source> - </trans-unit> - <trans-unit id="publishPageQuestionStage"> - <source>in "Publish" stage </source> - </trans-unit> - <trans-unit id="previewUrl"> - <source>Preview Url:</source> - </trans-unit> - <trans-unit id="previewInstruction"> - <source>You can preview this page from the workspace using this link for the next %s hours (does not require backend login):</source> - </trans-unit> - <trans-unit id="versionDetails"> - <source>Details for version</source> - </trans-unit> - <trans-unit id="wsManagement"> - <source>Workspace management</source> - </trans-unit> - <trans-unit id="showDiffView"> - <source>Show difference view</source> - </trans-unit> - <trans-unit id="liveVersion"> - <source>Live Version:</source> - </trans-unit> - <trans-unit id="wsVersions"> - <source>Workspace Versions:</source> - </trans-unit> - <trans-unit id="controls"> - <source>Controls:</source> - </trans-unit> - <trans-unit id="goBack"> - <source>Click here to go back</source> - </trans-unit> - <trans-unit id="showAllInformation"> - <source>Show all information</source> - </trans-unit> - <trans-unit id="newElement"> - <source>New element</source> - </trans-unit> - <trans-unit id="deletedElement"> - <source>Deleted element</source> - </trans-unit> - <trans-unit id="moveToPlaceholder"> - <source>Move-to placeholder (destination)</source> - </trans-unit> - <trans-unit id="moveToPointer"> - <source>Move-to pointer (source)</source> - </trans-unit> - <trans-unit id="notAvailable"> - <source>N/A</source> - </trans-unit> - <trans-unit id="change"> - <source>change:</source> - </trans-unit> - <trans-unit id="element"> - <source> [Element]</source> - </trans-unit> - <trans-unit id="page"> - <source> [Page]</source> - </trans-unit> - <trans-unit id="branch"> - <source> [Branch]</source> - </trans-unit> - <trans-unit id="otherVersions"> - <source>Other version(s) in workspace </source> - </trans-unit> - <trans-unit id="multipleVersions"> - <source>Multiple versions in same workspace!</source> - </trans-unit> - <trans-unit id="versionInVersion"> - <source>Version inside version!</source> - </trans-unit> - <trans-unit id="lifecycle"> - <source>Lifecycle</source> - </trans-unit> - <trans-unit id="workspace"> - <source>Workspace</source> - </trans-unit> - <trans-unit id="diffToLiveElement"> - <source>Difference to live element:</source> - </trans-unit> - <trans-unit id="commentForReviewer"> - <source>Comment for Reviewer:</source> - </trans-unit> - <trans-unit id="commentForPublisher"> - <source>Comment for Publisher:</source> - </trans-unit> - <trans-unit id="sendItemsToReview"> - <source>Sending %s item(s) to review. </source> - </trans-unit> - <trans-unit id="sendAllToReview"> - <source>Send all to Review</source> - </trans-unit> - <trans-unit id="approveToPublish"> - <source>Approving %s item(s) to publishing. </source> - </trans-unit> - <trans-unit id="approveAllToPublish"> - <source>Approve all for Publishing</source> - </trans-unit> - <trans-unit id="offline"> - <source>[Offline]</source> - </trans-unit> - <trans-unit id="draft"> - <source>Draft</source> - </trans-unit> - <trans-unit id="archive"> - <source>Archive</source> - </trans-unit> - <trans-unit id="publishedXTimes"> - <source>Published %s times</source> - </trans-unit> - <trans-unit id="stage.sentToReview"> - <source>sent element to "Review"</source> - </trans-unit> - <trans-unit id="stage.approvedForPublish"> - <source>approved for "Publish"</source> - </trans-unit> - <trans-unit id="stage.rejectedElement"> - <source>rejected element!</source> - </trans-unit> - <trans-unit id="stage.resetToEdit"> - <source>reset to "Editing"</source> - </trans-unit> - <trans-unit id="stage.undefined"> - <source>[undefined]</source> - </trans-unit> - <trans-unit id="userComment"> - <source>User Comment</source> - </trans-unit> - <trans-unit id="subElementsClick"> - <source>[Sub elements, click for details]</source> - </trans-unit> - <trans-unit id="subElements"> - <source>[Sub elements]</source> - </trans-unit> - <trans-unit id="completeMatch"> - <source>Complete match on editable fields.</source> - </trans-unit> - <trans-unit id="editing"> - <source>Editing</source> - </trans-unit> - <trans-unit id="sendToReview"> - <source>Send to Review</source> - </trans-unit> - <trans-unit id="review"> - <source>Review</source> - </trans-unit> - <trans-unit id="swap"> - <source>Swap</source> - </trans-unit> - <trans-unit id="approveForPublishing"> - <source>Approve for Publishing</source> - </trans-unit> - <trans-unit id="publish"> - <source>Publish</source> - </trans-unit> - <trans-unit id="rejected"> - <source>Rejected</source> - </trans-unit> - <trans-unit id="comment"> - <source>Comment:</source> - </trans-unit> - <trans-unit id="resetStage"> - <source>Reset stage</source> - </trans-unit> - <trans-unit id="undefined"> - <source>Undefined</source> - </trans-unit> - <trans-unit id="rejectExplain"> - <source>Please explain why you reject:</source> - </trans-unit> - <trans-unit id="removeFromWorkspace"> - <source>Remove from workspace</source> - </trans-unit> - <trans-unit id="showLog"> - <source>Show Log</source> - </trans-unit> - <trans-unit id="liveWorkspace"> - <source>[Live workspace]</source> - </trans-unit> - <trans-unit id="draftWorkspaces"> - <source>Draft Workspaces</source> - </trans-unit> - <trans-unit id="defaultDraft"> - <source>[Default Draft]</source> - </trans-unit> - <trans-unit id="errors"> - <source>Errors:</source> - </trans-unit> - <trans-unit id="refresh"> - <source>Refresh</source> - </trans-unit> - <trans-unit id="allowPreviewOfWholeWorkspace"> - <source>Allow preview of whole workspace</source> - </trans-unit> - <trans-unit id="versionId"> - <source>ID:</source> - </trans-unit> - <trans-unit id="workspaceId"> - <source>Workspace-Id:</source> - </trans-unit> - <trans-unit id="live"> - <source>LIVE</source> - </trans-unit> - <trans-unit id="versionSelect.label"> - <source>Versions of this page:</source> - </trans-unit> - <trans-unit id="versionSelect.live"> - <source>LIVE version</source> - </trans-unit> - <trans-unit id="versionSelect.publish"> - <source>Publish page</source> - </trans-unit> - <trans-unit id="versionSelect.inBranch"> - <source>Inside branch, no further versioning possible</source> - </trans-unit> - <trans-unit id="versionSelect.versionsFound"> - <source>Versions found on page, no "Page" versioning possible</source> - </trans-unit> - <trans-unit id="autopublishTask.name"> - <source>Workspaces auto-publication</source> - </trans-unit> - <trans-unit id="autopublishTask.description"> - <source>This tasks checks any workspace that has a publication date set in the past and automatically publishes it.</source> - </trans-unit> - </body> - </file> -</xliff> diff --git a/typo3/sysext/compatibility7/Resources/Private/Templates/Version.html b/typo3/sysext/compatibility7/Resources/Private/Templates/Version.html deleted file mode 100644 index a69c07553b96..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/Templates/Version.html +++ /dev/null @@ -1,34 +0,0 @@ -<!-- ###FULLDOC### begin --> -<div class="typo3-fullDoc"> - <div id="typo3-docheader"> - <div class="typo3-docheader-functions"> - <div class="left">###CSH### ###WS_MENU### ###FUNC_MENU###</div> - <div class="right">###PAGEPATH######PAGEINFO###</div> - </div> - <div class="typo3-docheader-buttons"> - <div class="left">###BUTTONLIST_LEFT###</div> - <div class="right">###BUTTONLIST_RIGHT###</div> - </div> - </div> - - <div id="typo3-docbody"> - <div id="typo3-inner-docbody"> - ###CONTENT### - </div> - </div> -</div> -<!-- ###FULLDOC### end --> - -<!-- Grouping the icons on top --> - -<!-- ###BUTTON_GROUP_WRAP### --> -<div class="buttongroup">###BUTTONS###</div> -<!-- ###BUTTON_GROUP_WRAP### --> - -<!-- ###BUTTON_GROUPS_LEFT### --> -<!-- ###BUTTON_GROUP4### -->###VIEW###<!-- ###BUTTON_GROUP4### --> -<!-- ###BUTTON_GROUPS_LEFT### --> - -<!-- ###BUTTON_GROUPS_RIGHT### --> -<!-- ###BUTTON_GROUP1### -->###SHORTCUT###<!-- ###BUTTON_GROUP1### --> -<!-- ###BUTTON_GROUPS_RIGHT### --> \ No newline at end of file diff --git a/typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl b/typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl deleted file mode 100644 index 4776dc71a85c..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/Templates/indexed_search.tmpl +++ /dev/null @@ -1,259 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>indexed_search template</title> -</head> - -<body> - -<h1>Indexed Search: Default template</h1> - - -<h2>TEMPLATE_SEARCH_FORM</h2> -<p><em>Template for displaying the search form.</em></p> - -<!-- ###SEARCH_FORM### begin --> -<div class="tx-indexedsearch-searchbox"> -<form action="###ACTION_URL###" method="post" id="tx_indexedsearch"> - <input type="hidden" name="tx_indexedsearch[_sections]" value="0" /> - <input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" /> - <input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" /> - <!-- ###HIDDEN_FIELDS### begin --> - <input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" /> - <!-- ###HIDDEN_FIELDS### end --> - - <table cellpadding="0" cellspacing="0" border="0" summary="Search form"> - <tr> - <td>###FORM_SEARCHFOR###</td> - <td colspan="2"><input type="search" name="tx_indexedsearch[sword]" value="###SWORD_VALUE###" class="tx-indexedsearch-searchbox-sword sword" ###PLACEHOLDER### /></td> - </tr> - - <!-- ###ADDITONAL_KEYWORD### begin --> - <tr> - <td> </td> - <td colspan="2"><input type="hidden" name="tx_indexedsearch[sword_prev]" value="###SWORD_PREV_VALUE###" /><input type="checkbox" name="tx_indexedsearch[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" ###SWORD_PREV_INCLUDE_CHECKED### /> <label for="tx_indexedsearch_sword_prev_include">###ADD_TO_CURRENT_SEARCH###</label>.</td> - </tr> - <!-- ###ADDITONAL_KEYWORD### end --> - - <!-- ###SEARCH_FORM_EXTENDED### begin --> - - <!-- ###SELECT_SEARCH_FOR### begin --> - <tr> - <td>###FORM_MATCH###</td> - <td> - <!-- ###SELECT_SEARCH_TYPE### begin --> - <select name="tx_indexedsearch[type]" class="tx-indexedsearch-selectbox-type type"> - ###SELECTBOX_TYPE_VALUES### - </select> - <!-- ###SELECT_SEARCH_TYPE### end --> - </td> - <td> - <!-- ###SELECT_SEARCH_DEFOP### begin --> - <select name="tx_indexedsearch[defOp]" class="tx-indexedsearch-selectbox-defop defop"> - ###SELECTBOX_DEFOP_VALUES### - </select> - <!-- ###SELECT_SEARCH_DEFOP### end --> - </td> - </tr> - <!-- ###SELECT_SEARCH_FOR### end --> - - <!-- ###SELECT_SEARCH_IN### begin --> - <tr> - <td>###FORM_SEARCHIN###</td> - <td> - <!-- ###SELECT_SEARCH_MEDIA### begin --> - <select name="tx_indexedsearch[media]" class="tx-indexedsearch-selectbox-media media"> - ###SELECTBOX_MEDIA_VALUES### - </select> - <!-- ###SELECT_SEARCH_MEDIA### end --> - </td> - <td> - <!-- ###SELECT_SEARCH_LANG### begin --> - <select name="tx_indexedsearch[lang]" class="tx-indexedsearch-selectbox-lang lang"> - ###SELECTBOX_LANG_VALUES### - </select> - <!-- ###SELECT_SEARCH_LANG### end --> - </td> - </tr> - <!-- ###SELECT_SEARCH_IN### end --> - - <!-- ###SELECT_SECTION### begin --> - <tr> - <td>###FORM_FROMSECTION###</td> - <td colspan="2"> - <select name="tx_indexedsearch[sections]" class="tx-indexedsearch-selectbox-sections sections"> - ###SELECTBOX_SECTIONS_VALUES### - </select> - </td> - </tr> - <!-- ###SELECT_SECTION### end --> - - <!-- ###SELECT_FREEINDEXUID### begin --> - <tr> - <td valign="top">###FORM_FREEINDEXUID###</td> - <td colspan="2"> - <select name="tx_indexedsearch[freeIndexUid]" class="tx-indexedsearch-selectbox-freeIndexUid freeIndexUid"> - ###SELECTBOX_FREEINDEXUIDS_VALUES### - </select> - </td> - </tr> - <!-- ###SELECT_FREEINDEXUID### end --> - - <!-- ###SELECT_ORDER### begin --> - <tr> - <td valign="top">###FORM_ORDERBY###</td> - <td colspan="2"> - <select name="tx_indexedsearch[order]" class="tx-indexedsearch-selectbox-order order"> - ###SELECTBOX_ORDER_VALUES### - </select> - <select name="tx_indexedsearch[desc]" class="tx-indexedsearch-selectbox-desc desc"> - ###SELECTBOX_DESC_VALUES### - </select> - </td> - </tr> - <!-- ###SELECT_ORDER### end --> - - <!-- ###SELECT_RESULTS### begin --> - <tr> - <td valign="top">###FORM_ATATIME###</td> - <td colspan="2"> - <select name="tx_indexedsearch[results]" class="tx-indexedsearch-selectbox-results results"> - ###SELECTBOX_RESULTS_VALUES### - </select> - </td> - </tr> - <!-- ###SELECT_RESULTS### end --> - - <!-- ###SELECT_GROUP### begin --> - <tr> - <td valign="top">###FORM_STYLE###</td> - <td colspan="2"> - <select name="tx_indexedsearch[group]" class="tx-indexedsearch-selectbox-group group"> - ###SELECTBOX_GROUP_VALUES### - </select> - - <!-- ###SELECT_EXTRESUME### begin --> - <br /><input type="hidden" name="tx_indexedsearch[extResume]" value="0" /><input type="checkbox" value="1" name="tx_indexedsearch[extResume]" id="tx_indexedsearch_extResume" ###EXT_RESUME_CHECKED### /> <label for="tx_indexedsearch_extResume">###FORM_EXTRESUME###</label> - <!-- ###SELECT_EXTRESUME### end --> - </td> - </tr> - <!-- ###SELECT_GROUP### end --> - - <!-- ###SEARCH_FORM_EXTENDED### end --> - <tr> - <td> </td> - <td><input type="submit" name="tx_indexedsearch[submit_button]" value="###FORM_SUBMIT###" class="tx-indexedsearch-searchbox-button submit" /></td> - </tr> - </table> - <p>###LINKTOOTHERMODE###</p> -</form> -</div> -<!-- ###SEARCH_FORM### end --> -<br /><br /> - - - - -<h2>TEMPLATE_RULES</h2> -<p><em>Template for displaying the search rules.</em></p> - -<!-- ###RULES### begin --> - <div class="tx-indexedsearch-rules"> - <h2>###RULES_HEADER###</h2> - <p>###RULES_TEXT###</p> - </div> -<!-- ###RULES### end --> -<br /><br /> - - - - -<h2>TEMPLATE_RESULT_SECTION_LINKS</h2> -<p><em>Template for the section links in section mode.</em></p> - -<!-- ###RESULT_SECTION_LINKS### begin --> - <div class="tx-indexedsearch-sec"> - <table cellpadding="0" cellspacing="0" border="0" summary="Result links"> - ###LINKS### - </table> - </div> -<!-- ###RESULT_SECTION_LINKS### end --> - -<!-- ###RESULT_SECTION_LINKS_LINK### begin --> - <tr> - <td width="100%">--> ###LINK###</td> - </tr> -<!-- ###RESULT_SECTION_LINKS_LINK### end --> -<br /><br /> - - - - -<h2>TEMPLATE_SECTION_HEADER</h2> -<p><em>Template for the section title in section mode.</em></p> -<!-- ###SECTION_HEADER### begin --> - <div class="tx-indexedsearch-secHead"><a name="###ANCHOR_URL###"></a> - <table cellpadding="0" cellspacing="0" border="0" summary="Section header"> - <tr> - <td class="tx-indexedsearch-title title" width="100%">###SECTION_TITLE###</td> - <td class="tx-indexedsearch-result-count result-count" nowrap="nowrap">###RESULT_COUNT### ###RESULT_NAME###</td> - </tr> - </table> - </div> - -<!-- ###SECTION_HEADER### end --> -<br /><br /> - - - - -<h2>TEMPLATE_RESULT_OUTPUT</h2> -<p><em>Template for the search result list.</em></p> - -<!-- ###RESULT_OUTPUT### begin --> - <div class="tx-indexedsearch-res"> - <table cellpadding="0" cellspacing="0" border="0" summary="Result row"> - <!-- ###HEADER_ROW### begin --> - <tr> - <td class="tx-indexedsearch-icon icon" nowrap="nowrap">###ICON###</td> - <td class="tx-indexedsearch-result-number result-number" nowrap="nowrap">###RESULT_NUMBER###</td> - <td class="tx-indexedsearch-title###CSSSUFFIX### title" width="100%">###TITLE###</td> - <td class="tx-indexedsearch-percent percent" nowrap="nowrap">###RATING###</td> - </tr> - <!-- ###HEADER_ROW### end --> - - <!-- ###ROW_LONG### begin --> - <tr> - <td> </td> - <td class="tx-indexedsearch-descr descr" width="100%" colspan="3">###DESCRIPTION###</td> - </tr> - <tr> - <td> </td> - <td class="tx-indexedsearch-info info" width="100%" colspan="3">###TEXT_ITEM_SIZE### ###SIZE### - ###TEXT_ITEM_CRDATE### ###CREATED### - ###TEXT_ITEM_MTIME### ###MODIFIED###<br /> - ###TEXT_ITEM_PATH### <span class="tx-indexedsearch-path path">###PATH###</span></td> - </tr> - <!-- ###ROW_LONG### end --> - - <!-- ###ROW_SHORT### begin --> - <tr> - <td> </td> - <td class="tx-indexedsearch-descr descr" width="100%" colspan="3">###DESCRIPTION###</td> - </tr> - <!-- ###ROW_SHORT### end --> - - <!-- ###ROW_SUB### begin --> - <tr> - <td> </td> - <td class="tx-indexedsearch-list list" width="100%" colspan="3"><br />###TEXT_ROW_SUB###<br /><br /></td> - </tr> - <!-- ###ROW_SUB### end --> - </table> - <br /> - </div> -<!-- ###RESULT_OUTPUT### end --> -<br /><br /> - - -</body> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl b/typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl deleted file mode 100644 index 64c57bfc7fd1..000000000000 --- a/typo3/sysext/compatibility7/Resources/Private/Templates/template_css.tmpl +++ /dev/null @@ -1,211 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>indexed_search template</title> -</head> - -<body> - -<h1>Indexed Search: Tableless template</h1> - - -<h2>TEMPLATE_SEARCH_FORM</h2> -<p><em>Template for displaying the search form.</em></p> - -<!-- ###SEARCH_FORM### begin --> -<div class="tx-indexedsearch-searchbox searchbox-tmpl-css"> -<form action="###ACTION_URL###" method="post" id="tx_indexedsearch"> - <div> - <input type="hidden" name="tx_indexedsearch[_sections]" value="0" /> - <input type="hidden" name="tx_indexedsearch[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" /> - <input type="hidden" name="tx_indexedsearch[pointer]" id="tx_indexedsearch_pointer" value="0" /> - <!-- ###HIDDEN_FIELDS### begin --> - <input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" /> - <!-- ###HIDDEN_FIELDS### end --> - </div> - - <fieldset> - <legend>###FORM_LEGEND###</legend> - - <div class="tx-indexedsearch-form"> - <label for="tx-indexedsearch-searchbox-sword">###FORM_SEARCHFOR###</label> - <input type="search" name="tx_indexedsearch[sword]" value="###SWORD_VALUE###" id="tx-indexedsearch-searchbox-sword" class="tx-indexedsearch-searchbox-sword sword" ###PLACEHOLDER### /> - </div> - - <!-- ###ADDITONAL_KEYWORD### begin --> - <input type="hidden" name="tx_indexedsearch[sword_prev]" value="###SWORD_PREV_VALUE###" /> - <input type="checkbox" name="tx_indexedsearch[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" ###SWORD_PREV_INCLUDE_CHECKED### /> <label for="tx_indexedsearch_sword_prev_include">###ADD_TO_CURRENT_SEARCH###.</label> - <!-- ###ADDITONAL_KEYWORD### end --> - - <!-- ###SEARCH_FORM_EXTENDED### begin --> - - <!-- ###SELECT_SEARCH_FOR### begin --> - <div class="tx-indexedsearch-search-for"> - <label for="tx-indexedsearch-selectbox-type">###FORM_MATCH###</label> - - <!-- ###SELECT_SEARCH_TYPE### begin --> - <select name="tx_indexedsearch[type]" id="tx-indexedsearch-selectbox-type" class="tx-indexedsearch-selectbox-type type">###SELECTBOX_TYPE_VALUES###</select> - <!-- ###SELECT_SEARCH_TYPE### end --> - - <!-- ###SELECT_SEARCH_DEFOP### begin --> - <select name="tx_indexedsearch[defOp]" id="tx-indexedsearch-selectbox-defop" class="tx-indexedsearch-selectbox-defop defop">###SELECTBOX_DEFOP_VALUES###</select> - <!-- ###SELECT_SEARCH_DEFOP### end --> - </div> - <!-- ###SELECT_SEARCH_FOR### end --> - - <!-- ###SELECT_SEARCH_IN### begin --> - <div class="tx-indexedsearch-search-in"> - <label for="tx-indexedsearch-selectbox-media">###FORM_SEARCHIN###</label> - - <!-- ###SELECT_SEARCH_MEDIA### begin --> - <select name="tx_indexedsearch[media]" id="tx-indexedsearch-selectbox-media" class="tx-indexedsearch-selectbox-media media">###SELECTBOX_MEDIA_VALUES###</select> - <!-- ###SELECT_SEARCH_MEDIA### end --> - - <!-- ###SELECT_SEARCH_LANG### begin --> - <select name="tx_indexedsearch[lang]" id="tx-indexedsearch-selectbox-lang" class="tx-indexedsearch-selectbox-lang lang">###SELECTBOX_LANG_VALUES###</select> - <!-- ###SELECT_SEARCH_LANG### end --> - </div> - <!-- ###SELECT_SEARCH_IN### end --> - - <!-- ###SELECT_SECTION### begin --> - <div class="tx-indexedsearch-search-select-section"> - <label for="tx-indexedsearch-selectbox-sections">###FORM_FROMSECTION###</label> - <select name="tx_indexedsearch[sections]" id="tx-indexedsearch-selectbox-sections" class="tx-indexedsearch-selectbox-sections sections">###SELECTBOX_SECTIONS_VALUES###</select> - </div> - <!-- ###SELECT_SECTION### end --> - - <!-- ###SELECT_FREEINDEXUID### begin --> - <div class="tx-indexedsearch-search-freeindexuid"> - <label for="tx-indexedsearch-selectbox-freeIndexUid">###FORM_FREEINDEXUID###</label> - <select name="tx_indexedsearch[freeIndexUid]" id="tx-indexedsearch-selectbox-freeIndexUid" class="tx-indexedsearch-selectbox-freeIndexUid freeIndexUid">###SELECTBOX_FREEINDEXUIDS_VALUES###</select> - </div> - <!-- ###SELECT_FREEINDEXUID### end --> - - <!-- ###SELECT_ORDER### begin --> - <div class="tx-indexedsearch-search-select-order"> - <label for="tx-indexedsearch-selectbox-order">###FORM_ORDERBY###</label> - <select name="tx_indexedsearch[order]" id="tx-indexedsearch-selectbox-order" class="tx-indexedsearch-selectbox-order order">###SELECTBOX_ORDER_VALUES###</select> - <select name="tx_indexedsearch[desc]" id="tx-indexedsearch-selectbox-desc" class="tx-indexedsearch-selectbox-desc desc">###SELECTBOX_DESC_VALUES###</select> - </div> - <!-- ###SELECT_ORDER### end --> - - <!-- ###SELECT_RESULTS### begin --> - <div class="tx-indexedsearch-search-select-results"> - <label for="tx-indexedsearch-selectbox-results">###FORM_ATATIME###</label> - <select name="tx_indexedsearch[results]" id="tx-indexedsearch-selectbox-results" class="tx-indexedsearch-selectbox-results results">###SELECTBOX_RESULTS_VALUES###</select> - </div> - <!-- ###SELECT_RESULTS### end --> - - <!-- ###SELECT_GROUP### begin --> - <div class="tx-indexedsearch-search-select-group"> - <label for="tx-indexedsearch-selectbox-group">###FORM_STYLE###</label> - <select name="tx_indexedsearch[group]" id="tx-indexedsearch-selectbox-group" class="tx-indexedsearch-selectbox-group group">###SELECTBOX_GROUP_VALUES###</select> - - <!-- ###SELECT_EXTRESUME### begin --> - <input type="hidden" name="tx_indexedsearch[extResume]" value="0" /> - <input type="checkbox" value="1" name="tx_indexedsearch[extResume]" id="tx_indexedsearch_extResume" ###EXT_RESUME_CHECKED### /> <label for="tx_indexedsearch_extResume">###FORM_EXTRESUME###</label> - <!-- ###SELECT_EXTRESUME### end --> - </div> - <!-- ###SELECT_GROUP### end --> - - <!-- ###SEARCH_FORM_EXTENDED### end --> - <div class="tx-indexedsearch-search-submit"> - <input type="submit" name="tx_indexedsearch[submit_button]" value="###FORM_SUBMIT###" id="tx-indexedsearch-searchbox-button-submit" class="tx-indexedsearch-searchbox-button submit" /> - </div> - </fieldset> - <p>###LINKTOOTHERMODE###</p> -</form> -</div> -<!-- ###SEARCH_FORM### end --> -<br /><br /> - - - - -<h2>TEMPLATE_RULES</h2> -<p><em>Template for displaying the search rules.</em></p> - -<!-- ###RULES### begin --> - <div class="tx-indexedsearch-rules"> - <h2>###RULES_HEADER###</h2> - <p>###RULES_TEXT###</p> - </div> -<!-- ###RULES### end --> -<br /><br /> - - - - -<h2>TEMPLATE_RESULT_SECTION_LINKS</h2> -<p><em>Template for the section links in section mode.</em></p> - -<!-- ###RESULT_SECTION_LINKS### begin --> - <div class="tx-indexedsearch-sec"> - <ol> - ###LINKS### - </ol> - </div> -<!-- ###RESULT_SECTION_LINKS### end --> - -<!-- ###RESULT_SECTION_LINKS_LINK### begin --> - <li>###LINK###</li> -<!-- ###RESULT_SECTION_LINKS_LINK### end --> -<br /><br /> - - - - -<h2>TEMPLATE_SECTION_HEADER</h2> -<p><em>Template for the section title in section mode.</em></p> -<!-- ###SECTION_HEADER### begin --> - <div id="###ANCHOR_URL###" class="tx-indexedsearch-secHead secHead-tmpl-css"> - <h2 class="tx-indexedsearch-title title">###SECTION_TITLE### <span class="tx-indexedsearch-result-count result-count result-count-tmpl-css">###RESULT_COUNT### ###RESULT_NAME###</span></h2> - </div> - -<!-- ###SECTION_HEADER### end --> -<br /><br /> - - - - -<h2>TEMPLATE_RESULT_OUTPUT</h2> -<p><em>Template for the search result list.</em></p> -<!-- ###RESULT_OUTPUT### begin --> - <div class="tx-indexedsearch-res res res-tmpl-css"> - <!-- ###HEADER_ROW### begin --> - <h3><span class="tx-indexedsearch-icon icon">###ICON###</span> <span class="tx-indexedsearch-result-number result-number">###RESULT_NUMBER###</span> <span class="tx-indexedsearch-title###CSSSUFFIX### title">###TITLE###</span> <span class="tx-indexedsearch-percent percent percent-tmpl-css">###RATING###</span></h3> - <!-- ###HEADER_ROW### end --> - - <!-- ###ROW_LONG### begin --> - <p class="tx-indexedsearch-descr descr">###DESCRIPTION###</p> - <dl class="tx-indexedsearch-info info info-tmpl-css"> - <dt class="tx-indexedsearch-text-item-size item-size">###TEXT_ITEM_SIZE### </dt> - <dd class="tx-indexedsearch-text-item-size item-size">###SIZE###, </dd> - - <dt class="tx-indexedsearch-text-item-crdate item-crdate">###TEXT_ITEM_CRDATE### </dt> - <dd class="tx-indexedsearch-text-item-crdate item-crdate">###CREATED###, </dd> - - <dt class="tx-indexedsearch-text-item-mtime item-mtime">###TEXT_ITEM_MTIME### </dt> - <dd class="tx-indexedsearch-text-item-mtime item-mtime">###MODIFIED###</dd> - - <dt class="tx-indexedsearch-text-item-path item-path">###TEXT_ITEM_PATH### </dt> - <dd class="tx-indexedsearch-text-item-path item-path">###PATH###</dd> - </dl> - <!-- ###ROW_LONG### end --> - - <!-- ###ROW_SHORT### begin --> - <p class="tx-indexedsearch-descr descr">###DESCRIPTION###</p> - <!-- ###ROW_SHORT### end --> - - <!-- ###ROW_SUB### begin --> - <p class="tx-indexedsearch-list list">###TEXT_ROW_SUB###</p> - <!-- ###ROW_SUB### end --> - </div> -<!-- ###RESULT_OUTPUT### end --> -<br /><br /> - - -</body> -</html> diff --git a/typo3/sysext/compatibility7/Resources/Public/Icons/Extension.png b/typo3/sysext/compatibility7/Resources/Public/Icons/Extension.png deleted file mode 100644 index ef81ce288743eabb87151fa3dc79fbbbc95b2e1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3450 zcmb_ec{J4j_kO*HvF}StiO`}AAK6kFkwzp$*;Cfy6Gf4AwAjg#H6eR;5+h_ni9)u9 z5QRcvkad{*^E>DF*YB_IAK!bPd!G9|=iGDux%ZqKYM_6Xn?sZXA;hgi)G|T{+bS`{ z#<WGwMW)7E#O$bXUIU@>$DA8i@mpHLmS}VyA@6+%kscznzGaan5xOIX(6kLg$CD5e zaZ7z|cmg5ZfPtRz83;!IABj?st^m2GAx{hPwV~7mvQNS@SxDRikNF`OgIEzLH;1lg zF#jF4Vs#!C#^84^jK7DkWzdlTjs8$&3rW%t#sVn^pfwVvx&Ro!*nqiV_*xDvAy8on zAvj2ofWq@o?+y)~@cLiKRE1R<jJ|=U0LVH4p?JtX1vNLIGYQ7u!CPO57KFtKSX+et zB8cLFG&!iSfR<1gu7dd=u=o?gSYcxo`f?$8A5=R)Z#HbM!<##>G7F`~u(1Y(dhn|q zay1}E7|KlHb1Dp!!iRA96bBKUkf#YB!eFu!s_bC82jaybS_mp_U~K^s#9?6^o*slJ zJE8U_{GEh2QFtr>-y49j2`_YjS^%G7A$~U$8$yE@)VaYQDkSfR&J>_8L*{XKdI<V* zApa~p=7Y8<_}L2S$6)p=gfKyKAZ*fMv>x)#z(_50XTXzPFw+l}SAcR4>TW^FMIc{? znE^=J3$?CLa1Jt*pzSe~UV@fj7<>uORUq{UWGKQ*E1-BoXELnJKzBMsaKK0%6dOR# zb0{~1^nZZ90?U7ZS_ohAp~MLOe1UK_h}!{UP4J@;UJ#+b7-k0{lo^($AWa_H<Kfpw zpp8P78oYLa_9swu0aoVV^Hcco7T!I8kI_JV0XYPiXo1NN7_NqJc6fCa)|Y_n1am|1 z#sea`AoVa*J3?y&<fy~%J{Ty0<=^m)482*fG!0E8h}i~jeV{81-ampyKX~^LVz)!0 zBt-E-iVRG5!*>ddHN#*9RNKS)UwCN^bKhX(H5BN=)Mxls0}XfKXB*H)w$}a$j{nRS z;XRD>FMgY4tj*t!R^GY_gk94;tF<s#73H-h*xiU`?g()T{BL62!~Ppv-i(fxhOyVz znc*o-VG|)l+wUe^c|QcZ$Rud~fm_&u=&nPQl=5sZHXf3D^(engsJi!Dab-o(hr<>J zxQ~3ibV$*{rM&3y;7UDYoD~gxQ{(<C)qT!S>X$Dq&V5!@y+wJheaL6O5QpORX8r>1 z!84{TPTg9^ey|BPH}@ZHbZBmV=#procDlU0O1ErBdHHj)%HWy)2(k);&knJaSur!o zq5lGov5<1xe+UW)q*OcYW-R7AoE48t>J33r=T9Adr+V0^$9(rl!JVgq0^JHxPNb^+ zRUbXZWA1df=B0jBQp-SjujW3N$I;h@R9g%qdXHMwPOxxDl+&jiQ<Kdt=w>AW`{!Kx z7!bMpWLzgZj-Xxo&2K%;;_}@FUuwg>%u<GP)@a?$F7D3_w2g!_+|F+(OR~RsY218K zcSWup<v)(Ci=<KKXx`zAmb_%P?f?}Qp0HD-x0*q@S|xXr=o(FdNdIR@Oc!(Xt@-?} zS!#v+EbHAsoJvRktuCBfYtG3QUEOD+{(rPoNDAfBqG;dw+1LrgNuiajxVor#?XSjz zsE0#0&xbldJ*lxfH=soZZ^f05DrBD;W*Gm}TiNx}4RuT`qlFTpVe!H_KXh3`ALAfZ z6n^Y0)ce9ZYH5of{rcP2@2&~iF(ndD{)VFzEefAnoemx^^f|h1lw}O9S^1@Iq#;RR zb^|W*<@>m#p6-B{e@Hd`7c-g<5GLx@NTRj6{~V>@4j*HWCbJpa`slRnEJv+vePh@* z*}y)saqQy0!xW>5g)S7A0asiTr0emVWuLZF{!DxpwWm%Co08<)xFxXIpg`x;J-Xrb zJfd_ivat1-li4>TY0AGrD0i7e?blompYWEZ%mkrJ*TP&5>O^b`S-P;;jC<+D6iO%O zt!-SrMHDhg!Bm7zCfv-X1M_>`H&=LZlc5E-0}n5W<@b7~U>{gcHoOSmHE_>c<lvHw z1G<zI=8;-!Pu`SE4o<?ztn6jl2^-dWKmSoci_s{jVmxt=z=-2y?&KzsbpN2vf^YNQ zs?yt>DkRou)M0M6yn|LJ#*K}Z^nLd-NbnOoF{c@XkTP!Pdo(bV=Ds^9*NQhq8IKJ7 z*~UfLEB-zvygbD*HNr!1Hd}AWFvC1GZP4Q^tRvxBQ6HsNvL{^*|Cxt-)FWYn)!HGQ zd5IV6-<rgb9Af);@8yk6CsG~_DOPMeRnjzaNOR!IP~1(qXRbt1h>ozZ+0;Z|`A|eG zw;XHi{3Um!%Z}3G88>&#s9&A8aYvo}h$t=)Ud&j0g<Iyuw(DWEI+ur9BQJSUMYwPw zBJ4=XH8zqKJLfT)!^B5Ql+niqY;Vt3j<}Q(=&YDa7E0P9_CqJ2^{1vIM-w`5lu7^X zu>roqjlDj?L+WhE$6}R0OrLP1uC^_un32v+#GkM5vO2E)Jl%Nk`)1Sbs96bB{5d;K zWBNTpS=%v+nKU|-W9wmXp>o&DAU<ZAC_82S#=v&9zRMTt0w={;q8q}sGO9hIl}&oG zGrn{;=6?9>%T{+-OlsxGyJL@%7=g$&4%sE>u$mPn*thO`m7;?=y<t}w9M8&cPp#+c zQ};;An4Xe(EHV<qQ(<9$bYa_g2abULc$7StFY$e{B4i}7E%F-rmWQnp7@gHUKBs1P z+kpY8jrTh9!SN=KW%J03{t<i8#;0Yb`Ir_t>%vfKes2MuFfTeGoLo53WVcK9WZhnW zb^Zec;r2ug$I=#+u~P}VEPJ_z)qUSGU)y(fGih##kXJKqJ1Xc4ZlsUb(Rg*Rvu*P4 z=S;;nGh;8@zAU|=%6LH~(k-L(jz~?4mpe@>WL_L~?~KvbI&pMyTNr~M9aF|PLi9ar zslDwH9+u*<Th>6Q0Q&)t3ZRLp>a*xY=HdCS@L_+}yM2o81Y6$``I9{*&P0o+=3Xg~ zKYg{#n%i;TFip`A@?SMg%4D%-+1zimF=+}1^-NB0)*}L_IlCiB-uOD%l~K!|SQGh! z6JZ2~w<M{^`Uca@Awzn@?4Z}{<(QAZ3=3PPTRaP-5{i9g)9$+K2vKexM0xn@7vH1i z6=Ni0GAdexla70aqd#DemVd-yBjT2pWsl}L24rZ4a+rfg6@Tci`tK&D%zU&+W}e6; z4t4fSKGO8rTPpr+(xg?A{^&yjZiC25>rvKV?$?ob{cGc^yCgLtjeHOFv)u~d!`Mn6 zMk%P0kdUs^bY{rkyplbr@zC?J@uK&_woC+<JRzdOMivP->Ua+Q5?TG^YJqm-`^oZz zi^lt88{#FtMB`KhJz2SJl&(1!6Xhi^i<qk@XUfuFvM{TPIz5RcnMb(3zPfQ^IxE`A zb^duT((jle%ajFS>tlB{!nZ5_W)nwKEF@RoJ>iv`djm0a#OqQ>jgML-QDqwMr_9xA zU4{njO%<2Vs1xpYFqEBsr_+RYmO3-99$`bm>+4`OMwM(#ESglqD^34S7a$DE(1PDH zbVd|Ba?==`Us>=H*1VJx&o+DBT%W!ywkg}m%R|{!ko;gtQn2=5n>6Z^yuU6lcqLwg z^jFfih1)iCHqXAfbWqCtf~m+NMt^64CuXOp-IM#<`7G1_`wzQrh6rDKs4`nLr|+6x zbJ8`NFI;Pfl-V2jE?miP2;i2r%BfZT(nkPM^xp8~-W?9(1Ee78EJLRUOzgr>>oJW- z<xHyQeIkOnb)B!;^imD0WFhWKup;VW<wai3rb3u;)<~*X@C$}wy>I=_1)Uvz1w?1` zfjaR-)KWc@U1CgD3kKUQ(JNet$13%?=;XGyhIlmMsc^*WWwRu!TY7S(ur{5_X0W7| z54o!`S<Hm&fIki3etxA?kkCv|JHAvs&)Dkzb}C)4@<IJRX>Y7q_{}=ptXg9zGLc=7 zpz5;mSWEbEQZ{QmUEF?_-k^aDUyz3lR7an+1|mM4bESGZPi<cWY$D0)Pdq^_>Q!F@ zhW1o>4@n-Hvvavg7DHW@>&<Q+q4mq$ScutdPjK7dsOO^ye`Hwme!_V^&7*K;Clg=h zzuA77BK58{eh<)TW8aZ7dS-nXeZQCtI?ZKn>{;!#p1`?naCZ0vi7zgpWLMQ>M?L+E z_iU!uL!8!?|NC`FGm_g$*nb2HGr=--M$$#w((-`Pm%IE*Qc6m8wakP3VWH(#_uE54 nzw^E|NXnSkKF~XfF)*$E3!l=3#!a`rL8Nm=U#sM_&HeuY%t7G1 diff --git a/typo3/sysext/compatibility7/Resources/Public/JavaScript/ContextMenuActions.js b/typo3/sysext/compatibility7/Resources/Public/JavaScript/ContextMenuActions.js deleted file mode 100644 index 3f42aba5a175..000000000000 --- a/typo3/sysext/compatibility7/Resources/Public/JavaScript/ContextMenuActions.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -/** - * Module: TYPO3/CMS/Compatibility7/ContextMenuActions - * - * JavaScript to handle Version actions from context menu - * @exports TYPO3/CMS/Version/ContextMenuActions - */ -define(function () { - 'use strict'; - - /** - * @exports TYPO3/CMS/Compatibility7/ContextMenuActions - */ - var ContextMenuActions = {}; - - ContextMenuActions.openVersionModule = function (table, uid) { - var $anchorElement = $(this); - var actionUrl = $anchorElement.data('actionUrl'); - top.TYPO3.Backend.ContentContainer.setUrl( - actionUrl + - '&redirect=' + top.rawurlencode(top.list_frame.document.location.pathname + top.list_frame.document.location.search) - ); - }; - - return ContextMenuActions; -}); diff --git a/typo3/sysext/compatibility7/composer.json b/typo3/sysext/compatibility7/composer.json deleted file mode 100644 index 596d388fd741..000000000000 --- a/typo3/sysext/compatibility7/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "typo3/cms-compatibility7", - "type": "typo3-cms-extension", - "description": "TYPO3 Core", - "homepage": "https://typo3.org", - "license": ["GPL-2.0+"], - - "require": { - "typo3/cms-core": "*" - }, - "replace": { - "compatibility7": "*" - }, - "conflict": { - "typo3/cms-compatibility6": "*" - }, - "extra": { - "typo3/class-alias-loader": { - "class-alias-maps": [ - "Migrations/Code/ClassAliasMap.php" - ] - } - }, - "autoload": { - "psr-4": { - "TYPO3\\CMS\\Compatibility7\\": "Classes/" - } - } -} diff --git a/typo3/sysext/compatibility7/ext_emconf.php b/typo3/sysext/compatibility7/ext_emconf.php deleted file mode 100644 index e0509426c927..000000000000 --- a/typo3/sysext/compatibility7/ext_emconf.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -$EM_CONF[$_EXTKEY] = [ - 'title' => 'Compatibility Mode for TYPO3 CMS 7.x', - 'description' => 'Provides an additional backwards-compatibility layer with legacy functionality for sites that haven\'t fully migrated to v8 yet.', - 'category' => 'be', - 'state' => 'stable', - 'uploadfolder' => 0, - 'createDirs' => '', - 'clearCacheOnLoad' => 0, - 'author' => 'TYPO3 CMS Team', - 'author_email' => '', - 'author_company' => '', - 'version' => '8.7.0', - 'constraints' => [ - 'depends' => [ - 'typo3' => '8.7.0-8.7.99', - 'backend' => '8.7.0-8.7.99', - 'indexed_search' => '8.7.0-8.7.99', - ], - 'conflicts' => [ - 'compatibility6' => '0.0.0', - ], - 'suggests' => [], - ], -]; diff --git a/typo3/sysext/compatibility7/ext_localconf.php b/typo3/sysext/compatibility7/ext_localconf.php deleted file mode 100644 index 78f1c96b2336..000000000000 --- a/typo3/sysext/compatibility7/ext_localconf.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -defined('TYPO3_MODE') or die(); - -// Indexed search -if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('indexed_search')) { - // register pibase plugin - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( - 'indexed_search', - 'setup', - trim(' - plugin.tx_indexedsearch = USER_INT - plugin.tx_indexedsearch.userFunc = ' . \TYPO3\CMS\Compatibility7\Controller\SearchFormController::class . '->main - ') - ); - // add default rendering for pibase plugin - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( - 'indexed_search', - 'setup', - 'tt_content.list.20.indexed_search =< plugin.tx_indexedsearch', - 'defaultContentRendering' - ); -} - -// Content element -if (TYPO3_MODE === 'BE') { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( - '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:compatibility7/Configuration/PageTS/Mod/Wizards/NewContentElementMenu.txt">' - ); -} -if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('css_styled_content')) { - $GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'compatibility7/Configuration/TypoScript/ContentElement/CssStyledContent/'; -} -if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('fluid_styled_content')) { - $GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'][] = 'compatibility7/Configuration/TypoScript/ContentElement/FluidStyledContent/'; - // Set alias for deprecated fluid styled content menu viewhelper - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\AbstractMenuViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\AbstractMenuViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\AbstractMenuViewHelper' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\CategoriesViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\CategoriesViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\CategoriesViewHelper' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\DirectoryViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\DirectoryViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\DirectoryViewHelper' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\KeywordsViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\KeywordsViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\KeywordsViewHelper' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\ListViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\ListViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\ListViewHelper' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\MenuViewHelperTrait')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\MenuViewHelperTrait::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\MenuViewHelperTrait' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\SectionViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\SectionViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\SectionViewHelper' - ); - } - if (!class_exists('TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\UpdatedViewHelper')) { - class_alias( - \TYPO3\CMS\Compatibility7\ViewHelpers\Menu\UpdatedViewHelper::class, - 'TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\UpdatedViewHelper' - ); - } -} - -// Enable pages.url_scheme functionality again -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typolinkProcessing']['typolinkModifyParameterForPageLinks']['compatibility7_urlscheme'] - = \TYPO3\CMS\Compatibility7\Hooks\EnforceUrlSchemeHook::class; - -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['fetchPageId-PostProcessing']['compatibility7_urlscheme'] - = \TYPO3\CMS\Compatibility7\Hooks\EnforceUrlSchemeHook::class . '->redirectIfUrlSchemeDoesNotMatch'; - -// Enable action `QuickEdit` in page layout controller again -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Backend\Controller\PageLayoutController::class]['initActionHook']['compatibility7_quickedit'] - = \TYPO3\CMS\Compatibility7\Hooks\PageLayoutActionHook::class . '->initAction'; - -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Backend\Controller\PageLayoutController::class]['renderActionHook']['compatibility7_quickedit'] - = \TYPO3\CMS\Compatibility7\Hooks\PageLayoutActionHook::class . '->renderAction'; - -// Enable TypoScript functionality config.sys_language_softExclude -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess']['compatibility7_softExclude'] - = \TYPO3\CMS\Compatibility7\Hooks\TcaSoftExcludeHook::class . '->setCustomExcludeFields'; - -// Enable TypoScript functionality config.beLoginLinkIPList -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['compatibility7_backendloginlink'] - = \TYPO3\CMS\Compatibility7\Hooks\BackendLoginLinkHook::class . '->renderBackendLoginLink'; - -// Call MonitorUtility peakMemoryUsage -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['compatibility7_monitorutility'] - = \TYPO3\CMS\Compatibility7\Utility\MonitorUtility::class . '->monitorUtilityFrontendHook'; diff --git a/typo3/sysext/compatibility7/ext_tables.php b/typo3/sysext/compatibility7/ext_tables.php deleted file mode 100644 index d6404b1189f1..000000000000 --- a/typo3/sysext/compatibility7/ext_tables.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -defined('TYPO3_MODE') or die(); - -if (TYPO3_MODE === 'BE') { - if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('indexed_search')) { - $GLOBALS['TBE_MODULES_EXT']['xMOD_db_new_content_el']['addElClasses']['tx_indexed_search_pi_wizicon'] = - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('compatibility7') . 'PHP/class.tx_indexed_search_pi_wizicon.php'; - } - - if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('version') && - !\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('workspaces')) { - $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1486418676] = \TYPO3\CMS\Compatibility7\ContextMenu\ItemProvider::class; - } - - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['system'][] = \TYPO3\CMS\Compatibility7\Report\Status\SystemStatus::class; -} diff --git a/typo3/sysext/compatibility7/ext_tables.sql b/typo3/sysext/compatibility7/ext_tables.sql deleted file mode 100644 index e1bc26490948..000000000000 --- a/typo3/sysext/compatibility7/ext_tables.sql +++ /dev/null @@ -1,14 +0,0 @@ -# -# Table structure for table 'tt_content' -# -CREATE TABLE tt_content ( - menu_type varchar(30) DEFAULT '0' NOT NULL, - select_key varchar(80) DEFAULT '' NOT NULL -); - -# -# Additional fields for table 'pages' -# -CREATE TABLE pages ( - url_scheme tinyint(3) unsigned DEFAULT '0' NOT NULL -); diff --git a/typo3/sysext/compatibility7/ext_typoscript_setup.txt b/typo3/sysext/compatibility7/ext_typoscript_setup.txt deleted file mode 100644 index 5087405ab981..000000000000 --- a/typo3/sysext/compatibility7/ext_typoscript_setup.txt +++ /dev/null @@ -1,135 +0,0 @@ -config.index_enable = 0 -config.index_externals = 0 -config.index_metatags = 1 - -plugin.tx_indexedsearch { - templateFile = EXT:compatibility7/Resources/Private/Templates/indexed_search.tmpl - - # Date formats for created/modified dates in search results. See PHP strftime() function. Leave blank for using system defaults - dateFormat { - created = - modified = - } - - breadcrumbWrap = / || / - - show { - rules = 1 - parsetimes = 0 - L2sections = 0 - L1sections = 1 - LxALLtypes = 0 - clearSearchBox = 0 - clearSearchBox.enableSubSearchCheckBox = 0 - forbiddenRecords = 0 - alwaysShowPageLinks = 0 - advancedSearchLink = 1 - resultNumber = 0 - mediaList = - } - - # Blinding of option-selectors / values in these (advanced search) (see $optValues array in source code for options + extResume checkbox) - blind { - type = 0 - defOp = 0 - sections = 0 - freeIndexUid = 1 - media = 0 - order = 0 - group = 0 - lang = 0 - desc = 0 - results = 0 - # defOp.1=1 - # extResume=1 - } - rules_stdWrap { - } - sectionlinks_stdWrap { - } - path_stdWrap { - } - resultlist_stdWrap { - } - search { - rootPidList = - page_links = 10 - detect_sys_domain_records = 0 - defaultFreeIndexUidList = -1 - skipExtendToSubpagesChecking = 0 - exactCount = 0 - targetPid.data = TSFE:id - } - - # various crop/offset settings for single result items - results { - titleCropAfter = 50 - titleCropSignifier = ... - summaryCropAfter = 180 - summaryCropSignifier = - hrefInSummaryCropAfter = 60 - hrefInSummaryCropSignifier = ... - markupSW_summaryMax = 300 - markupSW_postPreLgd = 60 - markupSW_postPreLgd_offset = 5 - markupSW_divider = ... - markupSW_divider.noTrimWrap = | | | - } - result_link_target = -/* - flagRendering = CASE - flagRendering { - key.current = 1 - 2 = TEXT - 2.value = German - default = TEXT - default.value = English - } -*/ -/* - iconRendering = CASE - iconRendering { - key.current = 1 - html = TEXT - html.value = HtmL - default = TEXT - default.value = TYPO3 pages - } -*/ - forwardSearchWordsInResultLink = 0 - forwardSearchWordsInResultLink.no_cache = 1 - linkSectionTitles = 1 - - # Setting default values for piVars (please see the source code for the form-field names which you can preset values for here) - _DEFAULT_PI_VARS { - extResume = 1 - type = 1 - group = flat - } - _CSS_DEFAULT_STYLE ( - .tx-indexedsearch .tx-indexedsearch-browsebox LI { display:inline; margin-right:5px; } - .tx-indexedsearch .tx-indexedsearch-searchbox INPUT.tx-indexedsearch-searchbox-button { width:100px; } - .tx-indexedsearch .tx-indexedsearch-searchbox INPUT.tx-indexedsearch-searchbox-sword { width:150px; } - .tx-indexedsearch .tx-indexedsearch-whatis { margin-top:10px; margin-bottom:5px; } - .tx-indexedsearch .tx-indexedsearch-whatis .tx-indexedsearch-sw { font-weight:bold; font-style:italic; } - .tx-indexedsearch .tx-indexedsearch-noresults { text-align:center; font-weight:bold; } - .tx-indexedsearch .tx-indexedsearch-res TD.tx-indexedsearch-descr { font-style:italic; } - .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-descr .tx-indexedsearch-redMarkup { color:red; } - .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-info { background:#eeeeee; } - .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead { margin-top:20px; margin-bottom:5px; } - .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead H2 { margin-top:0px; margin-bottom:0px; } - .tx-indexedsearch .tx-indexedsearch-res .tx-indexedsearch-secHead TD { background:#cccccc; vertical-align:middle; } - .tx-indexedsearch .tx-indexedsearch-res .noResume { color:#666666; } - .tx-indexedsearch .tx-indexedsearch-category { background:#cccccc; font-size:16px; font-weight:bold; } - - /* Additional styles, needed for the tableless template_css.tmpl (styles don't conflict with the original template) */ - .tx-indexedsearch .res-tmpl-css { clear:both; margin-bottom:1em; } - .tx-indexedsearch .searchbox-tmpl-css LABEL { margin-right:1em; width:10em; float:left; } - .tx-indexedsearch .result-count-tmpl-css, .tx-indexedsearch .percent-tmpl-css { letter-spacing:0; font-weight:normal; margin-top:-1.2em; float:right; } - .tx-indexedsearch .info-tmpl-css dt, .tx-indexedsearch dl.info-tmpl-css dd { float:left; } - .tx-indexedsearch .info-tmpl-css dd.item-mtime { float:none; } - .tx-indexedsearch .info-tmpl-css dd.item-path { float:none; } - ) - _LOCAL_LANG { - } -} diff --git a/typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php b/typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php new file mode 100644 index 000000000000..7994a9f53e41 --- /dev/null +++ b/typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php @@ -0,0 +1,122 @@ +<?php +namespace TYPO3\CMS\Install\Updates; + +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + +use TYPO3\CMS\Core\Utility\GeneralUtility; + +/** + * Installs and downloads EXT:compatibility7 if needed + */ +class Compatibility7ExtractionUpdate extends AbstractDownloadExtensionUpdate +{ + /** + * @var string + */ + protected $title = 'Installs extension "compatibility7" from TER'; + + /** + * @var string + */ + protected $extensionKey = 'compatibility7'; + + /** + * @var array + */ + protected $extensionDetails = [ + 'compatibility7' => [ + 'title' => 'Compatibility Mode for TYPO3 CMS 7.x', + 'description' => 'Provides an additional backwards-compatibility layer with legacy functionality for sites that haven\'t fully migrated to TYPO3 CMS 8 yet.', + 'versionString' => '8.7.0', + ] + ]; + + /** + * Checks if an update is needed + * + * @param string $description The description for the update + * @return bool Whether an update is needed (true) or not (false) + */ + public function checkForUpdate(&$description) + { + $description = 'The extension "compatibility7" (Compatibility Mode for TYPO3 CMS 7.x) was extracted into ' + . 'the TYPO3 Extension Repository. This update downloads the TYPO3 Extension from the TER.'; + + $updateNeeded = false; + + if (!$this->isWizardDone()) { + $updateNeeded = true; + } + + return $updateNeeded; + } + + /** + * Second step: Ask user to install the extension + * + * @param string $inputPrefix input prefix, all names of form fields have to start with this. Append custom name in [ ... ] + * @return string HTML output + */ + public function getUserInput($inputPrefix) + { + return ' + <div class="panel panel-danger"> + <div class="panel-heading">Are you really sure?</div> + <div class="panel-body"> + <p>You should install EXT:compatibility7 only if you really need it.</p> + <p>This update wizard cannot check if the extension was installed before the update.</p> + <p>Are you really sure, you want to install EXT:compatibility7?</p> + <div class="btn-group clearfix" data-toggle="buttons"> + <label class="btn btn-default active"> + <input type="radio" name="' . $inputPrefix . '[install]" value="0" checked="checked" /> no, don\'t install + </label> + <label class="btn btn-default"> + <input type="radio" name="' . $inputPrefix . '[install]" value="1" /> yes, please install + </label> + </div> + </div> + </div> + '; + } + + /** + * Performs the update if EXT:compatibility7 should be installed. + * + * @param array $databaseQueries Queries done in this update + * @param string $customMessage Custom message + * @return bool + */ + public function performUpdate(array &$databaseQueries, &$customMessage) + { + $requestParams = GeneralUtility::_GP('install'); + if (!isset($requestParams['values']['compatibility7Extension']['install'])) { + return false; + } + $install = (int)$requestParams['values']['compatibility7Extension']['install']; + + if ($install === 1) { + // user decided to install extension, install and mark wizard as done + $updateSuccessful = $this->installExtension($this->extensionKey, $customMessage); + if ($updateSuccessful) { + $this->markWizardAsDone(); + return true; + } + } else { + // user decided to not install extension, mark wizard as done + $this->markWizardAsDone(); + return true; + } + return $updateSuccessful; + } +} diff --git a/typo3/sysext/install/ext_localconf.php b/typo3/sysext/install/ext_localconf.php index d35928286338..9a54d740a782 100644 --- a/typo3/sysext/install/ext_localconf.php +++ b/typo3/sysext/install/ext_localconf.php @@ -68,3 +68,5 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\TYPO3\CMS\In = \TYPO3\CMS\Install\Updates\SysRefindexHashUpdater::class; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\TYPO3\CMS\Install\Updates\MigrateFeSessionDataUpdate::class] = \TYPO3\CMS\Install\Updates\MigrateFeSessionDataUpdate::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['compatibility7Extension'] + = \TYPO3\CMS\Install\Updates\Compatibility7ExtractionUpdate::class; -- GitLab