Commit a4180e00 authored by Frank Nägler's avatar Frank Nägler Committed by Christian Kuhn
Browse files

[TASK] Remove SpriteManagerIconViewHelper

This patch removes the SpriteManagerIconViewHelper and all
usages within the core.

Resolves: #69531
Releases: master
Change-Id: I75e3c345973a9b51fb26cc1aeb305536e8c77d14
Reviewed-on: http://review.typo3.org/43019


Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 039143d3
......@@ -23,7 +23,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Displays sprite icon identified by iconName key
* Displays icon identified by icon identifier
*/
class IconViewHelper extends AbstractViewHelper implements CompilableInterface {
......
......@@ -93,11 +93,11 @@ The core provides a fluid ViewHelper which makes it really easy to use icons wit
.. code-block:: html
{namespace core = TYPO3\CMS\Core\ViewHelpers}
<core:icon identifier="my-icon-identifier" size="small" />
<!-- use the "default" size if none given ->
<core:icon identifier="my-icon-identifier" />
<!-- use the "small" size if none given ->
<core:icon identifier="my-icon-identifier" />
<core:icon identifier="my-icon-identifier" size="large" />
<core:icon identifier="my-icon-identifier" size="small" overlay="overlay-identifier" />
<core:icon identifier="my-icon-identifier" overlay="overlay-identifier" />
<core:icon identifier="my-icon-identifier" size="default" overlay="overlay-identifier" />
<core:icon identifier="my-icon-identifier" size="large" overlay="overlay-identifier" />
......
......@@ -35,5 +35,5 @@ This ViewHelper has an argument for the new state parameter.
.. code-block:: html
{namespace core = TYPO3\CMS\Core\ViewHelpers}
<core:icon identifier="my-icon-identifier" size="small" state="disabled" />
<core:icon identifier="my-icon-identifier" state="disabled" />
======================================================
Important: #69531 - Remove SpriteManagerIconViewHelper
======================================================
Description
===========
The ``\TYPO3\CMS\Backend\ViewHelpers\SpriteManagerIconViewHelper`` is not used anymore and has been removed.
Use ``\TYPO3\CMS\Core\ViewHelpers\IconViewHelper`` instead
......@@ -15,6 +15,9 @@ namespace TYPO3\CMS\Documentation\Slots;
*/
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\Documentation\ViewHelpers\FormatsViewHelper;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
......@@ -72,9 +75,10 @@ class ExtensionManager {
);
}
} else {
$actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$actions[] = '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
$actions[] = '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
$actions[] = '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
}
}
......
......@@ -14,7 +14,9 @@ namespace TYPO3\CMS\Documentation\ViewHelpers;
* The TYPO3 project - inspiring people to share!
*/
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\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
......@@ -54,10 +56,12 @@ class FormatsViewHelper extends AbstractViewHelper implements CompilableInterfac
static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
$documentTranslation = $arguments['documentTranslation'];
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$emptyIcon = $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render();
$icons = array(
'html' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>',
'pdf' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>',
'sxw' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>'
'html' => '<a class="btn btn-default disabled">' . $emptyIcon . '</a>',
'pdf' => '<a class="btn btn-default disabled">' . $emptyIcon . '</a>',
'sxw' => '<a class="btn btn-default disabled">' . $emptyIcon . '</a>'
);
$formats = $documentTranslation->getFormats();
......@@ -76,7 +80,7 @@ class FormatsViewHelper extends AbstractViewHelper implements CompilableInterfac
if ($extension === 'json') {
$extension = 'js';
}
$output .= 'href="#" onclick="top.TYPO3.Backend.ContentContainer.setUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uri) . ')" class="btn btn-default"';
$output .= 'href="#" onclick="top.TYPO3.Backend.ContentContainer.setUrl(' . GeneralUtility::quoteJSvalue($uri) . ')" class="btn btn-default"';
}
$xliff = 'LLL:EXT:documentation/Resources/Private/Language/locallang.xlf';
......
......@@ -15,6 +15,9 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
*/
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* View helper for configure extension link
......@@ -57,7 +60,8 @@ class ConfigureExtensionViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Link\Act
$this->tag->setContent($content);
$content = $this->tag->render();
} elseif ($forceConfiguration) {
$content = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$content = '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
}
return $content;
......
......@@ -42,7 +42,7 @@ class DownloadExtensionDataViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Link\
$filePrefix = PATH_site . $extension['siteRelPath'];
if (!file_exists(($filePrefix . 'ext_tables.sql')) && !file_exists(($filePrefix . 'ext_tables_static+adt.sql'))) {
return '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
return '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
}
$uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->reset();
......
......@@ -37,17 +37,16 @@ class RemoveExtensionViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Link\Action
* @return string the rendered a tag
*/
public function render($extension) {
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extension['key'])) {
return '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
return '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
}
if (
!in_array($extension['type'], \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallTypes()) ||
$extension['type'] === 'System'
) {
return '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
return '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
}
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$uriBuilder = $this->controllerContext->getUriBuilder();
$action = 'removeExtension';
$uriBuilder->reset();
......
......@@ -15,6 +15,9 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
*/
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* View helper for update script link
......@@ -64,7 +67,8 @@ class UpdateScriptViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Link\ActionVie
$this->tag->setContent(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('extensions-extensionmanager-update-script'));
$tag = $this->tag->render();
} else {
return '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
return '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
}
return $tag;
}
......
......@@ -313,7 +313,7 @@ class FileList extends AbstractRecordList {
*/
public function getTable($rowlist) {
// prepare space icon
$this->spaceIcon = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$this->spaceIcon = '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
// @todo use folder methods directly when they support filters
$storage = $this->folderObject->getStorage();
......@@ -935,7 +935,7 @@ class FileList extends AbstractRecordList {
} elseif ($fileOrFolderObject instanceof File) {
$infoOnClick = 'top.launchView( \'_FILE\', ' . GeneralUtility::quoteJSvalue($fullIdentifier) . ');return false;';
}
$cells['info'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($infoOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.info') . '">' . IconUtility::getSpriteIcon('status-dialog-information') . '</a>';
$cells['info'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($infoOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.info') . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '</a>';
} else {
$cells['info'] = $this->spaceIcon;
}
......
......@@ -19,6 +19,8 @@ use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Database\QueryView;
use TYPO3\CMS\Core\Database\ReferenceIndex;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Integrity\DatabaseIntegrityCheck;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility;
......@@ -389,7 +391,8 @@ class DatabaseIntegrityView extends BaseScriptClass {
if (is_array($admin->lRecords[$t])) {
foreach ($admin->lRecords[$t] as $data) {
if (!GeneralUtility::inList($admin->lostPagesList, $data['pid'])) {
$lr .= '<div class="record"><a href="' . htmlspecialchars((BackendUtility::getModuleUrl('system_dbint') . '&SET[function]=records&fixLostRecords_table=' . $t . '&fixLostRecords_uid=' . $data['uid'])) . '">' . IconUtility::getSpriteIcon('status-dialog-error', array('title' => $lang->getLL('fixLostRecord'))) . '</a>uid:' . $data['uid'] . ', pid:' . $data['pid'] . ', ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(strip_tags($data['title']), 20)) . '</div>';
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$lr .= '<div class="record"><a href="' . htmlspecialchars((BackendUtility::getModuleUrl('system_dbint') . '&SET[function]=records&fixLostRecords_table=' . $t . '&fixLostRecords_uid=' . $data['uid'])) . '" title="' . $lang->getLL('fixLostRecord', TRUE) . '">' . $iconFactory->getIcon('status-dialog-error', Icon::SIZE_SMALL)->render() . '</a>uid:' . $data['uid'] . ', pid:' . $data['pid'] . ', ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(strip_tags($data['title']), 20)) . '</div>';
} else {
$lr .= '<div class="record-noicon">uid:' . $data['uid'] . ', pid:' . $data['pid'] . ', ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(strip_tags($data['title']), 20)) . '</div>';
}
......
......@@ -1704,7 +1704,7 @@ class ElementBrowser {
$ATag_e = '</a>';
}
}
$pBicon = $ATag2 ? IconUtility::getSpriteIcon('actions-edit-add') : '';
$pBicon = $ATag2 ? $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() : '';
$pText = htmlspecialchars(GeneralUtility::fixed_lgd_cs($mainPageRec['title'], $titleLen));
$out .= $picon . $ATag2 . $pBicon . $ATag_e . $ATag . $pText . $ATag_e . '<br />';
// Initialize the record listing:
......@@ -1981,7 +1981,7 @@ class ElementBrowser {
$lines[] = '
<tr class="file_list_normal">
<td nowrap="nowrap">' . $filenameAndIcon . '&nbsp;</td>
<td>' . $ATag . IconUtility::getSpriteIcon('actions-edit-add', array('title' => $lang->getLL('addToList', TRUE))) . $ATag_e . '</td>
<td>' . $ATag . '<span title="' . $lang->getLL('addToList', TRUE) . '">' . $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() . '</span>' . $ATag_e . '</td>
<td nowrap="nowrap"><a href="' . htmlspecialchars($Ahref) . '" title="' . $lang->getLL('info', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . $lang->getLL('info', TRUE) . $ATag2_e . '</td>
<td nowrap="nowrap">&nbsp;' . $pDim . '</td>
</tr>';
......@@ -1993,7 +1993,7 @@ class ElementBrowser {
$lines[] = '
<tr class="file_list_normal">
<td nowrap="nowrap">' . $filenameAndIcon . '&nbsp;</td>
<td>' . $ATag . IconUtility::getSpriteIcon('actions-edit-add', array('title' => $lang->getLL('addToList', TRUE))) . $ATag_e . '</td>
<td>' . $ATag . '<span title="' . $lang->getLL('addToList', TRUE) . '">' . $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() . '</span>' . $ATag_e . '</td>
<td nowrap="nowrap"><a href="' . htmlspecialchars($Ahref) . '" title="' . $lang->getLL('info', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . $lang->getLL('info', TRUE) . $ATag2_e . '</td>
<td>&nbsp;</td>
</tr>';
......@@ -2089,7 +2089,7 @@ class ElementBrowser {
$lines[] = '
<tr class="bgColor4">
<td nowrap="nowrap">' . $foldernameAndIcon . '&nbsp;</td>
<td>' . $aTag . IconUtility::getSpriteIcon('actions-edit-add', array('title' => $lang->getLL('addToList', TRUE))) . $aTag_e . ' </td>
<td>' . $aTag . '<span title="' . $lang->getLL('addToList', TRUE) . '">' . $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() . '</span>' . $aTag_e . ' </td>
<td>&nbsp;</td>
</tr>';
}
......@@ -2186,7 +2186,7 @@ class ElementBrowser {
<td nowrap="nowrap">' . $filenameAndIcon . '&nbsp;</td>
<td nowrap="nowrap">' . ($imgInfo[0] != $IW
? '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('noLimit' => '1')))
. '">' . IconUtility::getSpriteIcon('status-dialog-warning', array('title' => $lang->getLL('clickToRedrawFullSize', TRUE)))
. '" title="' . $lang->getLL('clickToRedrawFullSize', TRUE) . '">' . $this->iconFactory->getIcon('status-dialog-warning', Icon::SIZE_SMALL)->render()
. '</a>'
: '')
. $pDim . '&nbsp;</td>
......
......@@ -358,7 +358,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
&& !$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'];
$tableCollapsed = (bool)$this->tablesCollapsed[$table];
// prepare space icon
$this->spaceIcon = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$this->spaceIcon = '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
// Cleaning rowlist for duplicates and place the $titleCol as the first column always!
$this->fieldArray = array();
// title Column
......
......@@ -988,7 +988,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
$lastExecution = '-';
$isRunning = FALSE;
$showAsDisabled = FALSE;
$startExecutionElement = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
$startExecutionElement = '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>';
// Restore the serialized task and pass it a reference to the scheduler object
/** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
$task = unserialize($schedulerRecord['serialized_task_object']);
......@@ -1134,10 +1134,10 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
. '<td class="right">' . $schedulerRecord['uid'] . '</td>'
. '<td colspan="6">' . $executionStatusOutput . '</td>'
. '<td nowrap="nowrap"><div class="btn-group" role="group">'
. '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>'
. '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>'
. '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>'
. '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>'
. $deleteAction
. '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>'
. '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL) . '</span>'
. '</div></td>'
. '</tr>';
}
......
......@@ -7856,9 +7856,21 @@ button.close {
.icon-actions-edit-copy-release,
.icon-actions-edit-cut-release,
.icon-overlay-read-only,
.icon-status-status-current {
.icon-status-status-current,
.icon-status-dialog-error,
.icon-status-status-permission-denied {
color: #c83c3c;
}
.icon-status-dialog-ok,
.icon-status-status-permission-granted {
color: #79a548;
}
.icon-status-dialog-notification {
color: #333333;
}
.icon-status-dialog-warning {
color: #e8a33d;
}
.clearfix:before,
.clearfix:after,
.dl-horizontal dd:before,
......
......@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Workspaces\Backend\ToolbarItems;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Workspaces\Service\WorkspaceService;
......@@ -80,12 +82,10 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface {
$languageService = $this->getLanguageService();
$index = 0;
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$activeWorkspace = (int)$backendUser->workspace;
$stateCheckedIcon = IconUtility::getSpriteIcon('status-status-checked');
$stateUncheckedIcon = IconUtility::getSpriteIcon('empty-empty', array(
'title' => $languageService->getLL('bookmark_inactive')
));
$stateUncheckedIcon = '<span title="' . $languageService->getLL('bookmark_inactive', TRUE) . '">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
$workspaceSections = array(
'top' => array(),
'items' => array(),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment