[TASK] Replace sprite icon "apps-pagetree-page-domain" with the new IconFactory 07/43207/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 11 Sep 2015 14:36:35 +0000 (16:36 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 11 Sep 2015 14:57:03 +0000 (16:57 +0200)
Replaces all IconUtility::getSpriteIcon calls for the1icon
apps-pagetree-page-domain with the new IconFactory.

Resolves: #69682
Releases: master
Change-Id: Icdfdba2858120eb703c83bb2bf61726c05c2927b
Reviewed-on: http://review.typo3.org/43207
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php

index e1380ab..abde346 100644 (file)
@@ -599,7 +599,7 @@ function jumpToUrl(URL) {
                        $title = strip_tags(BackendUtility::getRecordTitle($table, $row));
                        $viewPage = $noViewPageIcon ? '' : $this->viewPageIcon($row['uid']);
                } else {
-                       $iconImgTag = IconUtility::getSpriteIcon('apps-pagetree-page-domain', array('title' => htmlspecialchars($path)));
+                       $iconImgTag = '<span title="' . htmlspecialchars($path) . '">' . $this->iconFactory->getIcon('apps-pagetree-page-domain', Icon::SIZE_SMALL) . '</span>';
                        $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                }
 
index 0827255..6fad48f 100644 (file)
@@ -64,6 +64,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'th-large',
                        )
                ),
+               'apps-pagetree-page-domain' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:t3skin/images/icons/apps/pagetree-page-domain.png',
+                       )
+               ),
                'apps-pagetree-root' => array(
                        'provider' => SvgIconProvider::class,
                        'options' => array(
index 7c32a10..d3e28e3 100644 (file)
@@ -24,6 +24,8 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 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\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
@@ -79,9 +81,11 @@ class PageInfoViewHelper extends AbstractBackendViewHelper implements Compilable
                        // Setting icon with clickmenu + uid
                        $theIcon .= ' <em>[PID: ' . $pageRecord['uid'] . ']</em>';
                } else {
+                       /** @var IconFactory $iconFactory */
+                       $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                        // On root-level of page tree
                        // Make Icon
-                       $theIcon = IconUtility::getSpriteIcon('apps-pagetree-page-domain', array('title' => htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'])));
+                       $theIcon = '<span title="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '">' . $iconFactory->getIcon('apps-pagetree-page-domain', Icon::SIZE_SMALL) . '</span>';
                        if ($GLOBALS['BE_USER']->user['admin']) {
                                $theIcon = $doc->wrapClickMenuOnIcon($theIcon, 'pages', 0);
                        }