Skip to content
Snippets Groups Projects
Commit fcfa8af9 authored by Benjamin Mack's avatar Benjamin Mack Committed by Wouter Wolters
Browse files

[TASK] Migrate ViewPageIcon to Sprite Icon

There are still some small places where
sprite icons are not used yet.

One is the link to the view page icon.
The call within document template
is only used twice in the core:
1. DocumentTemplate->getHeader()
2. ElementInformationController

The patch replaces the hard-coded
image tag with a sprite icon.

As this function is hardly used,
you need to know where to test:
- Go to the Info module
=> PageTSconfig
=> ViewTSconfig fieldContent
=> Choose a page in the pagetree which
is not the root page.
On the bottom you see the TSconfig
for each page, with the search
icon and the new icon once
the patch is applied.

Releases: master
Resolves: #63138
Change-Id: I8d2eaf8fe9a6cf8a6664fcaa33223ac72d637795
Reviewed-on: http://review.typo3.org/34464


Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
parent 2139e863
Branches
Tags
No related merge requests found
......@@ -515,23 +515,22 @@ function jumpToUrl(URL) {
/**
* Makes link to page $id in frontend (view page)
* Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id
* Returns an icon which links to the frontend index.php document for viewing the page with id $id
* $id must be a page-uid
* If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)
*
* @param int $id The page id
* @param string $backPath The current "BACK_PATH" (the back relative to the typo3/ directory)
* @param string $addParams Additional parameters for the image tag(s)
* @return string HTML string with linked icon(s)
*/
public function viewPageIcon($id, $backPath, $addParams = 'hspace="3"') {
public function viewPageIcon($id, $backPath) {
// If access to Web>List for user, then link to that module.
$str = BackendUtility::getListViewLink(array(
'id' => $id,
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showList'));
// Make link to view page
$str .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($id, $backPath, BackendUtility::BEgetRootLine($id))) . '">' . '<img' . IconUtility::skinImg($backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '"' . ($addParams ? ' ' . trim($addParams) : '') . ' hspace="3" alt="" />' . '</a>';
$str .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($id, $backPath, BackendUtility::BEgetRootLine($id))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
return $str;
}
......@@ -569,7 +568,7 @@ function jumpToUrl(URL) {
if (is_array($row) && $row['uid']) {
$iconImgTag = IconUtility::getSpriteIconForRecord($table, $row, array('title' => htmlspecialchars($path)));
$title = strip_tags(BackendUtility::getRecordTitle($table, $row));
$viewPage = $noViewPageIcon ? '' : $this->viewPageIcon($row['uid'], $this->backPath, '');
$viewPage = $noViewPageIcon ? '' : $this->viewPageIcon($row['uid'], $this->backPath);
if ($table == 'pages') {
$path .= ' - ' . BackendUtility::titleAttribForPages($row, '', 0);
}
......
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