[TASK] Replace sprite icon "actions-document-info" with the new IconFactory 53/42353/3
authorMarkus Guenther <mail@markus-guenther.de>
Fri, 7 Aug 2015 09:47:40 +0000 (11:47 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 7 Aug 2015 10:44:25 +0000 (12:44 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
actions-document-info with the new IconFactory.

Change-Id: I45c062b30643d967f08a5d8109aa2ea1c29bda6c
Resolves: #68823
Releases: master
Reviewed-on: http://review.typo3.org/42353
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Clipboard/Clipboard.php
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html
typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/IndexListRow.html
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/sys_action/Classes/ActionTask.php

index 617b5a0..8068e8c 100644 (file)
@@ -18,6 +18,8 @@ use TYPO3\CMS\Backend\Clipboard\Clipboard;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
@@ -148,12 +150,18 @@ class ClickMenu {
        protected $backendUser;
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * @param LanguageService $languageService Language Service to inject
         * @param BackendUserAuthentication $backendUser
         */
        public function __construct(LanguageService $languageService = NULL, BackendUserAuthentication $backendUser = NULL) {
                $this->languageService = $languageService ?: $GLOBALS['LANG'];
                $this->backendUser = $backendUser ?: $GLOBALS['BE_USER'];
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        }
 
        /**
@@ -546,7 +554,7 @@ class ClickMenu {
         * @internal
         */
        public function DB_info($table, $uid) {
-               return $this->linkItem($this->label('info'), IconUtility::getSpriteIcon('actions-document-info'), 'top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($uid) . ');');
+               return $this->linkItem($this->label('info'), $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL), 'top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($uid) . ');');
        }
 
        /**
@@ -1473,4 +1481,4 @@ class ClickMenu {
                return $str . '.location';
        }
 
-}
+}
\ No newline at end of file
index 7efd6a8..a6daba7 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Clipboard;
 
 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\ResourceFactory;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -77,6 +79,18 @@ class Clipboard {
         */
        public $fileMode = 0;
 
+       /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
+        * Construct
+        */
+       public function __construct() {
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+       }
+
        /*****************************************
         *
         * Initialize
@@ -386,7 +400,7 @@ class Clipboard {
                                                                        <td nowrap="nowrap" width="95%">' . $this->linkItemText(htmlspecialchars(GeneralUtility::fixed_lgd_cs($fileObject->getName(), $this->getBackendUser()->uc['titleLen'])), $fileObject->getName()) . ($pad == 'normal' ? ' <strong>(' . ($this->clipData['normal']['mode'] == 'copy' ? $this->clLabel('copy', 'cm') : $this->clLabel('cut', 'cm')) . ')</strong>' : '') . '&nbsp;' . $thumb . '</td>
                                                                        <td nowrap="nowrap" class="col-control">
                                                                                <div class="btn-group">
-                                                                                       <a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($v) . '); return false;')) . '">' . IconUtility::getSpriteIcon('actions-document-info', array('title' => $this->clLabel('info', 'cm'))) . '</a>' . '<a class="btn btn-default" href="' . htmlspecialchars($this->removeUrl('_FILE', GeneralUtility::shortmd5($v))) . '#clip_head">' . IconUtility::getSpriteIcon('actions-selection-delete', array('title' => $this->clLabel('removeItem'))) . '</a>
+                                                                                       <a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($v) . '); return false;')) . '"title="' . $this->clLabel('info', 'cm') .'">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</a>' . '<a class="btn btn-default" href="' . htmlspecialchars($this->removeUrl('_FILE', GeneralUtility::shortmd5($v))) . '#clip_head">' . IconUtility::getSpriteIcon('actions-selection-delete', array('title' => $this->clLabel('removeItem'))) . '</a>
                                                                                </div>
                                                                        </td>
                                                                </tr>';
@@ -405,7 +419,7 @@ class Clipboard {
                                                                        <td nowrap="nowrap" width="95%">' . $this->linkItemText(htmlspecialchars(GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, $rec), $this->getBackendUser()->uc['titleLen'])), $rec, $table) . ($pad == 'normal' ? ' <strong>(' . ($this->clipData['normal']['mode'] == 'copy' ? $this->clLabel('copy', 'cm') : $this->clLabel('cut', 'cm')) . ')</strong>' : '') . '&nbsp;</td>
                                                                        <td nowrap="nowrap" class="col-control">
                                                                                <div class="btn-group">
-                                                                                       <a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', \'' . (int)$uid . '\'); return false;')) . '">' . IconUtility::getSpriteIcon('actions-document-info', array('title' => $this->clLabel('info', 'cm'))) . '</a>' . '<a class="btn btn-default" href="' . htmlspecialchars($this->removeUrl($table, $uid)) . '#clip_head">' . IconUtility::getSpriteIcon('actions-selection-delete', array('title' => $this->clLabel('removeItem'))) . '</a>
+                                                                                       <a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', \'' . (int)$uid . '\'); return false;')) . '" title="' . $this->clLabel('info', 'cm') .'">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</a>' . '<a class="btn btn-default" href="' . htmlspecialchars($this->removeUrl($table, $uid)) . '#clip_head">' . IconUtility::getSpriteIcon('actions-selection-delete', array('title' => $this->clLabel('removeItem'))) . '</a>
                                                                                </div>
                                                                        </td>
                                                                </tr>';
index 5cf0897..1c688b8 100644 (file)
@@ -1,5 +1,6 @@
 {namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
 
 <tr>
        <td class="col-icon">
@@ -30,7 +31,7 @@
        <td class="col-control">
                <f:link.action action="addToCompareList" arguments="{uid: backendUser.uid}" class="btn btn-default"><be:spriteManagerIcon iconName="actions-edit-add"/> <f:translate key="compare" /></f:link.action>
                <div class="btn-group" role="group">
-                       <a class="btn btn-default" href="#" onclick="top.launchView('be_users', '{backendUser.uid}'); return false;"><be:spriteManagerIcon iconName="actions-document-info" /></a>
+                       <a class="btn btn-default" href="#" onclick="top.launchView('be_users', '{backendUser.uid}'); return false;"><core:icon identifier="actions-document-info" size="small"/></a>
                        <a class="btn btn-default" href="{bu:editRecord(parameters: 'edit[be_users][{backendUser.uid}]=edit&returnUrl={returnUrl}')}"><be:spriteManagerIcon iconName="actions-document-open" /></a>
                        <f:if condition="{backendUser.currentlyLoggedIn} == 1">
                                <f:then>
index 18fe0db..0ad983f 100644 (file)
@@ -1,5 +1,6 @@
 {namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
 
 <f:for each="{onlineUser.sessions}" as="session" iteration="it">
        <tr>
@@ -42,7 +43,7 @@
                                        </f:else>
                                </f:if>
                                <a class="btn btn-default" href="#" onclick="top.launchView('be_users', '{onlineUser.backendUser.uid}',''); return false;">
-                                       <be:spriteManagerIcon iconName="actions-document-info" />
+                                       <core:icon identifier="actions-document-info" size="small"/>
                                </a>
                        </div>
                </td>
index 6b198d3..abe3e10 100644 (file)
@@ -1,5 +1,6 @@
 {namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+{namespace core = TYPO3\CMS\Core\ViewHelpers}
 
 <tr>
        <td class="col-icon">
@@ -24,7 +25,7 @@
        </td>
        <td class="col-control">
                <div class="btn-group" role="group">
-                       <a class="btn btn-default" href="#" onclick="top.launchView('be_groups', '{backendUserGroup.uid}'); return false;"><be:spriteManagerIcon iconName="actions-document-info" /></a>
+                       <a class="btn btn-default" href="#" onclick="top.launchView('be_groups', '{backendUserGroup.uid}'); return false;"><core:icon identifier="actions-document-info" size="small"/></a>
                        <a class="btn btn-default" href="{bu:editRecord(parameters: 'edit[be_groups][{backendUserGroup.uid}]=edit&returnUrl={returnUrl}')}"><be:spriteManagerIcon iconName="actions-document-open" /></a>
                        <f:if condition="{backendUserGroup.hidden}">
                                <f:then>
index 1669be2..fd397e5 100644 (file)
@@ -56,6 +56,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'download',
                        )
                ),
+               'actions-document-info' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'info-circle',
+                       )
+               ),
                'actions-document-import-t3d' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index 84a6805..7aa9d0b 100755 (executable)
@@ -1992,7 +1992,7 @@ class ElementBrowser {
                                        <tr class="file_list_normal">
                                                <td nowrap="nowrap">' . $filenameAndIcon . '&nbsp;</td>
                                                <td>' . $ATag . IconUtility::getSpriteIcon('actions-edit-add', array('title' =>  $lang->getLL('addToList', TRUE))) . $ATag_e . '</td>
-                                               <td nowrap="nowrap">' . $ATag2 . IconUtility::getSpriteIcon('actions-document-info', array('title' => $lang->getLL('info', TRUE))) . $lang->getLL('info', TRUE) . $ATag2_e . '</td>
+                                               <td nowrap="nowrap"><a href="' . htmlspecialchars($Ahref) . '" title="' . $lang->getLL('info', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . $lang->getLL('info', TRUE) . $ATag2_e . '</td>
                                                <td nowrap="nowrap">&nbsp;' . $pDim . '</td>
                                        </tr>';
                                $lines[] = '
@@ -2004,7 +2004,7 @@ class ElementBrowser {
                                        <tr class="file_list_normal">
                                                <td nowrap="nowrap">' . $filenameAndIcon . '&nbsp;</td>
                                                <td>' . $ATag . IconUtility::getSpriteIcon('actions-edit-add', array('title' =>  $lang->getLL('addToList', TRUE))) . $ATag_e . '</td>
-                                               <td nowrap="nowrap">' . $ATag2 . IconUtility::getSpriteIcon('actions-document-info', array('title' => $lang->getLL('info', TRUE))) . $lang->getLL('info', TRUE) . $ATag2_e . '</td>
+                                               <td nowrap="nowrap"><a href="' . htmlspecialchars($Ahref) . '" title="' . $lang->getLL('info', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . $lang->getLL('info', TRUE) . $ATag2_e . '</td>
                                                <td>&nbsp;</td>
                                        </tr>';
                        }
index de9bb40..9f94d8e 100644 (file)
@@ -1250,7 +1250,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                // "Info": (All records)
                $onClick = 'top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\'); return false;';
                $viewBigAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->getLL('showInfo', TRUE) . '">'
-                       . IconUtility::getSpriteIcon('actions-document-info') . '</a>';
+                       . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</a>';
                $this->addActionToCellGroup($cells, $viewBigAction, 'viewBig');
                // "Move" wizard link for pages/tt_content elements:
                if ($permsEdit && ($table === 'tt_content' || $table === 'pages')) {
index c980767..a6ae6ff 100644 (file)
@@ -175,7 +175,10 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface {
                                        FALSE,
                                        TRUE
                                );
-                               $editActionLink = '<a class="edit" href="' . $link . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-info', array('title' => $this->getLanguageService()->getLL('edit-sys_action'))) . $this->getLanguageService()->getLL('edit-sys_action') . '</a>';
+                               $title = 'title="' . $this->getLanguageService()->getLL('edit-sys_action') . '"';
+                               $icon = $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL);
+                               $editActionLink = '<a class="edit" href="' . $link . '"' . $title . '>';
+                               $editActionLink .= $icon . $this->getLanguageService()->getLL('edit-sys_action') . '</a>';
                        }
                        $actionList[] = array(
                                'uid' => $actionRow['uid'],
@@ -743,7 +746,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface {
                                                        . '&id=' . '&SET[function]=search' . '&SET[search]=query'
                                                        . '&storeControl[STORE]=-' . $record['uid'] . '&storeControl[LOAD]=1')
                                                . '">'
-                                               . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-info')
+                                               . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)
                                                . $this->getLanguageService()->getLL(($queryIsEmpty ? 'action_createQuery'
                                                : 'action_editQuery')) . '</a><br /><br />';
                                }