0) { // Get page record base on page uid $pageRecord = BackendUtility::getRecord('pages', $pageId, 'uid', " AND doktype='254' AND module='news'"); if (is_array($pageRecord)) { $tsConfig = BackendUtility::getPagesTSconfig($pageId); if ((int)($tsConfig['tx_news.']['showContentElementsInNewsSysFolder'] ?? 0) === 1) { return; } // Only hide elements which are inline, allowing for standard // elements to show $queryBuilder->andWhere( $queryBuilder->expr()->eq('tx_news_related_news', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)) ); if (self::$count === 0) { $this->addFlashMessage(); } self::$count++; } } } /** * Render flash message to inform user * that no elements belonging to news articles * are rendered in the page module * * @return void */ private function addFlashMessage(): void { $message = GeneralUtility::makeInstance( FlashMessage::class, $this->getLanguageService()->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:hiddenContentElements.description'), '', FlashMessage::INFO ); $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); $defaultFlashMessageQueue->enqueue($message); } /** * @return LanguageService */ protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } }