Skip to content

Commit

Permalink
Merge pull request #567 from rintisch/task/566-use-icons-php
Browse files Browse the repository at this point in the history
[TASK] Move icon registration to `Icons.php`
  • Loading branch information
extcode authored Sep 30, 2024
2 parents 42f82ce + 165b06e commit 096362b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
28 changes: 28 additions & 0 deletions Configuration/Icons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'apps-pagetree-folder-cart-coupons' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:cart/Resources/Public/Icons/apps_pagetree_folder_cart_coupons.svg',
],
'apps-pagetree-folder-cart-orders' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:cart/Resources/Public/Icons/apps_pagetree_folder_cart_orders.svg',
],
'apps-pagetree-page-cart-cart' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:cart/Resources/Public/Icons/apps_pagetree_page_cart_cart.svg',
],
'ext-cart-wizard-icon' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:cart/Resources/Public/Icons/cart_plugin_wizard.svg',
],
'ext-cart-module' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:cart/Resources/Public/Icons/module.svg',
],
'ext-cart-module-order' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:cart/Resources/Public/Icons/module_orders.svg',
],
];
28 changes: 0 additions & 28 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
use Extcode\Cart\Controller\Cart\PaymentController;
use Extcode\Cart\Controller\Cart\ProductController;
use Extcode\Cart\Controller\Cart\ShippingController;
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

// configure plugins
Expand Down Expand Up @@ -78,31 +75,6 @@
]
);

// Icon Registry

$icons = [
'apps-pagetree-folder-cart-coupons' => 'apps_pagetree_folder_cart_coupons.svg',
'apps-pagetree-folder-cart-orders' => 'apps_pagetree_folder_cart_orders.svg',
'apps-pagetree-page-cart-cart' => 'apps_pagetree_page_cart_cart.svg',
'ext-cart-wizard-icon' => 'cart_plugin_wizard.svg',
'ext-cart-module' => 'module.svg',
'ext-cart-module-order' => 'module_orders.svg',
];

$iconRegistry = GeneralUtility::makeInstance(
IconRegistry::class
);

foreach ($icons as $identifier => $fileName) {
$iconRegistry->registerIcon(
$identifier,
SvgIconProvider::class,
[
'source' => 'EXT:cart/Resources/Public/Icons/' . $fileName,
]
);
}

// register "cart:" namespace
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['cart'][] = 'Extcode\\Cart\\ViewHelpers';

Expand Down

0 comments on commit 096362b

Please sign in to comment.