diff --git a/Classes/Domain/Repository/AbstractRepository.php b/Classes/Domain/Repository/AbstractRepository.php index 10fc1162055b7317a06bf1b2e287bb78677be128..26a1770e4d8ac1393ea6c879b53caf4381c8d807 100644 --- a/Classes/Domain/Repository/AbstractRepository.php +++ b/Classes/Domain/Repository/AbstractRepository.php @@ -27,6 +27,7 @@ namespace SGalinski\SgNews\Domain\Repository; ***************************************************************/ use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Core\Http\ApplicationType; use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Persistence\Repository; @@ -43,44 +44,15 @@ abstract class AbstractRepository extends Repository { * @return void */ public function initializeObject() { - /** @var $querySettings Typo3QuerySettings */ + /** @var Typo3QuerySettings $querySettings */ $querySettings = $this->objectManager->get(Typo3QuerySettings::class); $querySettings->setRespectStoragePage(FALSE); - if (TYPO3_MODE === 'BE') { + if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) { $querySettings->setIgnoreEnableFields(TRUE); } $this->setDefaultQuerySettings($querySettings); } - /** - * Method creates a statement string of the enableFields for the given database table. - * - * @param string $table - * @param string $alias - * @param bool $ignoreEnableFields - * @return string - * @throws \InvalidArgumentException - */ - protected function getEnableFieldsStatement($table, $alias = '', $ignoreEnableFields = FALSE): string { - if (TYPO3_MODE === 'FE' && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { - /** @var PageRepository $pageRepository */ - $pageRepository = $GLOBALS['TSFE']->sys_page; - $statement = $pageRepository->enableFields($table); - } else { - $statement = BackendUtility::deleteClause($table); - - if (!$ignoreEnableFields) { - $statement .= BackendUtility::BEenableFields($table); - } - } - - if ($alias !== '') { - $statement = str_replace($table, $alias, $statement); - } - - return $statement; - } - /** * This count returns the right amount of results, in contrast to $query->execute()->count(), which does not respect * the language- nor the workspace overlay. diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index 020528df0ddaeba6d441728d1237c1058a3561be..2febe1b8c751b6f26ceeb29936e9681c97ff83d0 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -1,5 +1,5 @@ <?php - +defined('TYPO3') or die(); /** * * Copyright notice diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index dd729bc2d43b1862cb266b36853f7c41331c1592..6c3b27939d027a97b95dd4f658d5f3452cad4195 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -1,4 +1,5 @@ <?php +defined('TYPO3') or die(); /** * * Copyright notice diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 74941774a7f31de15622d814591b6b8c029eac0b..697f27ae2ac55d04d3acf878e82b7913f518161f 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,4 +1,5 @@ <?php +defined('TYPO3') or die(); /** * * Copyright notice diff --git a/ext_localconf.php b/ext_localconf.php index 3444aeb8b880a9b38666e3e55858f239dbae144b..59986290feda44edcab5c397c32a547414fdbf5d 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,4 +1,5 @@ <?php +defined('TYPO3') or die(); /** * * Copyright notice diff --git a/ext_tables.php b/ext_tables.php index 9068794103e4c10a82d75f8ccc9e4c3a4e5d66a4..eaa671414b7b867829f04c97807e989c2ec46407 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,4 +1,5 @@ <?php +defined('TYPO3') or die(); /** * * Copyright notice @@ -30,23 +31,21 @@ call_user_func( 'tx_sgnews_domain_model_author' ); - if (TYPO3_MODE === 'BE') { - $navigationComponentId = 'TYPO3/CMS/Backend/PageTree/PageTreeElement'; - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( - 'SgNews', - 'web', - 'News', - '', - [ - \SGalinski\SgNews\Controller\BackendController::class => 'index', - ], - [ - 'access' => 'user,group', - 'icon' => 'EXT:sg_news/Resources/Public/Icons/module-sgnews.svg', - 'labels' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang.xlf', - 'navigationComponentId' => $navigationComponentId - ] - ); - } + $navigationComponentId = 'TYPO3/CMS/Backend/PageTree/PageTreeElement'; + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( + 'SgNews', + 'web', + 'News', + '', + [ + \SGalinski\SgNews\Controller\BackendController::class => 'index', + ], + [ + 'access' => 'user,group', + 'icon' => 'EXT:sg_news/Resources/Public/Icons/module-sgnews.svg', + 'labels' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang.xlf', + 'navigationComponentId' => $navigationComponentId + ] + ); } );