Skip to content
Snippets Groups Projects
Commit 77e580bf authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Fix deprecated usage of the sprite manager

parent 5e038abb
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,13 @@ TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( ...@@ -33,6 +33,13 @@ TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titlePageBrowserPlugin' 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titlePageBrowserPlugin'
); );
// Removal of the unused plugin setting fields
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_overview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_listbycategory'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_latest'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_singleview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_pagebrowser'] = 'select_key,pages,recursive';
// Flex form assignment // Flex form assignment
$pluginSignature = str_replace('_', '', 'sg_news') . '_overview'; $pluginSignature = str_replace('_', '', 'sg_news') . '_overview';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; $TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
...@@ -52,18 +59,21 @@ $TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_ ...@@ -52,18 +59,21 @@ $TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_
$pluginSignature, 'FILE:EXT:sg_news/Configuration/FlexForms/Latest.xml' $pluginSignature, 'FILE:EXT:sg_news/Configuration/FlexForms/Latest.xml'
); );
// Define the new doktypes
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$relativeExtensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sg_news');
################################### ###################################
### Define the Category Doktype ### ### Define the Category Doktype ###
################################### ###################################
$relativeExtensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sg_news');
$customPageDoktype = 117; $customPageDoktype = 117;
$customPageIcon = $relativeExtensionPath . 'Resources/Public/Images/Category.png';
// add the new doktype to the list of page types // add the new doktype to the list of page types
$GLOBALS['PAGES_TYPES'][$customPageDoktype] = [ $GLOBALS['PAGES_TYPES'][$customPageDoktype] = [
'type' => 'sys', 'type' => 'sys',
'icon' => $customPageIcon, 'icon' => 'EXT:sg_news/Resources/Public/Images/Category.png',
'allowedTables' => '*', 'allowedTables' => '*',
]; ];
...@@ -71,18 +81,23 @@ $GLOBALS['PAGES_TYPES'][$customPageDoktype] = [ ...@@ -71,18 +81,23 @@ $GLOBALS['PAGES_TYPES'][$customPageDoktype] = [
$GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'][] = [ $GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'][] = [
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.category', 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.category',
$customPageDoktype, $customPageDoktype,
$customPageIcon 'EXT:sg_news/Resources/Public/Images/Category.png'
]; ];
// also add the new doktype to the page language overlays type selector (so that translations can inherit the same type) // also add the new doktype to the page language overlays type selector (so that translations can inherit the same type)
$GLOBALS['TCA']['pages_language_overlay']['columns']['doktype']['config']['items'][] = [ $GLOBALS['TCA']['pages_language_overlay']['columns']['doktype']['config']['items'][] = [
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.category', 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.category',
$customPageDoktype, $customPageDoktype,
$customPageIcon 'EXT:sg_news/Resources/Public/Images/Category.png'
]; ];
// add the sprite icon for the new doktype // register new icon
\TYPO3\CMS\Backend\Sprite\SpriteManager::addTcaTypeIcon('pages', $customPageDoktype, $customPageIcon); $iconRegistry->registerIcon(
'tcarecords-pages-' . $customPageDoktype,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => 'EXT:sg_news/Resources/Public/Images/Category.png']
);
$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$customPageDoktype] = 'tcarecords-pages-' . $customPageDoktype;
// add the new doktype to the list of types available from the new page menu at the top of the page tree // add the new doktype to the list of types available from the new page menu at the top of the page tree
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(
...@@ -93,14 +108,12 @@ $GLOBALS['TCA']['pages_language_overlay']['columns']['doktype']['config']['items ...@@ -93,14 +108,12 @@ $GLOBALS['TCA']['pages_language_overlay']['columns']['doktype']['config']['items
### Define the News Doktype ### ### Define the News Doktype ###
############################### ###############################
$relativeExtensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sg_news');
$customPageDoktype = 116; $customPageDoktype = 116;
$customPageIcon = $relativeExtensionPath . 'Resources/Public/Images/News.png';
// add the new doktype to the list of page types // add the new doktype to the list of page types
$GLOBALS['PAGES_TYPES'][$customPageDoktype] = [ $GLOBALS['PAGES_TYPES'][$customPageDoktype] = [
'type' => 'sys', 'type' => 'sys',
'icon' => $customPageIcon, 'icon' => 'EXT:sg_news/Resources/Public/Images/News.png',
'allowedTables' => '*', 'allowedTables' => '*',
]; ];
...@@ -108,27 +121,25 @@ $GLOBALS['PAGES_TYPES'][$customPageDoktype] = [ ...@@ -108,27 +121,25 @@ $GLOBALS['PAGES_TYPES'][$customPageDoktype] = [
$GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'][] = [ $GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'][] = [
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.news', 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.news',
$customPageDoktype, $customPageDoktype,
$customPageIcon 'EXT:sg_news/Resources/Public/Images/News.png'
]; ];
// also add the new doktype to the page language overlays type selector (so that translations can inherit the same type) // also add the new doktype to the page language overlays type selector (so that translations can inherit the same type)
$GLOBALS['TCA']['pages_language_overlay']['columns']['doktype']['config']['items'][] = [ $GLOBALS['TCA']['pages_language_overlay']['columns']['doktype']['config']['items'][] = [
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.news', 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageType.news',
$customPageDoktype, $customPageDoktype,
$customPageIcon 'EXT:sg_news/Resources/Public/Images/News.png'
]; ];
// add the sprite icon for the new doktype // register new icon
\TYPO3\CMS\Backend\Sprite\SpriteManager::addTcaTypeIcon('pages', $customPageDoktype, $customPageIcon); $iconRegistry->registerIcon(
'tcarecords-pages-' . $customPageDoktype,
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => 'EXT:sg_news/Resources/Public/Images/News.png']
);
$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$customPageDoktype] = 'tcarecords-pages-' . $customPageDoktype;
// add the new doktype to the list of types available from the new page menu at the top of the page tree // add the new doktype to the list of types available from the new page menu at the top of the page tree
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(
'options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . $customPageDoktype . ')' 'options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . $customPageDoktype . ')'
); );
// Removal of the unused plugin setting fields
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_overview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_listbycategory'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_latest'] = 'select_key,pages,recursive';
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment