diff --git a/Classes/DataProcessing/.gitkeep b/Classes/DataProcessing/.gitkeep deleted file mode 100755 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/Classes/DataProcessing/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Classes/DataProcessing/MenuProcessor.php b/Classes/DataProcessing/MenuProcessor.php deleted file mode 100644 index 000a54da1cb5d31d0659cf1338ee6f401b2604ba..0000000000000000000000000000000000000000 --- a/Classes/DataProcessing/MenuProcessor.php +++ /dev/null @@ -1,489 +0,0 @@ - '[|]' - ]; - - /** - * @var array - */ - protected $menuLevelConfig = [ - 'doNotLinkIt' => '1', - 'wrapItemAndSub' => '{|}, |*| {|}, |*| {|}', - 'stdWrap.' => [ - 'cObject' => 'COA', - 'cObject.' => [ - '10' => 'USER', - '10.' => [ - 'userFunc' => 't3o\t3olayout\DataProcessing\MenuProcessor->getDataAsJson', - 'stdWrap.' => [ - 'wrap' => '"data":|' - ] - ], - '20' => 'TEXT', - '20.' => [ - 'field' => 'nav_title // title', - 'trim' => '1', - 'wrap' => ',"title":|', - 'preUserFunc' => 't3o\t3olayout\DataProcessing\MenuProcessor->jsonEncodeUserFunc' - ], - '21' => 'TEXT', - '21.' => [ - 'value' => self::LINK_PLACEHOLDER, - 'wrap' => ',"link":|', - ], - '22' => 'TEXT', - '22.' => [ - 'value' => self::TARGET_PLACEHOLDER, - 'wrap' => ',"target":|', - ], - '30' => 'TEXT', - '30.' => [ - 'value' => '0', - 'wrap' => ',"active":|' - ], - '40' => 'TEXT', - '40.' => [ - 'value' => '0', - 'wrap' => ',"current":|' - ], - '50' => 'TEXT', - '50.' => [ - 'value' => '0', - 'wrap' => ',"spacer":|' - ] - ] - ] - ]; - - /** - * @var array - */ - public $menuDefaults = [ - 'levels' => 1, - 'expandAll' => 1, - 'includeSpacer' => 0, - 'as' => 'menu', - 'titleField' => 'nav_title // title' - ]; - - /** - * @var int - */ - protected $menuLevels; - - /** - * @var int - */ - protected $menuExpandAll; - - /** - * @var int - */ - protected $menuIncludeSpacer; - - /** - * @var string - */ - protected $menuTitleField; - - /** - * @var string - */ - protected $menuTargetVariableName; - - /** - * @var ContentDataProcessor - */ - protected $contentDataProcessor; - - /** - * Constructor - */ - public function __construct() - { - $this->contentDataProcessor = GeneralUtility::makeInstance(ContentDataProcessor::class); - } - - /** - * Get configuration value from processorConfiguration - * - * @param string $key - * @return string - */ - protected function getConfigurationValue($key) - { - return $this->cObj->stdWrapValue($key, $this->processorConfiguration, $this->menuDefaults[$key]); - } - - /** - * Validate configuration - * - * @throws \InvalidArgumentException - */ - public function validateConfiguration() - { - $invalidArguments = []; - foreach ($this->processorConfiguration as $key => $value) { - if (!in_array($key, $this->allowedConfigurationKeys)) { - $invalidArguments[str_replace('.', '', $key)] = $key; - } - } - if (!empty($invalidArguments)) { - throw new \InvalidArgumentException('MenuProcessor Configuration contains invalid Arguments: ' . implode(', ', $invalidArguments), 1478806566); - } - } - - /** - * Prepare Configuration - */ - public function prepareConfiguration() - { - $this->menuConfig += $this->processorConfiguration; - // Filter configuration - foreach ($this->menuConfig as $key => $value) { - if (in_array($key, $this->removeConfigurationKeysForHmenu)) { - unset($this->menuConfig[$key]); - } - } - // Process special value - if (isset($this->menuConfig['special.']['value.'])) { - $this->menuConfig['special.']['value'] = $this->cObj->stdWrap($this->menuConfig['special.']['value'], $this->menuConfig['special.']['value.']); - unset($this->menuConfig['special.']['value.']); - } - } - - /** - */ - public function prepareLevelConfiguration() - { - $this->menuLevelConfig['stdWrap.']['cObject.'] = array_replace_recursive( - $this->menuLevelConfig['stdWrap.']['cObject.'], - [ - '20.' => [ - 'field' => $this->menuTitleField, - ] - ] - ); - } - - /** - */ - public function prepareLevelLanguageConfiguration() - { - if ($this->menuConfig['special'] === 'language') { - $this->menuLevelConfig['stdWrap.']['cObject.'] = array_replace_recursive( - $this->menuLevelConfig['stdWrap.']['cObject.'], - [ - '60' => 'TEXT', - '60.' => [ - 'value' => '1', - 'wrap' => ',"available":|' - ], - '70' => 'TEXT', - '70.' => [ - 'value' => $this->menuConfig['special.']['value'], - 'listNum.' => [ - 'stdWrap.' => [ - 'data' => 'register:count_HMENU_MENUOBJ', - 'wrap' => '|-1' - ], - 'splitChar' => ',' - ], - 'wrap' => ',"languageUid":"|"' - ] - ] - ); - } - } - - /** - */ - public function buildConfiguration() - { - for ($i = 1; $i <= $this->menuLevels; $i++) { - $this->menuConfig[$i] = 'TMENU'; - $this->menuConfig[$i . '.']['IProcFunc'] = 't3o\t3olayout\DataProcessing\MenuProcessor->replacePlaceholderInRenderedMenuItem'; - if ($i > 1) { - $this->menuConfig[$i . '.']['stdWrap.']['wrap'] = ',"children": [|]'; - } - $this->menuConfig[$i . '.']['expAll'] = $this->menuExpandAll; - $this->menuConfig[$i . '.']['NO'] = '1'; - $this->menuConfig[$i . '.']['NO.'] = $this->menuLevelConfig; - if ($this->menuIncludeSpacer) { - $this->menuConfig[$i . '.']['SPC'] = '1'; - $this->menuConfig[$i . '.']['SPC.'] = $this->menuConfig[$i . '.']['NO.']; - $this->menuConfig[$i . '.']['SPC.']['stdWrap.']['cObject.']['50.']['value'] = '1'; - } - $this->menuConfig[$i . '.']['IFSUB'] = '1'; - $this->menuConfig[$i . '.']['IFSUB.'] = $this->menuConfig[$i . '.']['NO.']; - $this->menuConfig[$i . '.']['ACT'] = '1'; - $this->menuConfig[$i . '.']['ACT.'] = $this->menuConfig[$i . '.']['NO.']; - $this->menuConfig[$i . '.']['ACT.']['stdWrap.']['cObject.']['30.']['value'] = '1'; - $this->menuConfig[$i . '.']['ACTIFSUB'] = '1'; - $this->menuConfig[$i . '.']['ACTIFSUB.'] = $this->menuConfig[$i . '.']['ACT.']; - $this->menuConfig[$i . '.']['CUR'] = '1'; - $this->menuConfig[$i . '.']['CUR.'] = $this->menuConfig[$i . '.']['ACT.']; - $this->menuConfig[$i . '.']['CUR.']['stdWrap.']['cObject.']['40.']['value'] = '1'; - $this->menuConfig[$i . '.']['CURIFSUB'] = '1'; - $this->menuConfig[$i . '.']['CURIFSUB.'] = $this->menuConfig[$i . '.']['CUR.']; - if ($this->menuConfig['special'] === 'language') { - $this->menuConfig[$i . '.']['USERDEF1'] = $this->menuConfig[$i . '.']['NO']; - $this->menuConfig[$i . '.']['USERDEF1.'] = $this->menuConfig[$i . '.']['NO.']; - $this->menuConfig[$i . '.']['USERDEF1.']['stdWrap.']['cObject.']['60.']['value'] = '0'; - $this->menuConfig[$i . '.']['USERDEF2'] = $this->menuConfig[$i . '.']['ACT']; - $this->menuConfig[$i . '.']['USERDEF2.'] = $this->menuConfig[$i . '.']['ACT.']; - $this->menuConfig[$i . '.']['USERDEF2.']['stdWrap.']['cObject.']['60.']['value'] = '0'; - } - } - } - - /** - * @param ContentObjectRenderer $cObj The data of the content element or page - * @param array $contentObjectConfiguration The configuration of Content Object - * @param array $processorConfiguration The configuration of this processor - * @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View) - * @return array the processed data as key/value store - */ - public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData) - { - $this->cObj = $cObj; - $this->processorConfiguration = $processorConfiguration; - - // Get Configuration - $this->menuLevels = (int)$this->getConfigurationValue('levels') ?: 1; - $this->menuExpandAll = (int)$this->getConfigurationValue('expandAll'); - $this->menuIncludeSpacer = (int)$this->getConfigurationValue('includeSpacer'); - $this->menuTargetVariableName = $this->getConfigurationValue('as'); - $this->menuTitleField = $this->getConfigurationValue('titleField'); - - // Validate Configuration - $this->validateConfiguration(); - - // Build Configuration - $this->prepareConfiguration(); - $this->prepareLevelConfiguration(); - $this->prepareLevelLanguageConfiguration(); - $this->buildConfiguration(); - - // Process Configuration - $menuContentObject = $cObj->getContentObject('HMENU'); - $renderedMenu = $menuContentObject->render($this->menuConfig); - if (!$renderedMenu) { - return $processedData; - } - - // Process menu - $menu = json_decode($renderedMenu, true); - $processedMenu = []; - - foreach ($menu as $key => $page) { - $processedMenu[$key] = $this->processAdditionalDataProcessors($page, $processorConfiguration); - } - - // Return processed data - $processedData[$this->menuTargetVariableName] = $processedMenu; - return $processedData; - } - - /** - * Process additional data processors - * - * @param array $page - * @param array $processorConfiguration - */ - protected function processAdditionalDataProcessors($page, $processorConfiguration) - { - if (is_array($page['children'])) { - foreach ($page['children'] as $key => $item) { - $page['children'][$key] = $this->processAdditionalDataProcessors($item, $processorConfiguration); - } - } - /** @var ContentObjectRenderer $recordContentObjectRenderer */ - $recordContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class); - $recordContentObjectRenderer->start($page['data'], 'pages'); - $processedPage = $this->contentDataProcessor->process($recordContentObjectRenderer, $processorConfiguration, $page); - return $processedPage; - } - - /** - * Gets the data of the current record in JSON format - * - * @return string JSON encoded data - */ - public function getDataAsJson() - { - return $this->jsonEncode($this->cObj->data); - } - - /** - * This UserFunc encodes the content as Json - * - * @param string $content - * @param array $conf - * @return string JSON encoded content - */ - public function jsonEncodeUserFunc($content, $conf) - { - $content = $this->jsonEncode($content); - return $content; - } - - /** - * JSON Encode - * - * @param mixed $value - * @return string - */ - public function jsonEncode($value) - { - return json_encode($value, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE); - } - - /** - * This UserFunc gets the link and the target - * - * @param array $menuItem - * @param array $conf - */ - public function replacePlaceholderInRenderedMenuItem($menuItem, $conf) - { - $link = $this->jsonEncode($menuItem['linkHREF']['HREF']); - $target = $this->jsonEncode($menuItem['linkHREF']['TARGET']); - - $menuItem['parts']['title'] = str_replace(self::LINK_PLACEHOLDER, $link, $menuItem['parts']['title']); - $menuItem['parts']['title'] = str_replace(self::TARGET_PLACEHOLDER, $target, $menuItem['parts']['title']); - - return $menuItem; - } -} diff --git a/Classes/Domain/.gitkeep b/Classes/Domain/.gitkeep deleted file mode 100755 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/Classes/Domain/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Classes/Domain/Model/.gitkeep b/Classes/Domain/Model/.gitkeep deleted file mode 100755 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/Classes/Domain/Model/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Classes/Domain/Repository/.gitkeep b/Classes/Domain/Repository/.gitkeep deleted file mode 100755 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/Classes/Domain/Repository/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Classes/ViewHelpers/.gitkeep b/Classes/ViewHelpers/.gitkeep deleted file mode 100755 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/Classes/ViewHelpers/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext_localconf.php b/ext_localconf.php index b6ed722219d9e478365553512bb5f40d0c145e41..11be76db8be9eba459082c4f4f7a2b12818f67d2 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -24,21 +24,6 @@ SETUP { }' ); -if (class_exists('T3o\T3olayout\Hooks\MultiContentPreviewRenderer')) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][] = \T3o\T3olayout\Hooks\MultiContentPreviewRenderer::class; -} - -/*************** - * Set alias for menu processor as fallback if the core menu - * processor does not exist for TYPO3 Versions below 8.5 - */ -if (!class_exists('TYPO3\CMS\Frontend\DataProcessing\MenuProcessor')) { - class_alias( - \T3o\T3olayout\DataProcessing\MenuProcessor::class, - 'TYPO3\CMS\Frontend\DataProcessing\MenuProcessor' - ); -} - unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['textmedia']); $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['custom'] = 'EXT:t3olayout/Configuration/Yaml/Rte/Custom.yaml'; @@ -47,6 +32,6 @@ $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['nolink'] = 'EXT:t3olayout/Configu $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['backend']['loginBackgroundImage'] = 'EXT:t3olayout/Resources/Public/Images/login_background.jpg'; // Deactivate deprecation log for stage and production -if (\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext() !== 'Development') { +if (\TYPO3\CMS\Core\Core\Environment::getContext()->isProduction() || \TYPO3\CMS\Core\Core\Environment::getContext()->isTesting()) { $GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['deprecations']['writerConfiguration'][\TYPO3\CMS\Core\Log\LogLevel::NOTICE] = []; }