Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Move icon registration to Icons.php #567

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading