[TASK] Replace icon by IconFactory: actions-page-new 76/43076/6
authorBenjamin Kott <benjamin.kott@outlook.com>
Sun, 6 Sep 2015 21:16:57 +0000 (23:16 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 7 Sep 2015 18:55:17 +0000 (20:55 +0200)
Resolves: #69569
Releases: master
Change-Id: I11e6434c9bb4007924dd309af5c6c1739222685e
Reviewed-on: http://review.typo3.org/43076
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>
16 files changed:
Build/Gruntfile.js
Build/Resources/Private/Icons/Action/actions-page-new.svg [new file with mode: 0644]
Build/Resources/Public/Less/TYPO3/_element_pagetree.less
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/PageTreeNavigationController.php
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeDataProvider.php
typo3/sysext/backend/Resources/Public/Icons/Action/actions-page-new.svg [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/app.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/toppanel.js
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/feedit/Classes/FrontendEditPanel.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/t3skin/Classes/Slot/IconStyleModifier.php
typo3/sysext/t3skin/Resources/Public/Css/backend.css

index b7b6250..a6172ae 100644 (file)
@@ -140,6 +140,7 @@ module.exports = function(grunt) {
                                        '<%= paths.backend %>Public/Icons/Action/actions-document-save-translation.svg': '<%= paths.icons %>Action/actions-document-save-translation.svg',
                                        '<%= paths.backend %>Public/Icons/Action/actions-document-save-view.svg': '<%= paths.icons %>Action/actions-document-save-view.svg',
                                        '<%= paths.backend %>Public/Icons/Action/actions-document-save.svg': '<%= paths.icons %>Action/actions-document-save.svg',
+                                       '<%= paths.backend %>Public/Icons/Action/actions-page-new.svg': '<%= paths.icons %>Action/actions-page-new.svg',
                                        '<%= paths.backend %>Public/Icons/Action/actions-page-move.svg': '<%= paths.icons %>Action/actions-page-move.svg',
                                        '<%= paths.backend %>Public/Icons/Action/actions-page-open.svg': '<%= paths.icons %>Action/actions-page-open.svg',
                                        '<%= paths.backend %>Public/Icons/Action/actions-system-cache-clear-impact-high.svg': '<%= paths.icons %>Action/actions-system-cache-clear-impact-high.svg',
diff --git a/Build/Resources/Private/Icons/Action/actions-page-new.svg b/Build/Resources/Private/Icons/Action/actions-page-new.svg
new file mode 100644 (file)
index 0000000..3bbcc99
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+        viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g id="actions-page-new">
+       <path d="M10,14H8.5H3V2h6v3.5C9,5.78,9.22,6,9.5,6H13v1.09c0.58,0.21,1,0.76,1,1.41V5.25
+               c0-0.41-0.24-0.99-0.53-1.28l-2.44-2.44C10.74,1.24,10.16,1,9.75,1H2.5C2.22,1,2,1.22,2,1.5v13C2,14.78,2.22,15,2.5,15H10V14z
+                M10,2.06c0.13,0.05,0.27,0.12,0.32,0.17l2.45,2.45c0.05,0.05,0.13,0.19,0.17,0.32H10V2.06z"/>
+       <path d="M15.5,13H13v2.5c0,0.28-0.22,0.5-0.5,0.5h-1c-0.28,0-0.5-0.22-0.5-0.5V13H8.5C8.22,13,8,12.78,8,12.5v-1
+               C8,11.22,8.22,11,8.5,11H11V8.5C11,8.22,11.22,8,11.5,8h1C12.78,8,13,8.22,13,8.5V11h2.5c0.28,0,0.5,0.22,0.5,0.5v1
+               C16,12.78,15.78,13,15.5,13z"/>
+</g>
+</svg>
index 0ae448f..94de453 100644 (file)
@@ -39,9 +39,8 @@
        }
 
        .typo3-pagetree-topPanel-button {
+               margin: 0;
                margin-right: 1px;
-               margin-top: 3px;
-               margin-bottom: -2px;
                padding: 2px 3px 4px 3px;
        }
 
index 8d135e3..468e51a 100644 (file)
@@ -650,7 +650,7 @@ class ClickMenu {
 
                $newContentWizScriptPath = ExtensionManagementUtility::isLoaded($tmpTSc) ? ExtensionManagementUtility::extRelPath($tmpTSc) . 'mod1/db_new_content_el.php?' : BackendUtility::getModuleUrl('new_content_element') . '&';
                $url = $table === 'pages' ? BackendUtility::getModuleUrl('db_new', ['id' => $uid, 'pagesOnly' => 1]) : $newContentWizScriptPath . 'id=' . $rec['pid'] . '&sys_language_uid=' . (int)$rec['sys_language_uid'];
-               return $this->linkItem($this->languageService->makeEntities($this->languageService->getLL('CM_newWizard')), IconUtility::getSpriteIcon('actions-' . ($table === 'pages' ? 'page' : 'document') . '-new'), $this->urlRefForCM($url, 'returnUrl'), 0);
+               return $this->linkItem($this->languageService->makeEntities($this->languageService->getLL('CM_newWizard')), $this->iconFactory->getIcon(($table === 'pages' ? 'actions-page-new' : 'actions-document-new'), Icon::SIZE_SMALL), $this->urlRefForCM($url, 'returnUrl'), 0);
        }
 
        /**
index d0a49bf..0aebdb4 100644 (file)
@@ -316,7 +316,9 @@ class NewRecordController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                if (!$this->pagesOnly) {
                        // New page
                        if ($this->showNewRecLink('pages')) {
-                               $buttons['new_page'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('pagesOnly' => '1'))) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-new') . '</a>';
+                               $buttons['new_page'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('pagesOnly' => '1'))) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newPage', TRUE) . '">'
+                                       . $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
+                                       . '</a>';
                        }
                        // CSH
                        $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_regular');
@@ -397,7 +399,7 @@ class NewRecordController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                $table = 'pages';
                $v = $GLOBALS['TCA'][$table];
                $pageIcon = IconUtility::getSpriteIconForRecord($table, array());
-               $newPageIcon = IconUtility::getSpriteIcon('actions-page-new');
+               $newPageIcon = $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL);
                $rowContent = '';
                // New pages INSIDE this pages
                $newPageLinks = array();
index 1918c11..b5a7ced 100644 (file)
@@ -21,6 +21,8 @@ use TYPO3\CMS\Backend\View\PageTreeView;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -82,9 +84,15 @@ class PageTreeNavigationController {
        public $template;
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * Constructor
         */
        public function __construct() {
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                GeneralUtility::deprecationLog('PageTreeNavigationController is deprecated in favor of new pagetrees');
                $GLOBALS['SOBE'] = $this;
                $this->init();
@@ -226,7 +234,9 @@ class PageTreeNavigationController {
                $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                // New Page
                $onclickNewPageWizard = 'top.content.list_frame.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['pagesOnly' => 1, 'id' => ''])) . '+Tree.pageID;';
-               $buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '" title="' . $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-new') . '</a>';
+               $buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '" title="' . $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newPage', TRUE) . '">'
+                       . $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
+                       . '</a>';
                // Refresh
                $buttons['refresh'] = '<a href="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.refresh', TRUE) . '">' . $iconFactory->getIcon('actions-system-refresh', Icon::SIZE_SMALL)->render() . '</a>';
                // CSH
index 0a0c504..a3c087f 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Backend\Tree\Pagetree;
  */
 
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -31,6 +33,18 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
        protected $dataProvider = NULL;
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+       }
+
+       /**
         * Sets the data provider
         *
         * @return void
@@ -182,12 +196,14 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
                        ),
                        'Sprites' => array(
                                'Filter' => IconUtility::getSpriteIconClasses('actions-system-tree-search-open'),
-                               'NewNode' => IconUtility::getSpriteIconClasses('actions-page-new'),
                                'Refresh' => IconUtility::getSpriteIconClasses('actions-system-refresh'),
                                'InputClear' => IconUtility::getSpriteIconClasses('actions-input-clear'),
                                'TrashCan' => IconUtility::getSpriteIconClasses('actions-edit-delete'),
                                'TrashCanRestore' => IconUtility::getSpriteIconClasses('actions-edit-restore'),
                                'Info' => IconUtility::getSpriteIconClasses('actions-document-info')
+                       ),
+                       'Icons' => array(
+                               'NewNode' => (string)$this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
                        )
                );
                return $configuration;
diff --git a/typo3/sysext/backend/Resources/Public/Icons/Action/actions-page-new.svg b/typo3/sysext/backend/Resources/Public/Icons/Action/actions-page-new.svg
new file mode 100644 (file)
index 0000000..adaad4c
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M10 14H3V2h6v3.5c0 .28.22.5.5.5H13v1.09c.58.21 1 .76 1 1.41V5.25c0-.41-.24-.99-.53-1.28l-2.44-2.44c-.29-.29-.87-.53-1.28-.53H2.5c-.28 0-.5.22-.5.5v13c0 .28.22.5.5.5H10v-1zm0-11.94c.13.05.27.12.32.17l2.45 2.45c.05.05.13.19.17.32H10V2.06z"/><path d="M15.5 13H13v2.5c0 .28-.22.5-.5.5h-1c-.28 0-.5-.22-.5-.5V13H8.5c-.28 0-.5-.22-.5-.5v-1c0-.28.22-.5.5-.5H11V8.5c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5V11h2.5c.28 0 .5.22.5.5v1c0 .28-.22.5-.5.5z"/></svg>
\ No newline at end of file
index 4e16f6f..e0f6425 100644 (file)
@@ -69,6 +69,7 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
                        TYPO3.Components.PageTree.LLL = response['LLL'];
                        TYPO3.Components.PageTree.Configuration = response['Configuration'];
                        TYPO3.Components.PageTree.Sprites = response['Sprites'];
+                       TYPO3.Components.PageTree.Icons = response['Icons'];
 
                        this.mainTree = this.activeTree = new TYPO3.Components.PageTree.Tree({
                                id: this.id + '-tree',
index 7996ccc..92cbd5b 100644 (file)
@@ -434,7 +434,7 @@ TYPO3.Components.PageTree.TopPanel = Ext.extend(Ext.Panel, {
                var topPanelButton = new Ext.Button({
                        id: this.id + '-button-newNode',
                        cls: this.id + '-button',
-                       iconCls: TYPO3.Components.PageTree.Sprites.NewNode,
+                       text: TYPO3.Components.PageTree.Icons.NewNode,
                        tooltip: TYPO3.Components.PageTree.LLL.buttonNewNode
                });
 
index da6111e..6c68c59 100644 (file)
@@ -316,6 +316,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'square-o',
                        )
                ),
+               'actions-page-new' => array(
+                       'provider' => SvgIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-page-new.svg',
+                       )
+               ),
                'actions-page-move' => array(
                        'provider' => SvgIconProvider::class,
                        'options' => array(
index 5f13171..9ed362c 100644 (file)
@@ -133,7 +133,9 @@ class FrontendEditPanel {
                }
                if (isset($allow['new'])) {
                        if ($table === 'pages') {
-                               $icon = IconUtility::getSpriteIcon('actions-page-new', array('title' => $this->backendUser->extGetLL('p_newSubpage')));
+                               $icon = '<span title="' . htmlspecialchars($this->backendUser->extGetLL('p_newSubpage')) . '">'
+                                       . $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
+                                       . '</span>';
                                $panel .= $this->editPanelLinkWrap($icon, $formName, 'new', $currentRecord, '');
                        } else {
                                $icon = IconUtility::getSpriteIcon('actions-document-new', array('title' => $this->backendUser->extGetLL('p_newRecordAfter')));
index 4bb0df6..ed5ed7a 100755 (executable)
@@ -639,8 +639,9 @@ class AdminPanelView {
                        $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)));
-                       $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('db_new', ['id' => $id, 'pagesOnly' => 1, 'returnUrl' => $returnUrl])) . '">' . $icon . '</a>';
+                       $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('db_new', ['id' => $id, 'pagesOnly' => 1, 'returnUrl' => $returnUrl])) . '" title="' . $this->extGetLL('edit_newPage') . '">'
+                               . $iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
+                               . '</a>';
                }
                if ($perms & Permission::PAGE_EDIT) {
                        $icon = $iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL);
index fa1e066..f4ee9d4 100644 (file)
@@ -977,7 +977,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                                $permsAdditional = ($table === 'pages' ? 8 : 16);
                                                if ($this->calcPerms & $permsAdditional && $this->showNewRecLink($table)) {
                                                        $spriteIcon = $table === 'pages'
-                                                               ? IconUtility::getSpriteIcon('actions-page-new')
+                                                               ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
                                                                : IconUtility::getSpriteIcon('actions-document-new');
                                                        if ($table === 'tt_content' && $this->newWizards) {
                                                                // If mod.web_list.newContentWiz.overrideWithExtension is set, use that extension's create new content wizard instead:
@@ -1300,7 +1300,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                if ($table !== 'pages' && $this->calcPerms & Permission::CONTENT_EDIT || $table === 'pages' && $this->calcPerms & Permission::PAGE_NEW) {
                                        if ($this->showNewRecLink($table)) {
                                                $params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
-                                               $icon = ($table == 'pages' ? IconUtility::getSpriteIcon('actions-page-new') : $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL));
+                                               $icon = ($table == 'pages' ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL));
                                                $newAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))
                                                        . '" title="' . $this->getLanguageService()->getLL('new' . ($table == 'pages ' ? 'Page' : 'Record'), TRUE) . '">'
                                                        . $icon . '</a>';
index 043a505..377449b 100644 (file)
@@ -62,7 +62,6 @@ class IconStyleModifier {
                't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-to-top t3-btn t3-btn-moveoption-top' => 'fa-angle-double-up t3-btn t3-btn-moveoption-top',
                't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-up t3-btn t3-btn-moveoption-up' => 'fa-angle-up t3-btn t3-btn-moveoption-up',
                't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-up' => 'fa-angle-up',
-               't3-icon t3-icon-actions t3-icon-actions-page t3-icon-page-new' => 'fa-plus-square',
                // @todo t3-btn-* is still used in FormEngine.js refactor to use data attributes in HTML
                't3-icon t3-icon-actions t3-icon-actions-selection t3-icon-selection-delete t3-btn t3-btn-removeoption' => 'fa-times t3-btn t3-btn-removeoption',
                't3-icon t3-icon-actions t3-icon-actions-selection t3-icon-selection-delete' => 'fa-remove',
index 914de91..3c6e2fb 100644 (file)
@@ -9780,9 +9780,8 @@ ul.typo3-messages {
   margin-bottom: 50px;
 }
 #typo3-pagetree .typo3-pagetree-topPanel-button {
+  margin: 0;
   margin-right: 1px;
-  margin-top: 3px;
-  margin-bottom: -2px;
   padding: 2px 3px 4px 3px;
 }
 #typo3-pagetree .x-toolbar-ct {