[TASK] Replace sprite icons in WorkspaceSelectorToolbarItem 31/43131/2
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 8 Sep 2015 18:13:47 +0000 (20:13 +0200)
committerBenjamin Kott <info@bk2k.info>
Tue, 8 Sep 2015 20:00:01 +0000 (22:00 +0200)
Fix JavaScript for the icons too.

Resolves: #69620
Releases: master
Change-Id: I19734e66d11ff8a6fde3ffd4b8f32fde34e60302
Reviewed-on: http://review.typo3.org/43131
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/workspaces/Classes/Backend/ToolbarItems/WorkspaceSelectorToolbarItem.php
typo3/sysext/workspaces/Resources/Public/JavaScript/Toolbar/WorkspacesMenu.js

index 51a5b16..1a39879 100644 (file)
@@ -52,6 +52,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'star',
                        )
                ),
+               'apps-toolbar-menu-workspace' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'th-large',
+                       )
+               ),
                'apps-pagetree-root' => array(
                        'provider' => SvgIconProvider::class,
                        'options' => array(
@@ -580,6 +586,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                ),
 
                // Status
+               'status-status-checked' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'check',
+                       )
+               ),
                'status-status-current' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index e74c15a..9e077bc 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Workspaces\Backend\ToolbarItems;
  */
 
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Page\PageRenderer;
@@ -32,6 +31,11 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface {
         */
        protected $availableWorkspaces;
 
+       /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
        /**
         * Constructor
         */
@@ -40,6 +44,7 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface {
                $wsService = GeneralUtility::makeInstance(WorkspaceService::class);
                $this->availableWorkspaces = $wsService->getAvailableWorkspaces();
 
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                $pageRenderer = $this->getPageRenderer();
                $pageRenderer->addInlineLanguageLabel('Workspaces.workspaceTitle', WorkspaceService::getWorkspaceTitle($this->getBackendUser()->workspace));
                $pageRenderer->loadRequireJsModule('TYPO3/CMS/Workspaces/Toolbar/WorkspacesMenu');
@@ -64,12 +69,8 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface {
                        return '';
                }
 
-               return IconUtility::getSpriteIcon(
-                       'apps-toolbar-menu-workspace',
-                       array(
-                               'title' => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:toolbarItems.workspace', TRUE),
-                       )
-               );
+               return '<span title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:toolbarItems.workspace', TRUE) . '">'
+                       . $this->iconFactory->getIcon('apps-toolbar-menu-workspace', Icon::SIZE_SMALL)->render() . '</span>';
        }
 
        /**
@@ -82,10 +83,9 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface {
                $languageService = $this->getLanguageService();
 
                $index = 0;
-               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                $activeWorkspace = (int)$backendUser->workspace;
-               $stateCheckedIcon = IconUtility::getSpriteIcon('status-status-checked');
-               $stateUncheckedIcon = '<span title="' . $languageService->getLL('bookmark_inactive', TRUE) . '">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
+               $stateCheckedIcon = $this->iconFactory->getIcon('status-status-checked', Icon::SIZE_SMALL)->render();
+               $stateUncheckedIcon = '<span title="' . $languageService->getLL('bookmark_inactive', TRUE) . '">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
                $workspaceSections = array(
                        'top' => array(),
                        'items' => array(),
index fdc26ec..84cfbc0 100644 (file)
@@ -105,16 +105,16 @@ define('TYPO3/CMS/Workspaces/Toolbar/WorkspacesMenu', ['jquery'], function($) {
                WorkspacesMenu.updateBackendContext(title);
 
                // first remove all checks, then set the check in front of the selected workspace
-               var stateActiveClass = 't3-icon fa fa-check';
-               var stateInactiveClass = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty';
+               var stateActiveClass = 'fa fa-check';
+               var stateInactiveClass = 'fa fa-empty-empty';
 
                // remove "selected" class and checkmark
-               $(WorkspacesMenu.options.activeMenuItemSelector + ' span', WorkspacesMenu.options.containerSelector).removeClass(stateActiveClass).addClass(stateInactiveClass);
+               $(WorkspacesMenu.options.activeMenuItemSelector + ' i', WorkspacesMenu.options.containerSelector).removeClass(stateActiveClass).addClass(stateInactiveClass);
                $(WorkspacesMenu.options.activeMenuItemSelector, WorkspacesMenu.options.containerSelector).removeClass('selected');
 
                // add "selected" class and checkmark
                var $activeElement = $(WorkspacesMenu.options.menuItemSelector + '[data-workspaceid=' + id + ']', WorkspacesMenu.options.containerSelector);
-               $activeElement.find('span').removeClass(stateInactiveClass).addClass(stateActiveClass);
+               $activeElement.find('i').removeClass(stateInactiveClass).addClass(stateActiveClass);
                $activeElement.parent().addClass('selected');
        };