diff --git a/Configuration/Icons.php b/Configuration/Icons.php new file mode 100644 index 00000000..5a0afe74 --- /dev/null +++ b/Configuration/Icons.php @@ -0,0 +1,28 @@ + [ + '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', + ], +]; diff --git a/ext_localconf.php b/ext_localconf.php index 34669fb0..3d5add58 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -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 @@ -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';