Commit 73116978 authored by Markus Guenther's avatar Markus Guenther Committed by Anja Leichsenring
Browse files

[TASK] Replace sprite icon "actions-document-history-open" with the new IconFactory

Replaces all IconUtility::getSpriteIcon calls for the icon
actions-document-history-open with the new IconFactory.

Change-Id: Ie0432cdced84d145da6bf9749f1275f398861146
Resolves: #68830
Releases: master
Reviewed-on: http://review.typo3.org/42365


Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent d3441386
...@@ -567,7 +567,7 @@ class ClickMenu { ...@@ -567,7 +567,7 @@ class ClickMenu {
*/ */
public function DB_history($table, $uid) { public function DB_history($table, $uid) {
$url = BackendUtility::getModuleUrl('record_history', array('element' => $table . ':' . $uid)); $url = BackendUtility::getModuleUrl('record_history', array('element' => $table . ':' . $uid));
return $this->linkItem($this->languageService->makeEntities($this->languageService->getLL('CM_history')), IconUtility::getSpriteIcon('actions-document-history-open'), $this->urlRefForCM($url, 'returnUrl'), 0); return $this->linkItem($this->languageService->makeEntities($this->languageService->getLL('CM_history')), $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL), $this->urlRefForCM($url, 'returnUrl'), 0);
} }
/** /**
......
...@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement; ...@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Resource\Folder; use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\ProcessedFile;
use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Resource\ResourceFactory;
...@@ -102,10 +104,16 @@ class ElementInformationController { ...@@ -102,10 +104,16 @@ class ElementInformationController {
*/ */
protected $titleTag; protected $titleTag;
/**
* @var IconFactory
*/
protected $iconFactory;
/** /**
* Constructor * Constructor
*/ */
public function __construct() { public function __construct() {
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$GLOBALS['SOBE'] = $this; $GLOBALS['SOBE'] = $this;
$this->init(); $this->init();
...@@ -570,7 +578,7 @@ class ElementInformationController { ...@@ -570,7 +578,7 @@ class ElementInformationController {
) . '; return false;'; ) . '; return false;';
$pageActionIcons .= ' $pageActionIcons .= '
<a class="btn btn-default btn-sm" href="#" onclick="' . htmlspecialchars($historyOnClick) . '"> <a class="btn btn-default btn-sm" href="#" onclick="' . htmlspecialchars($historyOnClick) . '">
' . IconUtility::getSpriteIcon('actions-document-history-open') . ' ' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '
</a>'; </a>';
if ($table === 'pages') { if ($table === 'pages') {
......
...@@ -21,6 +21,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; ...@@ -21,6 +21,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Html\HtmlParser; use TYPO3\CMS\Core\Html\HtmlParser;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Page\PageRenderer;
...@@ -412,12 +414,18 @@ class EditDocumentController { ...@@ -412,12 +414,18 @@ class EditDocumentController {
*/ */
protected $previewData = []; protected $previewData = [];
/**
* @var IconFactory
*/
protected $iconFactory;
/** /**
* Constructor * Constructor
*/ */
public function __construct() { public function __construct() {
$GLOBALS['SOBE'] = $this; $GLOBALS['SOBE'] = $this;
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_alt_doc.xlf'); $this->getLanguageService()->includeLLFile('EXT:lang/locallang_alt_doc.xlf');
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
} }
/** /**
...@@ -1179,7 +1187,7 @@ class EditDocumentController { ...@@ -1179,7 +1187,7 @@ class EditDocumentController {
) )
) )
) . '; return false;'; ) . '; return false;';
$buttons['history'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>'; $buttons['history'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '</a>';
} }
// If only SOME fields are shown in the form, this will link the user to the FULL form: // If only SOME fields are shown in the form, this will link the user to the FULL form:
if ($this->columnsOnly) { if ($this->columnsOnly) {
......
...@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller; ...@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
...@@ -298,6 +300,11 @@ class PageLayoutController { ...@@ -298,6 +300,11 @@ class PageLayoutController {
*/ */
public $contentElementCache = array(); public $contentElementCache = array();
/**
* @var IconFactory
*/
protected $iconFactory;
/** /**
* Initializing the module * Initializing the module
* *
...@@ -1106,6 +1113,9 @@ class PageLayoutController { ...@@ -1106,6 +1113,9 @@ class PageLayoutController {
* @return array all available buttons as an assoc. array * @return array all available buttons as an assoc. array
*/ */
protected function getButtons($function = '') { protected function getButtons($function = '') {
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$lang = $this->getLanguageService(); $lang = $this->getLanguageService();
$buttons = array( $buttons = array(
'view' => '', 'view' => '',
...@@ -1237,7 +1247,7 @@ class PageLayoutController { ...@@ -1237,7 +1247,7 @@ class PageLayoutController {
) )
) . '#latest' ) . '#latest'
) . ');return false;') . '" ) . ');return false;') . '"
title="' . $lang->getLL('recordHistory', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>'; title="' . $lang->getLL('recordHistory', TRUE) . '">' . $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '</a>';
} }
} }
} }
......
...@@ -18,6 +18,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; ...@@ -18,6 +18,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Belog\Domain\Model\HistoryEntry; use TYPO3\CMS\Belog\Domain\Model\HistoryEntry;
use TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository; use TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
...@@ -63,6 +65,8 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt ...@@ -63,6 +65,8 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
$historyEntry = $historyEntryRepository->findOneBySysLogUid($arguments['uid']); $historyEntry = $historyEntryRepository->findOneBySysLogUid($arguments['uid']);
/** @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext */ /** @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext */
$controllerContext = $renderingContext->getControllerContext(); $controllerContext = $renderingContext->getControllerContext();
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
if (!$historyEntry instanceof HistoryEntry) { if (!$historyEntry instanceof HistoryEntry) {
return ''; return '';
...@@ -72,9 +76,11 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt ...@@ -72,9 +76,11 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
$controllerContext->getRequest()->getControllerExtensionName(), $controllerContext->getRequest()->getControllerExtensionName(),
array($historyEntry->getFieldlist()) array($historyEntry->getFieldlist())
); );
$historyIcon = IconUtility::getSpriteIcon('actions-document-history-open', array( $titleLable = LocalizationUtility::translate(
'title' => LocalizationUtility::translate('showHistory', $controllerContext->getRequest()->getControllerExtensionName()) 'showHistory',
)); $controllerContext->getRequest()->getControllerExtensionName()
);
$historyIcon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
$historyHref = BackendUtility::getModuleUrl( $historyHref = BackendUtility::getModuleUrl(
'record_history', 'record_history',
array( array(
...@@ -82,7 +88,7 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt ...@@ -82,7 +88,7 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'), 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
) )
); );
$historyLink = '<a href="' . htmlspecialchars($historyHref) . '">' . $historyIcon . '</a>'; $historyLink = '<a href="' . htmlspecialchars($historyHref) . '" title="' . htmlspecialchars($titleLable) . '">' . $historyIcon . '</a>';
return $historyLabel . '&nbsp;' . $historyLink; return $historyLabel . '&nbsp;' . $historyLink;
} }
......
...@@ -56,6 +56,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface { ...@@ -56,6 +56,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
'name' => 'download', 'name' => 'download',
) )
), ),
'actions-document-history-open' => array(
'provider' => FontawesomeIconProvider::class,
'options' => array(
'name' => 'history',
)
),
'actions-document-info' => array( 'actions-document-info' => array(
'provider' => FontawesomeIconProvider::class, 'provider' => FontawesomeIconProvider::class,
'options' => array( 'options' => array(
......
...@@ -612,8 +612,9 @@ class AdminPanelView { ...@@ -612,8 +612,9 @@ class AdminPanelView {
$id = $GLOBALS['TSFE']->id; $id = $GLOBALS['TSFE']->id;
$returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI'); $returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
$icon = IconUtility::getSpriteIcon('actions-document-history-open', array('title' => $this->extGetLL('edit_recordHistory', FALSE))); $icon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
$toolBar = '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl))) . '#latest">' . $icon . '</a>'; $link = BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl));
$toolBar = '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '#latest" title="' . $this->extGetLL('edit_recordHistory') . '">' . $icon . '</a>';
if ($perms & Permission::CONTENT_EDIT && $langAllowed) { if ($perms & Permission::CONTENT_EDIT && $langAllowed) {
$params = ''; $params = '';
if ($GLOBALS['TSFE']->sys_language_uid) { if ($GLOBALS['TSFE']->sys_language_uid) {
...@@ -621,14 +622,12 @@ class AdminPanelView { ...@@ -621,14 +622,12 @@ class AdminPanelView {
} }
$icon = $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL); $icon = $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL);
$link = $newContentWizScriptPath . 'id=' . $id . $params . '&returnUrl=' . rawurlencode($returnUrl); $link = $newContentWizScriptPath . 'id=' . $id . $params . '&returnUrl=' . rawurlencode($returnUrl);
$toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '"' . $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_newContentElement') . '"">' . $icon . '</a>';
$toolBar .= 'title="' . $this->extGetLL('edit_newContentElement', FALSE) . '"">' . $icon . '</a>';
} }
if ($perms & Permission::PAGE_EDIT) { if ($perms & Permission::PAGE_EDIT) {
$icon = $iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL); $icon = $iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL);
$link = BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => $returnUrl]); $link = BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => $returnUrl]);
$toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_move_page') . '">' . $icon . '</a>';
$toolBar .= '" title="' . $this->extGetLL('edit_move_page', FALSE) . '">' . $icon . '</a>';
} }
if ($perms & Permission::PAGE_NEW) { if ($perms & Permission::PAGE_NEW) {
$icon = IconUtility::getSpriteIcon('actions-page-new', array('title' => $this->extGetLL('edit_newPage', FALSE))); $icon = IconUtility::getSpriteIcon('actions-page-new', array('title' => $this->extGetLL('edit_newPage', FALSE)));
......
...@@ -1267,7 +1267,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList { ...@@ -1267,7 +1267,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\'#latest\');'; $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\'#latest\');';
$historyAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' $historyAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
. $this->getLanguageService()->getLL('history', TRUE) . '">' . $this->getLanguageService()->getLL('history', TRUE) . '">'
. IconUtility::getSpriteIcon('actions-document-history-open') . '</a>'; . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL) . '</a>';
$this->addActionToCellGroup($cells, $historyAction, 'history'); $this->addActionToCellGroup($cells, $historyAction, 'history');
// Versioning: // Versioning:
if (ExtensionManagementUtility::isLoaded('version') && !ExtensionManagementUtility::isLoaded('workspaces')) { if (ExtensionManagementUtility::isLoaded('version') && !ExtensionManagementUtility::isLoaded('workspaces')) {
......
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