2 namespace TYPO3\CMS\Backend\Tree\View
;
5 * This file is part of the TYPO3 CMS project.
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
17 use TYPO3\CMS\Core\Imaging\Icon
;
18 use TYPO3\CMS\Core\Imaging\IconFactory
;
19 use TYPO3\CMS\Core\Utility\GeneralUtility
;
22 * Position map class for content elements within the page module
24 class ContentLayoutPagePositionMap
extends PagePositionMap
29 public $dontPrintPageInsertIcons = 1;
34 public $l_insertNewRecordHere = 'newContentElement';
37 * Wrapping the title of the record.
39 * @param string $str The title value.
40 * @param array $row The record row.
41 * @return string Wrapped title string.
43 public function wrapRecordTitle($str, $row)
45 $aOnClick = 'jumpToUrl(' . GeneralUtility
::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid'])))) . ');return false;';
46 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
50 * Wrapping the column header
52 * @param string $str Header value
53 * @param string $vv Column info.
55 * @see printRecordMap()
57 public function wrapColumnHeader($str, $vv)
59 $aOnClick = 'jumpToUrl(' . GeneralUtility
::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv)))) . ');return false;';
60 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
64 * Create on-click event value.
66 * @param array $row The record.
67 * @param string $vv Column position value.
68 * @param int $moveUid Move uid
69 * @param int $pid PID value.
70 * @param int $sys_lang System language
73 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
76 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
78 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
80 return 'jumpToUrl(' . GeneralUtility
::quoteJSvalue($location) . ');return false;';
84 * Wrapping the record header (from getRecordHeader())
86 * @param string $str HTML content
87 * @param array $row Record array.
88 * @return string HTML content
90 public function wrapRecordHeader($str, $row)
92 if ($row['uid'] == $this->moveUid
) {
93 /** @var IconFactory $iconFactory */
94 $iconFactory = GeneralUtility
::makeInstance(IconFactory
::class);
95 return $iconFactory->getIcon('status-status-current', Icon
::SIZE_SMALL
)->render() . $str;