[TASK] Replace icon by the IconFactory apps-pagetree-root 13/43113/2
authorFrank Nägler <frank.naegler@typo3.org>
Mon, 7 Sep 2015 22:32:08 +0000 (00:32 +0200)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Tue, 8 Sep 2015 08:05:49 +0000 (10:05 +0200)
Resolves: #69599
Releases: master
Change-Id: I5f7416074f643ddc4038a6b9625ba519328cf8fa
Reviewed-on: http://review.typo3.org/43113
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Build/Gruntfile.js
Build/Resources/Private/Icons/App/apps-pagetree-root.svg [new file with mode: 0644]
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Resources/Public/Icons/App/apps-pagetree-root.svg [new file with mode: 0644]
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php

index a6172ae..dfa63e4 100644 (file)
@@ -149,6 +149,12 @@ module.exports = function(grunt) {
                                        '<%= paths.backend %>Public/Icons/Action/actions-system-help-open.svg': '<%= paths.icons %>Action/actions-system-help-open.svg'
                                }
                        },
+                       // Action Icons
+                       icons_apps: {
+                               files: {
+                                       '<%= paths.backend %>Public/Icons/App/apps-pagetree-root.svg': '<%= paths.icons %>App/apps-pagetree-root.svg',
+                               }
+                       },
                        // Avatar Icons
                        icons_avatar: {
                                files: {
diff --git a/Build/Resources/Private/Icons/App/apps-pagetree-root.svg b/Build/Resources/Private/Icons/App/apps-pagetree-root.svg
new file mode 100644 (file)
index 0000000..478cf80
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   width="16"
+   height="16"
+   viewBox="0 0 16 16"
+   id="svg6217"
+   version="1.1">
+  <defs
+     id="defs6219">
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath20">
+      <path
+         d="m 0,841.89 595.275,0 L 595.275,0 0,0 0,841.89 Z"
+         id="path22" />
+    </clipPath>
+  </defs>
+  <metadata
+     id="metadata6222">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="matrix(0,1,-1,0,0.95913124,48.25)"
+     id="g4198"
+     style="stroke:#000000;stroke-width:2;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" />
+  <g
+     transform="matrix(0,1,-1,0,0.959131,48.25)"
+     id="g4198-3"
+     style="stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.68488746" />
+  <g
+     transform="matrix(0,1,-1,0,0.95913124,48.25)"
+     id="g4198-2"
+     style="stroke:#000000;stroke-width:2;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" />
+  <g
+     transform="matrix(0,-1,1,0,13.959142,-32.216101)"
+     id="g4198-3-6-3" />
+  <g
+     id="g10"
+     transform="matrix(0.19778114,0,0,-0.19778114,-44.688896,125.87755)">
+    <path
+       d="m 286.8923,580.69821 c -1.201,-0.354 -2.158,-0.476 -3.41,-0.476 -10.272,0 -25.36,35.896 -25.36,47.843 0,4.401 1.045,5.868 2.514,7.125 -12.574,-1.466 -27.664,-6.078 -32.486,-11.946 -1.047,-1.468 -1.676,-3.773 -1.676,-6.706 0,-18.654 19.91,-60.987 33.953,-60.987 6.496,0 17.453,10.688 26.465,25.147"
+       style="fill:#8c8c8c;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       id="path30" />
+    <path
+       d="m 280.3357,636.44871 c 12.994,0 25.99,-2.096 25.99,-9.431 0,-14.881 -9.431,-32.905 -14.252,-32.905 -8.592,0 -19.281,23.891 -19.281,35.838 0,5.449 2.096,6.498 7.543,6.498"
+       style="fill:#8c8c8c;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       id="path34" />
+  </g>
+</svg>
index 92c05f6..9da47a2 100644 (file)
@@ -393,7 +393,7 @@ class ClickMenu {
                        $this->rec = array();
                }
                // Return the printed elements:
-               return $this->printItems($menuItems, $root ? IconUtility::getSpriteIcon('apps-pagetree-root') . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) : IconUtility::getSpriteIconForRecord($table, $this->rec, array('title' => htmlspecialchars(BackendUtility::getRecordIconAltText($this->rec, $table)))) . BackendUtility::getRecordTitle($table, $this->rec, TRUE));
+               return $this->printItems($menuItems, $root ? $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL) . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) : IconUtility::getSpriteIconForRecord($table, $this->rec, array('title' => htmlspecialchars(BackendUtility::getRecordIconAltText($this->rec, $table)))) . BackendUtility::getRecordTitle($table, $this->rec, TRUE));
        }
 
        /**
@@ -453,7 +453,7 @@ class ClickMenu {
                if (!is_array($menuItems)) {
                        $menuItems = array();
                }
-               return $this->printItems($menuItems, $root ? IconUtility::getSpriteIcon('apps-pagetree-root') . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) : IconUtility::getSpriteIconForRecord($table, $this->rec, array('title' => htmlspecialchars(BackendUtility::getRecordIconAltText($this->rec, $table)))) . BackendUtility::getRecordTitle($table, $this->rec, TRUE));
+               return $this->printItems($menuItems, $root ? $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL) . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) : IconUtility::getSpriteIconForRecord($table, $this->rec, array('title' => htmlspecialchars(BackendUtility::getRecordIconAltText($this->rec, $table)))) . BackendUtility::getRecordTitle($table, $this->rec, TRUE));
        }
 
        /**
index 8cec9a8..7359986 100644 (file)
@@ -273,7 +273,7 @@ class NewRecordController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                                $iconImgTag = IconUtility::getSpriteIconForRecord('pages', $this->pageinfo, array('title' => htmlspecialchars($this->pageinfo['_thePath'])));
                                $title = strip_tags($this->pageinfo[$GLOBALS['TCA']['pages']['ctrl']['label']]);
                        } else {
-                               $iconImgTag = IconUtility::getSpriteIcon('apps-pagetree-root', array('title' => htmlspecialchars($this->pageinfo['_thePath'])));
+                               $iconImgTag = '<span title="' . htmlspecialchars($this->pageinfo['_thePath']) . '">' . $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL) . '</span>';
                                $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                        }
                        $this->code = '<span class="typo3-moduleHeader">' . $this->doc->wrapClickMenuOnIcon($iconImgTag, 'pages', $this->pageinfo['uid']) . htmlspecialchars(GeneralUtility::fixed_lgd_cs($title, 45)) . '</span><br />';
@@ -500,7 +500,7 @@ class NewRecordController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                                                                }
                                                                $_EXTKEY = 'system';
                                                                $thisTitle = $lang->getLL('system_records');
-                                                               $iconFile['system'] = IconUtility::getSpriteIcon('apps-pagetree-root');
+                                                               $iconFile['system'] = $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL);
                                                        }
                                                        if ($groupName == '' || $groupName != $_EXTKEY) {
                                                                $groupName = empty($v['ctrl']['groupName']) ? $_EXTKEY : $v['ctrl']['groupName'];
index 9c97f7b..73de2bd 100644 (file)
@@ -1865,7 +1865,7 @@ function jumpToUrl(URL) {
                } else {
                        // On root-level of page tree
                        // Make Icon
-                       $iconImg = IconUtility::getSpriteIcon('apps-pagetree-root', array('title' => htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'])));
+                       $iconImg = '<span title="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '">' . $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL) . '</span>';
                        if ($GLOBALS['BE_USER']->user['admin']) {
                                $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
                        } else {
index 1d647ff..2b08b58 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Tree\Pagetree;
 
 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\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
@@ -288,6 +290,7 @@ class Commands {
         * @return \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode
         */
        static public function getNewNode($record, $mountPoint = 0) {
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                if (self::$titleLength === NULL) {
                        self::$useNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
                        self::$addIdAsPrefix = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
@@ -346,7 +349,7 @@ class Commands {
                if ((int)$record['uid'] !== 0) {
                        $spriteIconCode = IconUtility::getSpriteIconForRecord('pages', $record);
                } else {
-                       $spriteIconCode = IconUtility::getSpriteIcon('apps-pagetree-root');
+                       $spriteIconCode = $iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL)->render();
                }
                $subNode->setSpriteIconCode($spriteIconCode);
                if (
index 38b2f41..54a9345 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Tree\View;
 
 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;
 
 /**
@@ -616,7 +618,8 @@ abstract class AbstractTreeView {
         * @return string Icon image tag.
         */
        public function getRootIcon($rec) {
-               return $this->wrapIcon(IconUtility::getSpriteIcon('apps-pagetree-root'), $rec);
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               return $this->wrapIcon($iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL)->render(), $rec);
        }
 
        /**
diff --git a/typo3/sysext/backend/Resources/Public/Icons/App/apps-pagetree-root.svg b/typo3/sysext/backend/Resources/Public/Icons/App/apps-pagetree-root.svg
new file mode 100644 (file)
index 0000000..8e97a53
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g fill="#8c8c8c"><path d="M12.053 11.026c-.238.07-.427.095-.674.095-2.033 0-5.017-7.1-5.017-9.462 0-.87.207-1.16.497-1.41C4.373.54 1.39 1.452.435 2.613c-.207.29-.332.746-.332 1.326C.103 7.628 4.04 16 6.82 16c1.283 0 3.45-2.114 5.233-4.974M10.756 0c2.57 0 5.14.415 5.14 1.865 0 2.943-1.865 6.508-2.818 6.508-1.7 0-3.814-4.725-3.814-7.088C9.264.207 9.68 0 10.756 0"/></g></svg>
\ No newline at end of file
index dfde624..8e6dcb8 100644 (file)
@@ -52,6 +52,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'star',
                        )
                ),
+               'apps-pagetree-root' => array(
+                       'provider' => SvgIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:backend/Resources/Public/Icons/App/apps-pagetree-root.svg',
+                       )
+               ),
                'actions-document-close' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index da05a94..bf2284d 100644 (file)
@@ -681,7 +681,7 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass i
                                        // If the page is actually the root, handle it differently
                                        // NOTE: we don't compare integers, because the number actually comes from the split string above
                                        if ($referenceParts[1] === '0') {
-                                               $iconAndTitle = IconUtility::getSpriteIcon('apps-pagetree-root') . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
+                                               $iconAndTitle = $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL) . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                                        } else {
                                                $record = BackendUtility::getRecordWSOL('pages', $referenceParts[1]);
                                                $iconAndTitle = IconUtility::getSpriteIconForRecord('pages', $record)