Commit b8872ee4 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] ECS + Manual cleanup

parent 51364d49
......@@ -38,7 +38,6 @@ use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\TypoScriptAspect;
use TYPO3\CMS\Core\Http\StreamFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
......@@ -48,7 +47,6 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
* @package SGalinski\ContentReplacer\Middleware
*/
class ContentReplacerMiddleware implements MiddlewareInterface {
/**
* Extension Configuration
*
......@@ -169,7 +167,9 @@ class ContentReplacerMiddleware implements MiddlewareInterface {
$typoScriptFrontendController = $GLOBALS['TSFE'];
if (!($typoScriptFrontendController instanceof TypoScriptFrontendController)) {
$typoScriptFrontendController = $GLOBALS['TSFE'] = new TypoScriptFrontendController(
$GLOBALS['TYPO3_CONF_VARS'], 0, 0
$GLOBALS['TYPO3_CONF_VARS'],
0,
0
);
}
......
......@@ -25,11 +25,10 @@ namespace SGalinski\ContentReplacer\Repository;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
/**
* Repository for fetching terms
......@@ -49,7 +48,8 @@ class TermRepository {
$queryBuilder = $connectionPool->getQueryBuilderForTable('tx_content_replacer_term');
$queryBuilder->select(
'term.uid',
'term.pid', 'term',
'term.pid',
'term',
'replacement',
'stdWrap',
'category_uid',
......@@ -64,18 +64,21 @@ class TermRepository {
)->where(
$queryBuilder->expr()->andX(
$queryBuilder->expr()->in(
'term', $queryBuilder->createNamedParameter($filterTerms, Connection::PARAM_STR_ARRAY)
'term',
$queryBuilder->createNamedParameter($filterTerms, Connection::PARAM_STR_ARRAY)
),
$queryBuilder->expr()->in('term.sys_language_uid', [-1, 0]),
$queryBuilder->expr()->eq(
'category', $queryBuilder->createNamedParameter($category)
'category',
$queryBuilder->createNamedParameter($category)
)
)
);
if (count($storagePageIds) > 0) {
$queryBuilder->andWhere(
$queryBuilder->expr()->in(
'term.pid', $queryBuilder->createNamedParameter($storagePageIds, Connection::PARAM_INT_ARRAY)
'term.pid',
$queryBuilder->createNamedParameter($storagePageIds, Connection::PARAM_INT_ARRAY)
)
);
}
......@@ -92,7 +95,10 @@ class TermRepository {
// one single db call instead of looping through found default language records and fetching overlays
// for each of these separately
$term = $typoScriptFrontendController->sys_page->getRecordOverlay(
'tx_content_replacer_term', $term, $sysLanguageId, $sysLanguageOverlay
'tx_content_replacer_term',
$term,
$sysLanguageId,
$sysLanguageOverlay
);
}
......
<?php
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'content_replacer', 'Configuration/Typoscript/', 'Content Replacer'
'content_replacer',
'Configuration/Typoscript/',
'Content Replacer'
);
<?php
if (!defined('TYPO3')) {
die ('Access denied.');
die('Access denied.');
}
// Path to the localisation file
......@@ -67,8 +67,5 @@ $columns = [
],
],
];
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '10.3.0', '<')) {
$columns['interface']['showRecordFieldList'] = 'hidden, category, description';
}
return $columns;
<?php
if (!defined('TYPO3')) {
die ('Access denied.');
die('Access denied.');
}
// Path to the localisation file
......@@ -170,8 +170,5 @@ $columns = [
],
],
];
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '10.3.0', '<')) {
$columns['interface']['showRecordFieldList'] = 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, term, category_uid, stdWrap, replacement, description, starttime, endtime';
}
return $columns;
<?php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_content_replacer_category');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_content_replacer_term');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment