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($this->linkToCurrentModule(['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($this->linkToCurrentModule(['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 $linkInformation = 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos'];
78 $linkInformation = 'tt_content:new/' . $pid . '/' . $vv;
80 $location = $this->linkToCurrentModule(['edit_record' => $linkInformation]);
81 return 'jumpToUrl(' . GeneralUtility
::quoteJSvalue($location) . ');return false;';
85 * Wrapping the record header (from getRecordHeader())
87 * @param string $str HTML content
88 * @param array $row Record array.
89 * @return string HTML content
91 public function wrapRecordHeader($str, $row)
93 if ($row['uid'] == $this->moveUid
) {
94 /** @var IconFactory $iconFactory */
95 $iconFactory = GeneralUtility
::makeInstance(IconFactory
::class);
96 return $iconFactory->getIcon('status-status-current', Icon
::SIZE_SMALL
)->render() . $str;
103 * Returns URL to the current script.
104 * In particular the "popView" and "new_unique_uid" Get vars are unset.
106 * @param array $params Parameters array, merged with global GET vars.
109 protected function linkToCurrentModule($params)
111 unset($params['popView']);
112 unset($params['new_unique_uid']);
113 return GeneralUtility
::linkThisScript($params);