Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DMKEBUSINESSGMBH/typo3-mktools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.0
Choose a base ref
...
head repository: DMKEBUSINESSGMBH/typo3-mktools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 12.4
Choose a head ref
Loading
Showing with 9,152 additions and 7,738 deletions.
  1. +172 −0 .github/workflows/phpci.yml
  2. +41 −0 .github/workflows/release.yml
  3. +4 −0 .gitignore
  4. +30 −0 .php-cs-fixer.php
  5. +73 −0 Classes/Action/Ajax/ContentRendererAction.php
  6. +22 −27 action/class.tx_mktools_action_FlashMessage.php → Classes/Action/FlashMessageAction.php
  7. +56 −42 action/class.tx_mktools_action_DocMarkDown.php → Classes/Action/MarkdownAction.php
  8. +101 −0 Classes/Action/ShowTemplateAction.php
  9. +52 −0 Classes/Action/TyposcriptLibraryAction.php
  10. +0 −140 Classes/Cli/FindUnusedLocallangLabels.php
  11. +192 −0 Classes/Command/MigrateFormFinishersCommand.php
  12. +77 −0 Classes/Command/MigrateRealurlAliasToSlugCommand.php
  13. +284 −0 Classes/Command/MigrateSwitchableControllerActionsCommand.php
  14. +191 −0 Classes/Command/MigrateTcaFileGroupToFalCommand.php
  15. +151 −0 Classes/Command/MigrateTscobjPluginsCommand.php
  16. +77 −0 Classes/Command/SlugCreatorCommand.php
  17. +89 −0 Classes/ContentObject/LoadPluginWithAjaxTrait.php
  18. +48 −0 Classes/ContentObject/UserContentObject.php
  19. +48 −0 Classes/ContentObject/UserInternalContentObject.php
  20. +43 −49 util/class.tx_mktools_util_ErrorHandler.php → Classes/ErrorHandler/ErrorHandler.php
  21. +293 −0 Classes/ErrorHandler/ExceptionHandler.php
  22. +68 −0 Classes/ErrorHandler/ThrowableExceptionHandler.php
  23. +6 −7 util/class.tx_mktools_util_ErrorException.php → Classes/Exception/ExceptionInterface.php
  24. +6 −18 model/class.tx_mktools_model_FixedPostVarType.php → Classes/Exception/InvalidArgumentException.php
  25. +30 −0 Classes/Exception/LogicException.php
  26. +30 −0 Classes/Exception/RuntimeException.php
  27. +64 −0 Classes/Middleware/ContentReplacer.php
  28. +67 −0 Classes/Middleware/TypeParameterFromPost.php
  29. +123 −0 Classes/Routing/Aspect/StaticNumberRangeMapper.php
  30. +82 −0 Classes/Routing/Enhancer/PageTypeDecorator.php
  31. +64 −0 Classes/Seo/XmlSitemap/PagesDataProvider.php
  32. +70 −73 util/class.tx_mktools_util_FlashMessage.php → Classes/Session/FlashMessageStorage.php
  33. +158 −0 Classes/Updates/MigrateOldMktoolsPlugins.php
  34. +82 −0 Classes/Utility/CacheUtility.php
  35. +20 −14 util/class.tx_mktools_util_Composer.php → Classes/Utility/ComposerUtility.php
  36. +74 −0 Classes/Utility/ContentReplacerUtility.php
  37. +258 −0 Classes/Utility/Menu/Processor/TranslatedRecords.php
  38. +123 −0 Classes/Utility/Misc.php
  39. +35 −29 util/class.tx_mktools_util_SeoRobotsMetaTag.php → Classes/Utility/SeoRobotsMetaTagUtility.php
  40. +139 −0 Classes/Utility/SessionUtility.php
  41. +160 −0 Classes/Utility/SlugUtility.php
  42. +67 −0 Classes/Utility/T3Loader.php
  43. +50 −0 Classes/View/ShowTemplate.php
  44. +106 −0 Configuration/Flexform/Main.xml
  45. +14 −14 flexform_main.xml → Configuration/Flexform/MainDeprecated.xml
  46. +18 −0 Configuration/RequestMiddlewares.php
  47. +49 −0 Configuration/Services.yaml
  48. +16 −53 Configuration/TCA/Overrides/pages.php
  49. +19 −0 Configuration/TCA/Overrides/sys_template.php
  50. +39 −0 Configuration/TCA/Overrides/tt_content.php
  51. +0 −40 Configuration/TCA/Overrides/tt_news.php
  52. +0 −23 Configuration/TCA/Overrides/tx_cal_event.php
  53. +0 −61 Configuration/TCA/tx_mktools_fixedpostvartypes.php
  54. +44 −32 Configuration/TypoScript/action/setup.txt
  55. +0 −15 Configuration/TypoScript/cal/setup.txt
  56. +9 −8 Configuration/TypoScript/contentmodal/setup.txt
  57. +30 −12 Configuration/TypoScript/contentrenderer/setup.txt
  58. +4 −0 Configuration/TypoScript/contentreplacer/setup.txt
  59. +2 −2 Configuration/TypoScript/onsiteseo/setup.txt
  60. +0 −40 Configuration/TypoScript/pagenotfoundhandling/setup.txt
  61. +4 −1 Configuration/TypoScript/seorobotsmetatag/constants.txt
  62. +9 −5 Configuration/TypoScript/seorobotsmetatag/setup.txt
  63. +0 −5 Configuration/TypoScript/tsbasic/constants.txt
  64. +0 −35 Configuration/TypoScript/tsbasic/setup.txt
  65. +0 −8 Configuration/TypoScript/tsbasic/tsconfig.txt
  66. +0 −28 Configuration/TypoScript/tt_news/setup.txt
  67. +296 −0 Documentation/Changelog.md
  68. +74 −2 Documentation/Utilities/AjaxContentRenderer/Index.md
  69. +0 −14 Documentation/Utilities/CLI/Index.md
  70. +4 −0 Documentation/Utilities/Cache/Index.md
  71. +3 −8 Documentation/Utilities/ErrorHandling/Index.md
  72. +18 −0 Documentation/Utilities/Extbase/Index.md
  73. +0 −108 Documentation/Utilities/FAL/Index.md
  74. +14 −0 Documentation/Utilities/Forms/Index.md
  75. +9 −7 Documentation/Utilities/Index.md
  76. +0 −108 Documentation/Utilities/PageNotFoundHandling/Index.md
  77. +0 −117 Documentation/Utilities/Realurl/FixedPostVars/Index.md
  78. +0 −6 Documentation/Utilities/Realurl/Index.md
  79. +0 −16 Documentation/Utilities/Realurl/Index.rst
  80. +0 −51 Documentation/Utilities/Realurl/PostVarSets/Index.md
  81. +11 −0 Documentation/Utilities/RobotsMetaTag/Index.md
  82. +51 −0 Documentation/Utilities/Slugs/Index.md
  83. +24 −0 Documentation/Utilities/TCAMigrations/Index.md
  84. +0 −14 Documentation/Utilities/TcaOverrides/Index.md
  85. +85 −0 Documentation/Utilities/TranslatedRecords/Index.md
  86. +27 −3 Documentation/Utilities/Views/Index.md
  87. +7 −8 README.md
  88. +8 −0 Resources/Private/Language/de.locallang_db.xlf
  89. +122 −0 Resources/Private/Language/locallang.xlf
  90. +44 −0 Resources/Private/Language/locallang_db.xlf
  91. +4 −8 Resources/Private/PHP/ATTENTION.md
  92. +1 −1 Resources/Private/PHP/Composer/autoload.php
  93. +191 −32 Resources/Private/PHP/Composer/composer/ClassLoader.php
  94. +350 −0 Resources/Private/PHP/Composer/composer/InstalledVersions.php
  95. +21 −0 Resources/Private/PHP/Composer/composer/LICENSE
  96. +1 −1 Resources/Private/PHP/Composer/composer/autoload_classmap.php
  97. +1 −0 Resources/Private/PHP/Composer/composer/autoload_namespaces.php
  98. +26 −19 Resources/Private/PHP/Composer/composer/autoload_real.php
  99. +35 −0 Resources/Private/PHP/Composer/composer/autoload_static.php
  100. +112 −42 Resources/Private/PHP/Composer/composer/installed.json
  101. +41 −0 Resources/Private/PHP/Composer/composer/installed.php
  102. +26 −0 Resources/Private/PHP/Composer/composer/platform_check.php
  103. +30 −0 Resources/Private/PHP/Composer/erusev/parsedown-extra/.travis.yml
  104. +20 −0 Resources/Private/PHP/Composer/erusev/parsedown-extra/LICENSE.txt
  105. +538 −0 Resources/Private/PHP/Composer/erusev/parsedown-extra/ParsedownExtra.php
  106. +31 −0 Resources/Private/PHP/Composer/erusev/parsedown-extra/README.md
  107. +33 −0 Resources/Private/PHP/Composer/erusev/parsedown-extra/composer.json
  108. +8 −0 Resources/Private/PHP/Composer/erusev/parsedown-extra/phpunit.xml.dist
  109. +0 −10 Resources/Private/PHP/Composer/erusev/parsedown/.travis.yml
  110. +2 −2 Resources/Private/PHP/Composer/erusev/parsedown/LICENSE.txt
  111. +742 −460 Resources/Private/PHP/Composer/erusev/parsedown/Parsedown.php
  112. +60 −17 Resources/Private/PHP/Composer/erusev/parsedown/README.md
  113. +16 −1 Resources/Private/PHP/Composer/erusev/parsedown/composer.json
  114. +0 −8 Resources/Private/PHP/Composer/erusev/parsedown/phpunit.xml.dist
  115. +8 −7 Resources/Private/PHP/composer.json
  116. +71 −8 Resources/Private/PHP/composer.lock
  117. +31 −0 Resources/Public/Icons/Extension.svg
  118. +35 −9 Resources/Public/JavaScript/AjaxContent.js
  119. +2 −2 Resources/Public/JavaScript/Location.js
  120. +10 −1 Resources/Public/JavaScript/ModalBootstrap.js
  121. +57 −16 Resources/Public/JavaScript/Request.js
  122. +194 −0 Tests/Classes/ContentObject/UserContentObjectTest.php
  123. +191 −0 Tests/Classes/ContentObject/UserInternalContentObjectTest.php
  124. +110 −0 Tests/Classes/Routing/Aspect/StaticNumberRangeMapperTest.php
  125. +103 −0 Tests/Classes/Routing/Enhancer/PageTypeDecoratorTest.php
  126. +85 −0 Tests/Classes/Seo/XmlSitemap/PagesDataProviderTest.php
  127. +278 −0 Tests/Classes/Utility/CacheUtilityTest.php
  128. +97 −0 Tests/Classes/Utility/Menu/Processor/TranslatedRecordsTest.php
  129. +113 −0 Tests/class.tx_mktools_tests_BaseTestCase.php
  130. 0 {tests → Tests}/fixtures/empty
  131. 0 {tests → Tests}/fixtures/html/utilPageNotFoundHandlingPrintContent.html
  132. 0 {tests → Tests}/fixtures/html/utilPageNotFoundHandlingPrintContentForCode4.html
  133. 0 {tests → Tests}/fixtures/searchFolders/1/file.txt
  134. 0 {tests → Tests}/fixtures/searchFolders/2/file.txt
  135. 0 {tests → Tests}/fixtures/typoscript/errorHandling.txt
  136. 0 {tests → Tests}/fixtures/typoscript/miscTools1.txt
  137. 0 {tests → Tests}/fixtures/typoscript/miscTools2.txt
  138. 0 {tests → Tests}/fixtures/xml/pages.xml
  139. +54 −62 ...ests_util_ErrorHandler_testcase.php → Tests/util/class.tx_mktools_tests_util_ErrorHandlerTest.php
  140. +84 −72 ...l_ExceptionHandler_testcase.php → Tests/util/class.tx_mktools_tests_util_ExceptionHandlerTest.php
  141. +33 −35 ...l_SeoRobotsMetaTag_testcase.php → Tests/util/class.tx_mktools_tests_util_SeoRobotsMetaTagTest.php
  142. +88 −0 Tests/util/class.tx_mktools_tests_util_miscToolsTest.php
  143. +0 −77 action/ajax/class.tx_mktools_action_ajax_ContentRenderer.php
  144. +0 −104 action/class.tx_mktools_action_ShowTemplate.php
  145. +0 −54 action/class.tx_mktools_action_TsLib.php
  146. +123 −15 composer.json
  147. +0 −18 ext_autoload.php
  148. +4 −28 ext_conf_template.txt
  149. +14 −17 ext_emconf.php
  150. BIN ext_icon.gif
  151. +47 −60 ext_localconf.php
  152. +0 −64 ext_tables.php
  153. +2 −27 ext_tables.sql
  154. +0 −64 hook/class.tx_mktools_hook_BrowseLinks.php
  155. +0 −145 hook/class.tx_mktools_hook_ContentReplace.php
  156. +0 −105 hook/class.tx_mktools_hook_GeneralUtility.php
  157. +0 −73 hook/extTables/class.tx_mktools_hook_extTables_PostProcessing.php
  158. +0 −76 locallang.xml
  159. +0 −37 locallang_db.xml
  160. +0 −66 model/class.tx_mktools_model_Pages.php
  161. +34 −0 phpstan.neon
  162. +15 −0 phpunit.xml.dist
  163. +0 −78 scheduler/class.tx_mktools_scheduler_GenerateRealUrlConfigurationFile.php
  164. +0 −10 scheduler/ext_localconf.php
  165. +0 −122 tests/Classes/Cli/FindUnusedLocallangLabels_testcase.php
  166. +0 −83 tests/fixtures/classes/util/class.tx_mktools_tests_fixtures_classes_util_PageNotFoundHandling.php
  167. +0 −5 tests/fixtures/expectedRealUrlConfig.php
  168. +0 −5 tests/fixtures/expectedRealUrlConfig2.php
  169. +0 −5 tests/fixtures/expectedRealUrlConfig3.php
  170. +0 −6 tests/fixtures/realUrlConfigTemplate.php
  171. +0 −7 tests/fixtures/realUrlConfigTemplate2.php
  172. +0 −6 tests/fixtures/realUrlConfigTemplate3.php
  173. +0 −19 tests/fixtures/typoscript/utilPageNotFoundHandlingPrintContent.txt
  174. +0 −21 tests/fixtures/typoscript/utilPageNotFoundHandlingRedirect.txt
  175. +0 −17 tests/fixtures/xml/locallang.xml
  176. +0 −95 tests/hook/class.tx_mktools_tests_hook_BrowseLinks_testcase.php
  177. +0 −305 tests/hook/class.tx_mktools_tests_hook_GeneralUtility_testcase.php
  178. +0 −287 tests/hook/extTables/class.tx_mktools_tests_hook_extTables_PostProcessing_testcase.php
  179. +0 −59 tests/model/class.tx_mktools_tests_model_Pages_testcase.php
  180. +0 −13 tests/phpunit.xml
  181. +0 −198 tests/scheduler/class.tx_mktools_tests_scheduler_GenerateRealUrlConfigurationFile_testcase.php
  182. +0 −392 tests/util/class.tx_mktools_tests_util_PageNotFoundHandling_testcase.php
  183. +0 −858 tests/util/class.tx_mktools_tests_util_RealUrl_testcase.php
  184. +0 −235 tests/util/class.tx_mktools_tests_util_miscTools_testcase.php
  185. +0 −386 util/class.tx_mktools_util_ExceptionHandler.php
  186. +0 −567 util/class.tx_mktools_util_PageNotFoundHandling.php
  187. +0 −352 util/class.tx_mktools_util_RealUrl.php
  188. +0 −67 util/class.tx_mktools_util_T3Loader.php
  189. +0 −199 util/class.tx_mktools_util_miscTools.php
  190. +0 −36 view/class.tx_mktools_view_ShowTemplate.php
  191. +0 −68 xclasses/class.ux_tslib_fe.php
  192. +0 −151 xclasses/class.ux_tx_realurl.php
172 changes: 172 additions & 0 deletions .github/workflows/phpci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: "PHP-CI"

on:
push:
pull_request:
schedule:
- cron: "30 6 * * 1"

env:
PHP_EXTENSIONS: "intl, mbstring, json, zip, curl"

jobs:

php-lint:
name: "PHP Lint"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"

steps:
-
name: "Checkout"
uses: "actions/checkout@v2"
-
name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
-
name: "Validate composer.json and composer.lock"
run: "composer validate --strict"
-
name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
-
name: "Cache dependencies installed with composer"
uses: "actions/cache@v2.0.0"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
-
name: "Install composer dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"
-
name: "Run Linter"
run: "composer lint:php"

php-qs:
name: "PHP QS"

runs-on: "ubuntu-latest"

needs: "php-lint"

strategy:
matrix:
command:
- "test:phpcs"
- "test:phpcompatibility"
- "test:phpstan"
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"

steps:
-
name: "Checkout"
uses: "actions/checkout@v2"
-
name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
-
name: "Validate composer.json and composer.lock"
run: "composer validate --strict"
-
name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
-
name: "Cache dependencies installed with composer"
uses: "actions/cache@v2.0.0"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
-
name: "Install composer dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"
-
name: "Run command"
run: "composer ${{ matrix.command }}"


php-unit:
name: "PHP Unit"

runs-on: "ubuntu-latest"

needs: ["php-lint", "php-qs"]

strategy:
fail-fast: false
matrix:
include:
- typo3-version: "^11.5"
php-version: "7.4"
- typo3-version: "^11.5"
php-version: "8.0"
- typo3-version: "^11.5"
php-version: "8.1"
- typo3-version: "^11.5"
php-version: "8.2"
- typo3-version: "^11.5"
php-version: "8.3"
- typo3-version: "^12.4"
php-version: "8.1"
- typo3-version: "^12.4"
php-version: "8.2"
- typo3-version: "^12.4"
php-version: "8.3"

steps:
-
name: "Checkout"
uses: "actions/checkout@v2"
-
name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
-
name: "Validate composer.json and composer.lock"
run: "composer validate --strict"
-
name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
-
name: "Cache dependencies installed with composer"
uses: "actions/cache@v2.0.0"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
-
name: "Install composer dependencies"
run: |
composer remove --no-update typo3/cms typo3/cms-core
composer require typo3/minimal:"${{ matrix.typo3-version }}"
-
name: "Run PHP unit tests"
run: "composer test:phpunit"


41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: TER release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
name: TYPO3 TER release

if: startsWith(github.ref, 'refs/tags/')

runs-on: ubuntu-20.04

env:
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get version
id: get-version
run: echo ::set-output name=version::$(echo "${{ github.event.ref }}" | cut -d 'v' -f 2)

- name: Get comment
id: get-comment
run: echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }}. Check changelog in documentation on github for more information.

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: intl, mbstring, json, zip, curl

- name: Install tailor
run: composer global require typo3/tailor --prefer-dist --no-progress

- name: Publish to TER
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/.settings
/.buildpath
/.project
/.Build
/.php-cs-fixer.cache
/.phpunit.result.cache
/composer.lock
30 changes: 30 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('Resources')
->exclude('Documentation')
->exclude('tests/fixtures')
->in(__DIR__)
;

$config = new \PhpCsFixer\Config();

return $config
->setFinder($finder)
->setRules([
'@PSR12' => true,
'@Symfony' => true,
'phpdoc_align' => false,
'no_superfluous_phpdoc_tags' => false,
'fully_qualified_strict_types' => false,
'trailing_comma_in_multiline' => [
'after_heredoc' => true,
// no support for "arguments" and "parameters" as we need support for PHP 7.4
'elements' => [
'array_destructuring',
'arrays',
'match',
],
],
])
->setLineEnding("\n");
73 changes: 73 additions & 0 deletions Classes/Action/Ajax/ContentRendererAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

namespace DMK\Mktools\Action\Ajax;

/***************************************************************
* Copyright notice
*
* (c) 2021 DMK E-BUSINESS GmbH <dev@dmk-ebusiness.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

use DMK\Mktools\Utility\T3Loader;
use Sys25\RnBase\Frontend\Request\Parameters;
use Sys25\RnBase\Utility\TYPO3;
use TYPO3\CMS\Core\Utility\HttpUtility;

/**
* Action zum Rendern von ContentElementen.
*
* @author Michael Wagner
*/
class ContentRendererAction
{
/**
* Entry point.
*/
public function renderContent()
{
// content id auslesen
$contentId = (int) Parameters::getPostOrGetParameter('contentid');

if (0 === $contentId) {
$this->sendNotFoundHeader();
}

$ttContent = TYPO3::getSysPage()->checkRecord('tt_content', $contentId);
$cObj = T3Loader::getContentObject($contentId);

// jetzt das contentelement parsen
$cObj->start($ttContent, 'tt_content');
$content = $cObj->cObjGetSingle('<tt_content', []);
$content = trim($content);

if (empty($content)) {
// Exception
$this->sendNotFoundHeader();
}

return $content;
}

protected function sendNotFoundHeader(): void
{
header(HttpUtility::HTTP_STATUS_404);
exit;
}
}
Loading