[TASK] Replace sprite icon "actions-document-history-open" with the new IconFactory 65/42365/3
authorMarkus Guenther <mail@markus-guenther.de>
Fri, 7 Aug 2015 11:22:22 +0000 (13:22 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 7 Aug 2015 12:04:29 +0000 (14:04 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
actions-document-history-open with the new IconFactory.

Change-Id: Ie0432cdced84d145da6bf9749f1275f398861146
Resolves: #68830
Releases: master
Reviewed-on: http://review.typo3.org/42365
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 8068e8c..82e1f5f 100644 (file)
@@ -567,7 +567,7 @@ class ClickMenu {
         */
        public function DB_history($table, $uid) {
                $url = BackendUtility::getModuleUrl('record_history', array('element' => $table . ':' . $uid));
-               return $this->linkItem($this->languageService->makeEntities($this->languageService->getLL('CM_history')), IconUtility::getSpriteIcon('actions-document-history-open'), $this->urlRefForCM($url, 'returnUrl'), 0);
+               return $this->linkItem($this->languageService->makeEntities($this->languageService->getLL('CM_history')), $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL), $this->urlRefForCM($url, 'returnUrl'), 0);
        }
 
        /**
index e33e0bc..c5ff32a 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
 
 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\Resource\Folder;
 use TYPO3\CMS\Core\Resource\ProcessedFile;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
@@ -103,9 +105,15 @@ class ElementInformationController {
        protected $titleTag;
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * Constructor
         */
        public function __construct() {
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                $GLOBALS['SOBE'] = $this;
 
                $this->init();
@@ -570,7 +578,7 @@ class ElementInformationController {
                        ) . '; return false;';
                $pageActionIcons .= '
                        <a class="btn btn-default btn-sm" href="#" onclick="' . htmlspecialchars($historyOnClick) . '">
-                               ' . IconUtility::getSpriteIcon('actions-document-history-open') . '
+                               ' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '
                        </a>';
 
                if ($table === 'pages') {
index acf828c..31d50a9 100644 (file)
@@ -21,6 +21,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Html\HtmlParser;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
@@ -413,11 +415,17 @@ class EditDocumentController {
        protected $previewData = [];
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * Constructor
         */
        public function __construct() {
                $GLOBALS['SOBE'] = $this;
                $this->getLanguageService()->includeLLFile('EXT:lang/locallang_alt_doc.xlf');
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        }
 
        /**
@@ -1179,7 +1187,7 @@ class EditDocumentController {
                                                                )
                                                        )
                                                ) . '; return false;';
-                                       $buttons['history'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>';
+                                       $buttons['history'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '</a>';
                                }
                                // If only SOME fields are shown in the form, this will link the user to the FULL form:
                                if ($this->columnsOnly) {
index d275aa9..0318ef3 100755 (executable)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller;
 
 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\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
@@ -299,6 +301,11 @@ class PageLayoutController {
        public $contentElementCache = array();
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * Initializing the module
         *
         * @return void
@@ -1106,6 +1113,9 @@ class PageLayoutController {
         * @return array all available buttons as an assoc. array
         */
        protected function getButtons($function = '') {
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+
                $lang = $this->getLanguageService();
                $buttons = array(
                        'view' => '',
@@ -1237,7 +1247,7 @@ class PageLayoutController {
                                                                        )
                                                                ) . '#latest'
                                                        ) . ');return false;') . '"
-                                               title="' . $lang->getLL('recordHistory', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>';
+                                               title="' . $lang->getLL('recordHistory', TRUE) . '">' . $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '</a>';
                                }
                        }
                }
index d643d77..1edb0aa 100644 (file)
@@ -18,6 +18,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Belog\Domain\Model\HistoryEntry;
 use TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
@@ -63,6 +65,8 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
                $historyEntry = $historyEntryRepository->findOneBySysLogUid($arguments['uid']);
                /** @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext */
                $controllerContext = $renderingContext->getControllerContext();
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
 
                if (!$historyEntry instanceof HistoryEntry) {
                        return '';
@@ -72,9 +76,11 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
                        $controllerContext->getRequest()->getControllerExtensionName(),
                        array($historyEntry->getFieldlist())
                );
-               $historyIcon = IconUtility::getSpriteIcon('actions-document-history-open', array(
-                       'title' => LocalizationUtility::translate('showHistory', $controllerContext->getRequest()->getControllerExtensionName())
-               ));
+               $titleLable = LocalizationUtility::translate(
+                       'showHistory',
+                       $controllerContext->getRequest()->getControllerExtensionName()
+               );
+               $historyIcon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
                $historyHref = BackendUtility::getModuleUrl(
                                'record_history',
                                array(
@@ -82,7 +88,7 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
                                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
                                )
                        );
-               $historyLink = '<a href="' . htmlspecialchars($historyHref) . '">' . $historyIcon . '</a>';
+               $historyLink = '<a href="' . htmlspecialchars($historyHref) . '" title="' . htmlspecialchars($titleLable) . '">' . $historyIcon . '</a>';
                return $historyLabel . '&nbsp;' . $historyLink;
        }
 
index fd397e5..9d48ffc 100644 (file)
@@ -56,6 +56,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'download',
                        )
                ),
+               'actions-document-history-open' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'history',
+                       )
+               ),
                'actions-document-info' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index 2a21a33..9fb6043 100755 (executable)
@@ -612,8 +612,9 @@ class AdminPanelView {
                $id = $GLOBALS['TSFE']->id;
                $returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
 
-               $icon = IconUtility::getSpriteIcon('actions-document-history-open', array('title' => $this->extGetLL('edit_recordHistory', FALSE)));
-               $toolBar = '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl))) . '#latest">' . $icon . '</a>';
+               $icon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
+               $link = BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl));
+               $toolBar = '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '#latest" title="' . $this->extGetLL('edit_recordHistory') . '">' . $icon . '</a>';
                if ($perms & Permission::CONTENT_EDIT && $langAllowed) {
                        $params = '';
                        if ($GLOBALS['TSFE']->sys_language_uid) {
@@ -621,14 +622,12 @@ class AdminPanelView {
                        }
                        $icon = $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL);
                        $link = $newContentWizScriptPath . 'id=' . $id . $params . '&returnUrl=' . rawurlencode($returnUrl);
-                       $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '"' .
-                               $toolBar .= 'title="' . $this->extGetLL('edit_newContentElement', FALSE) .  '"">' . $icon . '</a>';
+                       $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_newContentElement') .  '"">' . $icon . '</a>';
                }
                if ($perms & Permission::PAGE_EDIT) {
                        $icon = $iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL);
                        $link = BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => $returnUrl]);
-                       $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) .
-                       $toolBar .= '" title="' . $this->extGetLL('edit_move_page', FALSE) . '">' . $icon . '</a>';
+                       $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_move_page') . '">' . $icon . '</a>';
                }
                if ($perms & Permission::PAGE_NEW) {
                        $icon = IconUtility::getSpriteIcon('actions-page-new', array('title' => $this->extGetLL('edit_newPage', FALSE)));
index 85ac421..8213320 100644 (file)
@@ -1267,7 +1267,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                        $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\'#latest\');';
                        $historyAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
                                . $this->getLanguageService()->getLL('history', TRUE) . '">'
-                               . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>';
+                               . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '</a>';
                        $this->addActionToCellGroup($cells, $historyAction, 'history');
                        // Versioning:
                        if (ExtensionManagementUtility::isLoaded('version') && !ExtensionManagementUtility::isLoaded('workspaces')) {