Skip to content

Commit

Permalink
[TASK] register icons outside BE if-statement so it can show content …
Browse files Browse the repository at this point in the history
…element icons in frontend editing (#449)
  • Loading branch information
mesosa authored and MattiasNilsson committed Oct 11, 2018
1 parent f1a6e7c commit 60f58de
Showing 1 changed file with 59 additions and 52 deletions.
111 changes: 59 additions & 52 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 60f58de

Please sign in to comment.