Initial commit - Typo3 11.5.41

This commit is contained in:
Matteo Gallo
2026-07-03 17:53:31 +02:00
commit 5ca4743197
6811 changed files with 568848 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
defined('TYPO3_MODE') or die();
// Override news icon
$GLOBALS['TCA']['pages']['columns']['module']['config']['items'][] = [
0 => 'LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:news-folder',
1 => 'news',
2 => 'apps-pagetree-folder-contains-news'
];
$GLOBALS['TCA']['pages']['columns']['module']['config']['items'][] = [
0 => 'LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:news-page',
1 => 'newsplugins',
2 => 'apps-pagetree-page-contains-news'
];
$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes']['contains-newsplugins'] = 'apps-pagetree-page-contains-news';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'news',
'Configuration/TSconfig/Page/news_only.tsconfig',
'EXT:news :: Restrict pages to news records'
);

View File

@@ -0,0 +1,198 @@
<?php
defined('TYPO3_MODE') or die();
$ll = 'LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:';
$configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\GeorgRinger\News\Domain\Model\Dto\EmConfiguration::class);
/**
* Add extra fields to the sys_category record
*/
$newSysCategoryColumns = [
'pid' => [
'label' => 'pid',
'config' => [
'type' => 'passthrough'
]
],
'sorting' => [
'label' => 'sorting',
'config' => [
'type' => 'passthrough'
]
],
'crdate' => [
'label' => 'crdate',
'config' => [
'type' => 'passthrough',
]
],
'tstamp' => [
'label' => 'tstamp',
'config' => [
'type' => 'passthrough',
]
],
'images' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'images',
[
'behaviour' => [
'allowLanguageSynchronization' => true,
],
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
'showPossibleLocalizationRecords' => true,
'showRemovedLocalizationRecords' => true,
'showAllLocalizationLink' => true,
'showSynchronizationLink' => true
],
'foreign_match_fields' => [
'fieldname' => 'images',
'tablenames' => 'sys_category',
'table_local' => 'sys_file',
],
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
)
],
'single_pid' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.single_pid',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => 1,
'maxitems' => 1,
'default' => 0,
'suggestOptions' => [
'default' => [
'searchWholePhrase' => true,
]
],
'behaviour' => [
'allowLanguageSynchronization' => true,
],
]
],
'shortcut' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.shortcut',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => 1,
'maxitems' => 1,
'default' => 0,
'suggestOptions' => [
'default' => [
'searchWholePhrase' => true,
]
],
'behaviour' => [
'allowLanguageSynchronization' => true,
],
]
],
'import_id' => [
'label' => $ll . 'tx_news_domain_model_news.import_id',
'config' => [
'type' => 'passthrough'
]
],
'import_source' => [
'label' => $ll . 'tx_news_domain_model_news.import_source',
'config' => [
'type' => 'passthrough'
]
],
'seo_headline' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.seo.seo_headline',
'config' => [
'type' => 'input',
],
],
'seo_title' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.seo.seo_title',
'config' => [
'type' => 'input',
],
],
'seo_description' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.seo.seo_description',
'config' => [
'type' => 'text',
],
],
'seo_text' => [
'exclude' => true,
'label' => $ll . 'tx_news_domain_model_category.seo.seo_text',
'config' => [
'type' => 'text',
'enableRichtext' => true,
],
],
'slug' =>[
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.slug',
'displayCond' => 'VERSION:IS:false',
'config' => [
'type' => 'slug',
'size' => 50,
'generatorOptions' => [
'fields' => ['title'],
'replacements' => [
'/' => '-'
],
],
'fallbackCharacter' => '-',
'eval' => $configuration->getSlugBehaviour(),
'default' => ''
]
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_category', $newSysCategoryColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'sys_category',
'--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.options, images',
'',
'before:description'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'sys_category',
'single_pid',
'',
'after:description'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'sys_category',
'shortcut',
'',
'after:single_pid'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'sys_category',
'--div--;' . $ll . 'tx_news_domain_model_category.tabs.seo, seo_title, seo_description, seo_headline, seo_text',
'',
'after:endtime'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'sys_category',
'slug',
'',
'after:title'
);
$GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage']['tx_news_domain_model_news']
= [0 => 'categories'];
$GLOBALS['TCA']['sys_category']['ctrl']['label_userFunc'] =
\GeorgRinger\News\Hooks\Labels::class . '->getUserLabelCategory';

View File

@@ -0,0 +1,33 @@
<?php
defined('TYPO3_MODE') or die();
$emConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\GeorgRinger\News\Domain\Model\Dto\EmConfiguration::class);
if ($emConfiguration->isAdvancedMediaPreview()) {
$fieldConfig = [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:tx_news_domain_model_media.showinviews.0', 0, ''],
['LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:tx_news_domain_model_media.showinviews.1', 1, ''],
['LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:tx_news_domain_model_media.showinviews.2', 2, ''],
],
'default' => 0,
];
} else {
$fieldConfig = [
'type' => 'check',
'default' => 0
];
}
$newSysFileReferenceColumns = [
'showinpreview' => [
'exclude' => true,
'label' => 'LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:tx_news_domain_model_media.showinviews',
'config' => $fieldConfig
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $newSysFileReferenceColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('sys_file_reference', 'newsPalette', 'showinpreview');

View File

@@ -0,0 +1,8 @@
<?php
defined('TYPO3_MODE') or die();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('news', 'Configuration/TypoScript', 'News');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('news', 'Configuration/TypoScript/Sitemap', 'News Sitemap');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('news', 'Configuration/TypoScript/Styles/Twb', 'News Styles Twitter Bootstrap');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('news', 'Configuration/TypoScript/Styles/Twb5', 'News Styles Twitter Bootstrap V5');

View File

@@ -0,0 +1,42 @@
<?php
defined('TYPO3_MODE') or die();
/***************
* Plugin
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'news',
'Pi1',
'LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:pi1_title'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['news_pi1'] = 'recursive,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['news_pi1'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'news_pi1',
'FILE:EXT:news/Configuration/FlexForms/flexform_news.xml'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords('tx_news_domain_model_news');
foreach (['crdate', 'tstamp'] as $fakeField) {
if (!isset($GLOBALS['TCA']['tt_content']['columns'][$fakeField])) {
$GLOBALS['TCA']['tt_content']['columns'][$fakeField] = [
'label' => $fakeField,
'config' => [
'type' => 'passthrough',
]
];
}
}
$newFields = [
'tx_news_related_news' => [
'label' => 'tx_news_related_news',
'config' => [
'type' => 'passthrough'
]
]
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $newFields);

View File

@@ -0,0 +1,69 @@
<?php
defined('TYPO3_MODE') or die();
$boot = static function (): void {
// Add seo sitemap fields
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('seo')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'tx_news_domain_model_news',
[
'sitemap_changefreq' => [
'config' => [
'items' => [
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.none', ''],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.always', 'always'],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.hourly', 'hourly'],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.daily', 'daily'],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.weekly', 'weekly'],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.monthly', 'monthly'],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.yearly', 'yearly'],
['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.never', 'never']
],
'renderType' => 'selectSingle',
'type' => 'select'
],
'exclude' => true,
'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq'
],
'sitemap_priority' => [
'config' => [
'items' => [
['0.0', '0.0'],
['0.1', '0.1'],
['0.2', '0.2'],
['0.3', '0.3'],
['0.4', '0.4'],
['0.5', '0.5'],
['0.6', '0.6'],
['0.7', '0.7'],
['0.8', '0.8'],
['0.9', '0.9'],
['1.0', '1.0']
],
'renderType' => 'selectSingle',
'type' => 'select',
'default' => '0.5',
],
'exclude' => true,
'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_priority'
]
]
);
$GLOBALS['TCA']['tx_news_domain_model_news']['palettes']['sitemap'] = [
'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.sitemap',
'showitem' => 'sitemap_changefreq,sitemap_priority'
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tx_news_domain_model_news',
'--palette--;;sitemap',
'',
'after:alternative_title'
);
}
};
$boot();
unset($boot);

View File

@@ -0,0 +1,25 @@
<?php
defined('TYPO3') or die();
call_user_func(static function () {
$versionInformation = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class);
if ($versionInformation->getMajorVersion() === 11) {
foreach (['link', 'news', 'tag'] as $tableSuffix) {
$GLOBALS['TCA']['tx_news_domain_model_' . $tableSuffix]['columns']['sys_language_uid']['config'] = [
'type' => 'language'
];
}
$showRemovedLocalizationRecordsFields = [
'sys_category' => ['images'],
'tx_news_domain_model_news' => ['related_links', 'content_elements', 'fal_media', 'fal_related_files']
];
foreach ($showRemovedLocalizationRecordsFields as $tableName => $fields) {
foreach ($fields as $field) {
unset($GLOBALS['TCA'][$tableName]['columns'][$field]['config']['appearance']['showRemovedLocalizationRecords']);
}
}
}
});