From 60f58de05075ec617a7ed2a32b93aa7cc7b503c9 Mon Sep 17 00:00:00 2001 From: Mosa Date: Thu, 11 Oct 2018 14:46:35 +0200 Subject: [PATCH] [TASK] register icons outside BE if-statement so it can show content element icons in frontend editing (#449) --- ext_tables.php | 111 ++++++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 52 deletions(-) diff --git a/ext_tables.php b/ext_tables.php index eff89e97..be81a23b 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -2,62 +2,69 @@ defined('TYPO3_MODE') or die(); $boot = function ($_EXTKEY) { - if (TYPO3_MODE === 'BE') { - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); - // Content Elements Icons - $contentElementIconFilePrefix = 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/ContentElements/'; - $contentElementIcons = [ - 'content-elements-contentElementSlider' => 'slider.svg', - 'content-elements-bigIconTextButton' => 'bigIconTextButton.svg', - 'content-elements-iconTextButton' => 'iconTextButton.svg', - 'content-elements-imageTextLink' => 'imageTextLink.svg', - 'content-elements-logoCarousel' => 'logoCarousel.svg', - 'content-elements-quote' => 'quote.svg', - 'content-elements-fullWidthImage' => 'fullWidthImage.svg', - 'content-elements-responsiveVideo' => 'responsiveVideo.svg', - 'content-elements-socialIcons' => 'socialIcons.svg', - 'content-elements-copyrightText' => 'copyrightText.svg', - 'content-elements-contacts' => 'contacts.svg', - 'content-elements-button' => 'button.svg', - 'content-elements-heroImage' => 'heroImage.svg', - 'content-elements-contactsCard' => 'contactsCard.svg' - ]; - foreach ($contentElementIcons as $identifier => $contentElementIcon) { - $iconRegistry->registerIcon( - $identifier, - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => $contentElementIconFilePrefix . $contentElementIcon] - ); - } + // Content Elements Icons + $contentElementIconFilePrefix = 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/ContentElements/'; + $contentElementIcons = [ + 'content-elements-contentElementSlider' => 'slider.svg', + 'content-elements-bigIconTextButton' => 'bigIconTextButton.svg', + 'content-elements-iconTextButton' => 'iconTextButton.svg', + 'content-elements-imageTextLink' => 'imageTextLink.svg', + 'content-elements-logoCarousel' => 'logoCarousel.svg', + 'content-elements-quote' => 'quote.svg', + 'content-elements-fullWidthImage' => 'fullWidthImage.svg', + 'content-elements-responsiveVideo' => 'responsiveVideo.svg', + 'content-elements-socialIcons' => 'socialIcons.svg', + 'content-elements-copyrightText' => 'copyrightText.svg', + 'content-elements-contacts' => 'contacts.svg', + 'content-elements-button' => 'button.svg', + 'content-elements-heroImage' => 'heroImage.svg', + 'content-elements-contactsCard' => 'contactsCard.svg' + ]; + foreach ($contentElementIcons as $identifier => $contentElementIcon) { + $iconRegistry->registerIcon( + $identifier, + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => $contentElementIconFilePrefix . $contentElementIcon] + ); + } + // Grid element icons + $gridElementsPath = 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/GridElements/'; + $gridElementsIcons = [ + 'grid-elements-2ColumnGrid' => '2-column-grid.svg', + 'grid-elements-3ColumnGrid' => '3-column-grid.svg', + 'grid-elements-4ColumnGrid' => '4-column-grid.svg', + 'grid-elements-adv1ColumnGrid' => 'adv1-column-grid.svg', + 'grid-elements-adv2ColumnGrid' => 'adv2-column-grid.svg', + 'grid-elements-adv3ColumnGrid' => 'adv3-column-grid.svg', + 'grid-elements-adv4ColumnGrid' => 'adv4-column-grid.svg', + 'grid-elements-collapsible' => 'collapsible.svg', + 'grid-elements-collapsibleGroup' => 'collapsibleGroup.svg', + 'grid-elements-parallax' => 'parallax.svg', + 'grid-elements-simpleAccordion' => 'simpleAccordion.svg', + 'grid-elements-tabGroup' => 'tabGroup.svg', + 'grid-elements-tab' => 'tab.svg', + 'grid-elements-sliderContainer' => 'sliderContainer.svg' + ]; + foreach ($gridElementsIcons as $identifier => $gridElementsIcon) { + $iconRegistry->registerIcon( + $identifier, + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => $gridElementsPath . $gridElementsIcon] + ); + } + + // Solr + $iconRegistry->registerIcon( + 'extensions-solr-plugin-contentelement', + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => 'EXT:solr/Resources/Public/Images/Icons/ContentElement.svg'] + ); - // Grid element icons - $gridElementsPath = 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/GridElements/'; - $gridElementsIcons = [ - 'grid-elements-2ColumnGrid' => '2-column-grid.svg', - 'grid-elements-3ColumnGrid' => '3-column-grid.svg', - 'grid-elements-4ColumnGrid' => '4-column-grid.svg', - 'grid-elements-adv1ColumnGrid' => 'adv1-column-grid.svg', - 'grid-elements-adv2ColumnGrid' => 'adv2-column-grid.svg', - 'grid-elements-adv3ColumnGrid' => 'adv3-column-grid.svg', - 'grid-elements-adv4ColumnGrid' => 'adv4-column-grid.svg', - 'grid-elements-collapsible' => 'collapsible.svg', - 'grid-elements-collapsibleGroup' => 'collapsibleGroup.svg', - 'grid-elements-parallax' => 'parallax.svg', - 'grid-elements-simpleAccordion' => 'simpleAccordion.svg', - 'grid-elements-tabGroup' => 'tabGroup.svg', - 'grid-elements-tab' => 'tab.svg', - 'grid-elements-sliderContainer' => 'sliderContainer.svg' - ]; - foreach ($gridElementsIcons as $identifier => $gridElementsIcon) { - $iconRegistry->registerIcon( - $identifier, - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => $gridElementsPath . $gridElementsIcon] - ); - } + if (TYPO3_MODE === 'BE') { // Add context sensitive help (csh) for the haiku table \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(