From b732b8f82bd9c84442fb89eaf47907d3d7dfc3e3 Mon Sep 17 00:00:00 2001 From: Francois Suter Date: Tue, 8 Mar 2016 16:23:24 +0100 Subject: [PATCH] [CLEANUP] Remove old hook class The class that used to hook into the RecordList display to filter out translations cannot be used anymore as we don't rely on our own RecordList class anymore. Thus it is not possible to know in which context the list view is being displayed and act only when in the LinkBrowser. Maybe some solution can be found in the future, but for now this feature is removed. --- Classes/Browser/RecordListHook.php | 54 ------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 Classes/Browser/RecordListHook.php diff --git a/Classes/Browser/RecordListHook.php b/Classes/Browser/RecordListHook.php deleted file mode 100644 index 8a816ab..0000000 --- a/Classes/Browser/RecordListHook.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @package Aoe\Linkhandler\Browser - */ -class RecordListHook implements RecordListGetTableHookInterface -{ - /** - * Modified the List database query to avoid displaying translations when called - * for the linkhandler element browser. - * - * @param string $table The current database table - * @param int $pageId The record's page ID - * @param string $additionalWhereClause An additional WHERE clause - * @param string $selectedFieldsList Comma separated list of selected fields - * @param \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList $parentObject Parent \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList object - * @return void - */ - public function getDBlistQuery($table, $pageId, &$additionalWhereClause, &$selectedFieldsList, &$parentObject) - { - $parentClass = get_class($parentObject); - // Act only if the calling object is our own element browser - if ($parentClass === 'Aoe\Linkhandler\Browser\RecordListRte') { - // If the table uses localization in same table, add condition to display on records in default language. - // We don't want the user to be able to point to translations, as these would create wrong links. - if ($GLOBALS['TCA'][$table]['ctrl']['languageField'] - && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] - && !$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'] - ) { - $additionalWhereClause .= ' AND ' . $table . '.' . $GLOBALS['TCA'][$table]['ctrl']['languageField'] . ' = 0 '; - } - } - } - -} \ No newline at end of file