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 {
*/
public function DB_history($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;
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\Resource\Folder;
use TYPO3\CMS\Core\Resource\ProcessedFile;
use TYPO3\CMS\Core\Resource\ResourceFactory;
......@@ -102,10 +104,16 @@ class ElementInformationController {
*/
protected $titleTag;
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* Constructor
*/
public function __construct() {
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$GLOBALS['SOBE'] = $this;
$this->init();
......@@ -570,7 +578,7 @@ class ElementInformationController {
) . '; return false;';
$pageActionIcons .= '
<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>';
if ($table === 'pages') {
......
......@@ -21,6 +21,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\DataHandling\DataHandler;
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\FlashMessageService;
use TYPO3\CMS\Core\Page\PageRenderer;
......@@ -412,12 +414,18 @@ class EditDocumentController {
*/
protected $previewData = [];
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* Constructor
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_alt_doc.xlf');
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
}
/**
......@@ -1179,7 +1187,7 @@ class EditDocumentController {
)
)
) . '; 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 ($this->columnsOnly) {
......
......@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Controller;
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\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
......@@ -298,6 +300,11 @@ class PageLayoutController {
*/
public $contentElementCache = array();
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* Initializing the module
*
......@@ -1106,6 +1113,9 @@ class PageLayoutController {
* @return array all available buttons as an assoc. array
*/
protected function getButtons($function = '') {
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$lang = $this->getLanguageService();
$buttons = array(
'view' => '',
......@@ -1237,7 +1247,7 @@ class PageLayoutController {
)
) . '#latest'
) . ');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;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Belog\Domain\Model\HistoryEntry;
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\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
......@@ -63,6 +65,8 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
$historyEntry = $historyEntryRepository->findOneBySysLogUid($arguments['uid']);
/** @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext */
$controllerContext = $renderingContext->getControllerContext();
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
if (!$historyEntry instanceof HistoryEntry) {
return '';
......@@ -72,9 +76,11 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
$controllerContext->getRequest()->getControllerExtensionName(),
array($historyEntry->getFieldlist())
);
$historyIcon = IconUtility::getSpriteIcon('actions-document-history-open', array(
'title' => LocalizationUtility::translate('showHistory', $controllerContext->getRequest()->getControllerExtensionName())
));
$titleLable = LocalizationUtility::translate(
'showHistory',
$controllerContext->getRequest()->getControllerExtensionName()
);
$historyIcon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
$historyHref = BackendUtility::getModuleUrl(
'record_history',
array(
......@@ -82,7 +88,7 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
'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;
}
......
......@@ -56,6 +56,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
'name' => 'download',
)
),
'actions-document-history-open' => array(
'provider' => FontawesomeIconProvider::class,
'options' => array(
'name' => 'history',
)
),
'actions-document-info' => array(
'provider' => FontawesomeIconProvider::class,
'options' => array(
......
......@@ -612,8 +612,9 @@ class AdminPanelView {
$id = $GLOBALS['TSFE']->id;
$returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
$icon = IconUtility::getSpriteIcon('actions-document-history-open', array('title' => $this->extGetLL('edit_recordHistory', FALSE)));
$toolBar = '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl))) . '#latest">' . $icon . '</a>';
$icon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
$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) {
$params = '';
if ($GLOBALS['TSFE']->sys_language_uid) {
......@@ -621,14 +622,12 @@ class AdminPanelView {
}
$icon = $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL);
$link = $newContentWizScriptPath . 'id=' . $id . $params . '&returnUrl=' . rawurlencode($returnUrl);
$toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '"' .
$toolBar .= 'title="' . $this->extGetLL('edit_newContentElement', FALSE) . '"">' . $icon . '</a>';
$toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_newContentElement') . '"">' . $icon . '</a>';
}
if ($perms & Permission::PAGE_EDIT) {
$icon = $iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL);
$link = BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => $returnUrl]);
$toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) .
$toolBar .= '" title="' . $this->extGetLL('edit_move_page', FALSE) . '">' . $icon . '</a>';
$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)));
......
......@@ -1267,7 +1267,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\'#latest\');';
$historyAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
. $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');
// Versioning:
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