[TASK] Replace icon by IconFactory: status-warning-in-use 28/43228/3
authorMichael Oehlhof <typo3@oehlhof.de>
Sat, 12 Sep 2015 08:27:30 +0000 (10:27 +0200)
committerNicole Cordes <typo3@cordes.co>
Sat, 12 Sep 2015 10:56:26 +0000 (12:56 +0200)
Resolves: #69696
Releases: master
Change-Id: I34ad88ae8713e07b7a084b3ba3646b61176c0c1f
Reviewed-on: http://review.typo3.org/43228
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Jan Helke <typo3@helke.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Classes/View/PageTreeView.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index e6708da..31c03f9 100644 (file)
@@ -662,7 +662,7 @@ class InlineRecordContainer extends AbstractContainer {
                if ($lockInfo = BackendUtility::isRecordLocked($foreign_table, $rec['uid'])) {
                        $cells['locked'] = '
                                <a class="btn btn-default" href="#" onclick="alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg']) . ');return false;">
-                                       ' . IconUtility::getSpriteIcon('status-warning-in-use', array('title' => $lockInfo['msg'])) . '
+                                       ' . '<span title="' . htmlspecialchars($lockInfo['msg']) . '">' . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL) . '</span>' . '
                                </a>';
                }
                // Hook: Post-processing of single controls for specific child records:
index 2b08b58..1d08d1e 100644 (file)
@@ -329,9 +329,7 @@ class Commands {
                $lockInfo = BackendUtility::isRecordLocked('pages', $record['uid']);
                if (is_array($lockInfo)) {
                        $qtip .= '<br />' . htmlspecialchars($lockInfo['msg']);
-                       $prefix .= IconUtility::getSpriteIcon('status-warning-in-use', array(
-                               'class' => 'typo3-pagetree-status'
-                       ));
+                       $prefix .= '<span class="typo3-pagetree-status">' . $iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL) . '</span>';
                }
                // Call stats information hook
                $stat = '';
index f5d7508..c06ca3d 100644 (file)
@@ -1288,7 +1288,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                if ($lockInfo = BackendUtility::isRecordLocked('tt_content', $row['uid'])) {
                        $additionalIcons[] = '<a href="#" onclick="alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg'])
                                . ');return false;" title="' . htmlspecialchars($lockInfo['msg']) . '">'
-                               . IconUtility::getSpriteIcon('status-warning-in-use') . '</a>';
+                               . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL) . '</a>';
                }
                // Call stats information hook
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
index b75706a..a6a3d41 100644 (file)
@@ -16,7 +16,8 @@ namespace TYPO3\CMS\Backend\View;
 
 use TYPO3\CMS\Backend\Tree\View\BrowseTreeView;
 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;
 
 /**
@@ -71,10 +72,13 @@ class PageTreeView extends BrowseTreeView {
         * @return string Page icon
         */
        public function wrapIcon($thePageIcon, &$row) {
+               /** @var $iconFactory IconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);;
                // If the record is locked, present a warning sign.
                if ($lockInfo = BackendUtility::isRecordLocked('pages', $row['uid'])) {
                        $aOnClick = 'alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg']) . ');return false;';
-                       $lockIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . IconUtility::getSpriteIcon('status-warning-in-use', array('title' => $lockInfo['msg'])) . '</a>';
+                       $lockIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">'
+                               . '<span title="' . htmlspecialchars($lockInfo['msg']) . '">' . $iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL) . '</span></a>';
                } else {
                        $lockIcon = '';
                }
index 7fc12b1..bf9ac0a 100644 (file)
@@ -774,6 +774,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'source' => 'EXT:t3skin/images/icons/status/warning-lock.png',
                        )
                ),
+               'status-warning-in-use' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:t3skin/images/icons/status/warning-in-use.png',
+                       )
+               ),
                'status-status-permission-granted' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index 12a2ad0..70994d2 100644 (file)
@@ -758,7 +758,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                        $warning = '<a href="#" onclick="alert('
                                                . GeneralUtility::quoteJSvalue($lockInfo['msg']) . '); return false;" title="'
                                                . htmlspecialchars($lockInfo['msg']) . '">'
-                                               . IconUtility::getSpriteIcon('status-warning-in-use') . '</a>';
+                                               . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL) . '</a>';
                                }
                                $theData[$fCol] = $theData['__label'] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
                                // Render thumbnails, if: