[TASK] Replace sprite icon "actions-system-cache-clear-impact-*" 38/42938/5
authorFrank Nägler <frank.naegler@typo3.org>
Mon, 31 Aug 2015 09:45:40 +0000 (11:45 +0200)
committerBenjamin Kott <info@bk2k.info>
Mon, 31 Aug 2015 12:54:40 +0000 (14:54 +0200)
Resolves: #69427
Releases: master
Change-Id: Ia5e288b95a73c3c66416603fb59a913bfc34146a
Reviewed-on: http://review.typo3.org/42938
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Build/Gruntfile.js
Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-high.svg [new file with mode: 0644]
Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-low.svg [new file with mode: 0644]
Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-medium.svg [new file with mode: 0644]
Build/package.json
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-high.svg [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-low.svg [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-medium.svg [new file with mode: 0644]
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index 1f76d33..c63e580 100644 (file)
@@ -31,9 +31,11 @@ module.exports = function(grunt) {
                paths: {
                        resources : 'Resources/',
                        less      : '<%= paths.resources %>Public/Less/',
+                       icons     : '<%= paths.resources %>Private/Icons/',
                        root      : '../',
                        sysext    : '<%= paths.root %>typo3/sysext/',
                        t3skin    : '<%= paths.sysext %>t3skin/Resources/',
+                       backend   : '<%= paths.sysext %>backend/Resources/',
                        core      : '<%= paths.sysext %>core/Resources/'
                },
                less: {
@@ -142,7 +144,7 @@ module.exports = function(grunt) {
                        }
                },
                uglify: {
-                       my_target: {
+                       thirdparty: {
                                files: {
                                        "<%= paths.core %>Public/JavaScript/Contrib/require.js": ["<%= paths.core %>Public/JavaScript/Contrib/require.js"],
                                        "<%= paths.core %>Public/JavaScript/Contrib/moment.js": ["<%= paths.core %>Public/JavaScript/Contrib/moment.js"],
@@ -158,6 +160,20 @@ module.exports = function(grunt) {
                                        "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/widget.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/widget.js"]
                                }
                        }
+               },
+               svgmin: {
+                       options: {
+                               plugins: [
+                                       { removeViewBox: false }
+                               ]
+                       },
+                       icons_action: {
+                               files: {
+                                       '<%= paths.backend %>Public/Icons/Action/actions-system-cache-clear-impact-high.svg': '<%= paths.icons %>Action/actions-system-cache-clear-impact-high.svg',
+                                       '<%= paths.backend %>Public/Icons/Action/actions-system-cache-clear-impact-low.svg': '<%= paths.icons %>Action/actions-system-cache-clear-impact-low.svg',
+                                       '<%= paths.backend %>Public/Icons/Action/actions-system-cache-clear-impact-medium.svg': '<%= paths.icons %>Action/actions-system-cache-clear-impact-medium.svg'
+                               }
+                       }
                }
        });
 
@@ -169,6 +185,7 @@ module.exports = function(grunt) {
        grunt.loadNpmTasks('grunt-npm-install');
        grunt.loadNpmTasks('grunt-bower-just-install');
        grunt.loadNpmTasks('grunt-contrib-uglify');
+       grunt.loadNpmTasks('grunt-svgmin');
 
        /**
         * grunt default task
@@ -188,12 +205,20 @@ module.exports = function(grunt) {
         * - npn install
         * - bower install
         * - copy some bower components to a specific destinations because they need to be included via PHP
-        * - uglify 3rd party JavaScript libraries
+        * - copy development resources to final locations (example: module icons)
         */
-       grunt.registerTask('update', ['npm-install', 'bower_install', 'bowercopy', 'uglify']);
+       grunt.registerTask('update', ['npm-install', 'bower_install', 'bowercopy', 'copy']);
 
        /**
-        * grunt task to copy icons into correct location
+        * grunt build task
+        *
+        * call "$ grunt build"
+        *
+        * this task does the following things:
+        * - execute update task
+        * - compile less files
+        * - uglify js files
+        * - minifies svg files
         */
-       grunt.registerTask('build', ['copy:icons']);
+       grunt.registerTask('build', ['update', 'less', 'uglify', 'svgmin']);
 };
diff --git a/Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-high.svg b/Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-high.svg
new file mode 100644 (file)
index 0000000..996a77d
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+        viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g>
+       <path fill="#C83C3C" d="M13,4.6l-6,11.1C6.8,15.9,6.7,16,6.5,16c0,0-0.1,0-0.2,0c-0.2-0.1-0.4-0.3-0.3-0.5l2.2-7.8l-4.5,1
+               c0,0-0.1,0-0.1,0c-0.1,0-0.3,0-0.3-0.1C3,8.5,3,8.4,3,8.2l2.2-7.9C5.3,0.1,5.5,0,5.7,0h3.7c0.3,0,0.5,0.2,0.5,0.4
+               c0,0.1,0,0.1-0.1,0.2L7.9,5l4.4-0.9c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.1C13,4.3,13,4.5,13,4.6z"/>
+</g>
+</svg>
diff --git a/Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-low.svg b/Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-low.svg
new file mode 100644 (file)
index 0000000..6268466
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+        viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g>
+       <path fill="#79A548" d="M13,4.6l-6,11.1C6.8,15.9,6.7,16,6.5,16c0,0-0.1,0-0.2,0c-0.2-0.1-0.4-0.3-0.3-0.5l2.2-7.8l-4.5,1
+               c0,0-0.1,0-0.1,0c-0.1,0-0.3,0-0.3-0.1C3,8.5,3,8.4,3,8.2l2.2-7.9C5.3,0.1,5.5,0,5.7,0h3.7c0.3,0,0.5,0.2,0.5,0.4
+               c0,0.1,0,0.1-0.1,0.2L7.9,5l4.4-0.9c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.1C13,4.3,13,4.5,13,4.6z"/>
+</g>
+</svg>
diff --git a/Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-medium.svg b/Build/Resources/Private/Icons/Action/actions-system-cache-clear-impact-medium.svg
new file mode 100644 (file)
index 0000000..dc65b1e
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+        viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g>
+       <path fill="#E8A33D" d="M13,4.6l-6,11.1C6.8,15.9,6.7,16,6.5,16c0,0-0.1,0-0.2,0c-0.2-0.1-0.4-0.3-0.3-0.5l2.2-7.8l-4.5,1
+               c0,0-0.1,0-0.1,0c-0.1,0-0.3,0-0.3-0.1C3,8.5,3,8.4,3,8.2l2.2-7.9C5.3,0.1,5.5,0,5.7,0h3.7c0.3,0,0.5,0.2,0.5,0.4
+               c0,0.1,0,0.1-0.1,0.2L7.9,5l4.4-0.9c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.1C13,4.3,13,4.5,13,4.6z"/>
+</g>
+</svg>
index b3f03ab..c7d9787 100644 (file)
@@ -15,6 +15,7 @@
     "grunt-contrib-less": "~1.0.0",
     "grunt-contrib-uglify": "0.9.1",
     "grunt-contrib-watch": "~0.6.1",
+    "grunt-svgmin": "2.0.1",
     "grunt-npm-install": "^0.2.0"
   }
 }
index 8b61163..b5165ed 100644 (file)
@@ -18,6 +18,8 @@ use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
 use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Page\PageRenderer;
 
@@ -44,6 +46,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
        public function __construct() {
                $backendUser = $this->getBackendUser();
                $languageService = $this->getLanguageService();
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
 
                $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/ClearCacheMenu');
 
@@ -54,7 +57,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
                                'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushPageCachesTitle', TRUE),
                                'description' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushPageCachesDescription', TRUE),
                                'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'pages', 'ajaxCall' => 1]) . BackendUtility::getUrlToken('tceAction'),
-                               'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-low')
+                               'icon' => $iconFactory->getIcon('actions-system-cache-clear-impact-low', Icon::SIZE_SMALL)
                        );
                        $this->optionValues[] = 'pages';
                }
@@ -66,7 +69,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
                                'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushGeneralCachesTitle', TRUE),
                                'description' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushGeneralCachesDescription', TRUE),
                                'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'all', 'ajaxCall' => 1]) . BackendUtility::getUrlToken('tceAction'),
-                               'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-medium')
+                               'icon' => $iconFactory->getIcon('actions-system-cache-clear-impact-medium', Icon::SIZE_SMALL)
                        );
                        $this->optionValues[] = 'all';
                }
@@ -82,7 +85,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
                                'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle', TRUE),
                                'description' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesDescription', TRUE),
                                'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'system', 'ajaxCall' => 1]) . BackendUtility::getUrlToken('tceAction'),
-                               'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-high')
+                               'icon' => $iconFactory->getIcon('actions-system-cache-clear-impact-high', Icon::SIZE_SMALL)
                        );
                        $this->optionValues[] = 'system';
                }
diff --git a/typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-high.svg b/typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-high.svg
new file mode 100644 (file)
index 0000000..df6f0d4
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#C83C3C" d="M13 4.6L7 15.7c-.2.2-.3.3-.5.3h-.2c-.2-.1-.4-.3-.3-.5l2.2-7.8-4.5 1h-.1c-.1 0-.3 0-.3-.1-.3-.1-.3-.2-.3-.4L5.2.3c.1-.2.3-.3.5-.3h3.7c.3 0 .5.2.5.4 0 .1 0 .1-.1.2L7.9 5l4.4-.9h.1c.1 0 .3.1.4.1.2.1.2.3.2.4z"/></svg>
\ No newline at end of file
diff --git a/typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-low.svg b/typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-low.svg
new file mode 100644 (file)
index 0000000..8fca9f0
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#79A548" d="M13 4.6L7 15.7c-.2.2-.3.3-.5.3h-.2c-.2-.1-.4-.3-.3-.5l2.2-7.8-4.5 1h-.1c-.1 0-.3 0-.3-.1-.3-.1-.3-.2-.3-.4L5.2.3c.1-.2.3-.3.5-.3h3.7c.3 0 .5.2.5.4 0 .1 0 .1-.1.2L7.9 5l4.4-.9h.1c.1 0 .3.1.4.1.2.1.2.3.2.4z"/></svg>
\ No newline at end of file
diff --git a/typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-medium.svg b/typo3/sysext/backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-medium.svg
new file mode 100644 (file)
index 0000000..b566fab
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#E8A33D" d="M13 4.6L7 15.7c-.2.2-.3.3-.5.3h-.2c-.2-.1-.4-.3-.3-.5l2.2-7.8-4.5 1h-.1c-.1 0-.3 0-.3-.1-.3-.1-.3-.2-.3-.4L5.2.3c.1-.2.3-.3.5-.3h3.7c.3 0 .5.2.5.4 0 .1 0 .1-.1.2L7.9 5l4.4-.9h.1c.1 0 .3.1.4.1.2.1.2.3.2.4z"/></svg>
\ No newline at end of file
index ef0fd2b..1e0a83b 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Core\Imaging;
 
 use TYPO3\CMS\Core\Exception;
 use TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider;
+use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
 
 /**
  * Class IconRegistry, which makes it possible to register custom icons
@@ -196,6 +197,24 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'pencil-square-o',
                        )
                ),
+               'actions-system-cache-clear-impact-low' => array(
+                       'provider' => SvgIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-low.svg',
+                       )
+               ),
+               'actions-system-cache-clear-impact-medium' => array(
+                       'provider' => SvgIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-medium.svg',
+                       )
+               ),
+               'actions-system-cache-clear-impact-high' => array(
+                       'provider' => SvgIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-high.svg',
+                       )
+               ),
                'actions-system-list-open' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(