[TASK] Centralize duplicated SpriteManagerIconViewHelper 48/37848/3
authorFrank Nägler <typo3@naegler.net>
Sat, 14 Mar 2015 23:17:29 +0000 (00:17 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 15 Mar 2015 15:39:37 +0000 (16:39 +0100)
This patch removes the SpriteManagerIconViewHelper (duplicated with
#65111) from EXT:beuser and changes the templates to use the original
one from EXT:backend.

Resolves: #65737
Releases: master
Change-Id: I85ef64404d358b6e9fcb409957f65518c9e3a36f
Reviewed-on: http://review.typo3.org/37848
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/beuser/Classes/ViewHelpers/SpriteManagerIconViewHelper.php [deleted file]
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Compare.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html
typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html

diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SpriteManagerIconViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SpriteManagerIconViewHelper.php
deleted file mode 100644 (file)
index ee7f293..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-namespace TYPO3\CMS\Beuser\ViewHelpers;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\IconUtility;
-use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-
-/**
- * Displays sprite icon identified by iconName key
- *
- * @author Felix Kopp <felix-source@phorax.com>
- * @internal
- */
-class SpriteManagerIconViewHelper extends AbstractViewHelper implements CompilableInterface {
-
-       /**
-        * Prints sprite icon html for $iconName key
-        *
-        * @param string $iconName
-        * @param array $options
-        * @return string
-        */
-       public function render($iconName, $options = array()) {
-               return self::renderStatic(array('iconName' => $iconName, 'options' => $options), $this->buildRenderChildrenClosure(), $this->renderingContext);
-       }
-
-       /**
-        * Print sprite icon html for $iconName key
-        *
-        * @param array $arguments
-        * @param \Closure $renderChildrenClosure
-        * @param RenderingContextInterface $renderingContext
-        * @return string
-        */
-       static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
-               $iconName = $arguments['iconName'];
-               $options = $arguments['options'];
-               return IconUtility::getSpriteIcon($iconName, $options);
-       }
-
-}
index b6132c9..af0d708 100644 (file)
@@ -1,3 +1,4 @@
+{namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
 
 <tr>
                </f:if>
        </td>
        <td class="col-control">
-               <f:link.action action="addToCompareList" arguments="{uid: backendUser.uid}" class="btn btn-default"><bu:spriteManagerIcon iconName="actions-edit-add"/> <f:translate key="compare" /></f:link.action>
+               <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;"><bu:spriteManagerIcon iconName="actions-document-info" /></a>
-                       <a class="btn btn-default" href="alt_doc.php?edit[be_users][{backendUser.uid}]=edit&amp;returnUrl={returnUrl}"><bu:spriteManagerIcon iconName="actions-document-open" /></a>
+                       <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="alt_doc.php?edit[be_users][{backendUser.uid}]=edit&amp;returnUrl={returnUrl}"><be:spriteManagerIcon iconName="actions-document-open" /></a>
                        <f:if condition="{backendUser.currentlyLoggedIn} == 1">
                                <f:then>
-                                       <span class="btn btn-default disabled"><bu:spriteManagerIcon iconName="empty-empty" /></span>
+                                       <span class="btn btn-default disabled"><be:spriteManagerIcon iconName="empty-empty" /></span>
                                </f:then>
                                <f:else>
                                        <f:if condition="{backendUser.isDisabled} == 1">
                                                <f:then>
-                                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{backendUser.uid}][disable]=0', redirectUrl: redirectUrl)}"><bu:spriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" /></a>
+                                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{backendUser.uid}][disable]=0', redirectUrl: redirectUrl)}"><be:spriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" /></a>
                                                </f:then>
                                                <f:else>
-                                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{backendUser.uid}][disable]=1', redirectUrl: redirectUrl)}"><bu:spriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" /></a>
+                                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{backendUser.uid}][disable]=1', redirectUrl: redirectUrl)}"><be:spriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" /></a>
                                                </f:else>
                                        </f:if>
                                </f:else>
index feda270..7d61cbd 100644 (file)
@@ -1,3 +1,4 @@
+{namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
 
 <f:for each="{onlineUser.sessions}" as="session" iteration="it">
                                                        arguments="{backendUser: onlineUser.backendUser, sessionId: session.id}"
                                                        onclick="javascript:return confirm('{f:translate(key: 'reallyLogout')} {onlineUser.backendUser.userName}?');"
                                                >
-                                                       <bu:spriteManagerIcon iconName="actions-document-close" />
+                                                       <be:spriteManagerIcon iconName="actions-document-close" />
                                                        <f:translate key="endSession" />
                                                </f:link.action>
                                        </f:else>
                                </f:if>
                                <a class="btn btn-default" href="#" onclick="top.launchView('be_users', '{onlineUser.backendUser.uid}',''); return false;">
-                                       <bu:SpriteManagerIcon iconName="actions-document-info" />
+                                       <be:spriteManagerIcon iconName="actions-document-info" />
                                </a>
                        </div>
                </td>
index f16d989..ccb3872 100644 (file)
@@ -1,9 +1,10 @@
+{namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
 
 <f:layout name="Default" />
 
 <f:section name="iconButtons">
-       <f:link.action action="index"><bu:spriteManagerIcon iconName="actions-view-go-back" /></f:link.action>
+       <f:link.action action="index"><be:spriteManagerIcon iconName="actions-view-go-back" /></f:link.action>
 </f:section>
 
 <f:section name="headline">
                                                        <f:if condition="{compareUser.isDisabled} == 1">
                                                                <f:then>
                                                                        <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{compareUser.uid}][disable]=0', redirectUrl: redirectUrl)}">
-                                                                               <bu:spriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" />
+                                                                               <be:spriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" />
                                                                        </a>
                                                                </f:then>
                                                                <f:else>
                                                                        <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{compareUser.uid}][disable]=1', redirectUrl: redirectUrl)}">
-                                                                               <bu:spriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" />
+                                                                               <be:spriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" />
                                                                        </a>
                                                                </f:else>
                                                        </f:if>
index 5879767..0915ced 100644 (file)
@@ -1,9 +1,10 @@
+{namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
 
 <f:layout name="Default" />
 
 <f:section name="iconButtons">
-       <a href="#" onclick="window.location.href='alt_doc.php?returnUrl='+T3_THIS_LOCATION+'&amp;edit[be_users][0]=new'; return false;"><bu:spriteManagerIcon iconName="actions-document-new" /></a>
+       <a href="#" onclick="window.location.href='alt_doc.php?returnUrl='+T3_THIS_LOCATION+'&amp;edit[be_users][0]=new'; return false;"><be:spriteManagerIcon iconName="actions-document-new" /></a>
 </f:section>
 
 <f:section name="headline">
@@ -32,7 +33,7 @@
                                                        </td>
                                                        <td>
                                                                <f:link.action action="removeFromCompareList" arguments="{uid: compareUser.uid}" class="pull-right">
-                                                                       <bu:SpriteManagerIcon iconName="actions-selection-delete" />
+                                                                       <be:spriteManagerIcon iconName="actions-selection-delete" />
                                                                </f:link.action>
                                                        </td>
                                                </tr>
index 6d7f7fc..4080d0a 100644 (file)
@@ -1,10 +1,10 @@
-{namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+{namespace be = TYPO3\CMS\Backend\ViewHelpers}
 
 <f:layout name="Permission" />
 
 <f:section name="iconButtons">
        <f:be.buttons.icon uri="{f:uri.action(action:'index')}" icon="actions-view-go-back" />
-       <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><bu:spriteManagerIcon iconName="actions-document-view" /></a>
+       <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><be:spriteManagerIcon iconName="actions-document-view" /></a>
 </f:section>
 
 <f:section name="headline">
index 00fa5c1..799d0db 100644 (file)
@@ -1,9 +1,10 @@
+{namespace be = TYPO3\CMS\Backend\ViewHelpers}
 {namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
 
 <f:layout name="Permission" />
 
 <f:section name="iconButtons">
-       <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><bu:spriteManagerIcon iconName="actions-document-view" /></a>
+       <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><be:spriteManagerIcon iconName="actions-document-view" /></a>
 </f:section>
 
 <f:section name="headline">
@@ -61,7 +62,7 @@
                                                                                                arguments="{id: data.row._ORIG_uid, depth: depth}"
                                                                                                title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:ch_permissions')}"
                                                                                        >
-                                                                                               <bu:spriteManagerIcon iconName="actions-document-open" />
+                                                                                               <be:spriteManagerIcon iconName="actions-document-open" />
                                                                                        </f:link.action>
                                                                                </f:then>
                                                                                <f:else>
@@ -70,7 +71,7 @@
                                                                                                arguments="{id: data.row.uid, depth: depth}"
                                                                                                title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:ch_permissions')}"
                                                                                        >
-                                                                                               <bu:spriteManagerIcon iconName="actions-document-open" />
+                                                                                               <be:spriteManagerIcon iconName="actions-document-open" />
                                                                                        </f:link.action>
                                                                                </f:else>
                                                                        </f:if>
                                                                                                        data-lockstate="1"
                                                                                                        title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock_descr')}"
                                                                                                >
-                                                                                                       <bu:spriteManagerIcon iconName="status-warning-lock" />
+                                                                                                       <be:spriteManagerIcon iconName="status-warning-lock" />
                                                                                                </a>
                                                                                        </f:then>
                                                                                        <f:else>
                                <td nowrap="nowrap"><strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4_t" /></td>
                        </tr>
                        <tr>
-                               <td nowrap="nowrap"><bu:spriteManagerIcon iconName="status-status-permission-granted" options="{class:'text-success'}" /></td>
-                               <td nowrap="nowrap"><bu:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /></td>
-                               <td nowrap="nowrap"><bu:spriteManagerIcon iconName="status-status-permission-granted" options="{class:'text-success'}" /></td>
-                               <td nowrap="nowrap"><bu:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /></td>
-                               <td nowrap="nowrap"><bu:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /></td>
+                               <td nowrap="nowrap"><be:spriteManagerIcon iconName="status-status-permission-granted" options="{class:'text-success'}" /></td>
+                               <td nowrap="nowrap"><be:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /></td>
+                               <td nowrap="nowrap"><be:spriteManagerIcon iconName="status-status-permission-granted" options="{class:'text-success'}" /></td>
+                               <td nowrap="nowrap"><be:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /></td>
+                               <td nowrap="nowrap"><be:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /></td>
                                <td nowrap="nowrap"><span class="number">5</span></td>
                                <td nowrap="nowrap"><strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8_t" /></td>
                        </tr>
        </div>
        <p><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:def" /></p>
        <p>
-               <bu:spriteManagerIcon iconName="status-status-permission-granted" options="{class:'text-success'}" /> <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:A_Granted" /><br/>
-               <bu:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /> <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:A_Denied" />
+               <be:spriteManagerIcon iconName="status-status-permission-granted" options="{class:'text-success'}" /> <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:A_Granted" /><br/>
+               <be:spriteManagerIcon iconName="status-status-permission-denied" options="{class:'text-danger'}" /> <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:A_Denied" />
        </p>
 </f:section>