106336b5a3273640749e7fcd92468366cf9279cd
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / PagePositionMap.php
1 <?php
2 namespace TYPO3\CMS\Backend\Tree\View;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
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.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Utility\BackendUtility;
18 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
19 use TYPO3\CMS\Core\Database\ConnectionPool;
20 use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
21 use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction;
22 use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
23 use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction;
24 use TYPO3\CMS\Core\Imaging\Icon;
25 use TYPO3\CMS\Core\Imaging\IconFactory;
26 use TYPO3\CMS\Core\Localization\LanguageService;
27 use TYPO3\CMS\Core\Utility\GeneralUtility;
28
29 /**
30 * Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
31 * Used for pages / tt_content element wizards of various kinds.
32 */
33 class PagePositionMap
34 {
35 // EXTERNAL, static:
36 /**
37 * @var string
38 */
39 public $moveOrCopy = 'move';
40
41 /**
42 * @var int
43 */
44 public $dontPrintPageInsertIcons = 0;
45
46 // How deep the position page tree will go.
47 /**
48 * @var int
49 */
50 public $depth = 2;
51
52 // Can be set to the sys_language uid to select content elements for.
53 /**
54 * @var string
55 */
56 public $cur_sys_language;
57
58 // INTERNAL, dynamic:
59 // Request uri
60 /**
61 * @var string
62 */
63 public $R_URI = '';
64
65 // Element id.
66 /**
67 * @var string
68 */
69 public $elUid = '';
70
71 // tt_content element uid to move.
72 /**
73 * @var string
74 */
75 public $moveUid = '';
76
77 // Caching arrays:
78 /**
79 * @var array
80 */
81 public $getModConfigCache = [];
82
83 /**
84 * @var array
85 */
86 public $checkNewPageCache = [];
87
88 // Label keys:
89 /**
90 * @var string
91 */
92 public $l_insertNewPageHere = 'insertNewPageHere';
93
94 /**
95 * @var string
96 */
97 public $l_insertNewRecordHere = 'insertNewRecordHere';
98
99 /**
100 * @var string
101 */
102 public $modConfigStr = 'mod.web_list.newPageWiz';
103
104 /**
105 * Page tree implementation class name
106 *
107 * @var string
108 */
109 protected $pageTreeClassName = ElementBrowserPageTreeView::class;
110
111 /**
112 * @var IconFactory
113 */
114 protected $iconFactory;
115
116 /**
117 * Constructor allowing to set pageTreeImplementation
118 *
119 * @param string $pageTreeClassName
120 */
121 public function __construct($pageTreeClassName = null)
122 {
123 if ($pageTreeClassName !== null) {
124 $this->pageTreeClassName = $pageTreeClassName;
125 }
126 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
127 }
128
129 /*************************************
130 *
131 * Page position map:
132 *
133 **************************************/
134 /**
135 * Creates a "position tree" based on the page tree.
136 *
137 * @param int $id Current page id
138 * @param array $pageinfo Current page record.
139 * @param string $perms_clause Page selection permission clause.
140 * @param string $R_URI Current REQUEST_URI
141 * @return string HTML code for the tree.
142 */
143 public function positionTree($id, $pageinfo, $perms_clause, $R_URI)
144 {
145 // Make page tree object:
146 /** @var \TYPO3\CMS\Backend\Tree\View\PageTreeView $pageTree */
147 $pageTree = GeneralUtility::makeInstance($this->pageTreeClassName);
148 $pageTree->init(' AND ' . $perms_clause);
149 $pageTree->addField('pid');
150 // Initialize variables:
151 $this->R_URI = $R_URI;
152 $this->elUid = $id;
153 // Create page tree, in $this->depth levels.
154 $pageTree->getTree($pageinfo['pid'], $this->depth);
155 // Initialize variables:
156 $saveLatestUid = [];
157 $latestInvDepth = $this->depth;
158 // Traverse the tree:
159 $lines = [];
160 foreach ($pageTree->tree as $cc => $dat) {
161 if ($latestInvDepth > $dat['invertedDepth']) {
162 $margin = 'style="margin-left: ' . ($dat['invertedDepth'] * 16 + 9) . 'px;"';
163 $lines[] = '<ul class="list-tree" ' . $margin . '>';
164 }
165 // Make link + parameters.
166 $latestInvDepth = $dat['invertedDepth'];
167 $saveLatestUid[$latestInvDepth] = $dat;
168 if (isset($pageTree->tree[$cc - 1])) {
169 $prev_dat = $pageTree->tree[$cc - 1];
170 // If current page, subpage?
171 if ($prev_dat['row']['uid'] == $id) {
172 // 1) It must be allowed to create a new page and 2) If there are subpages there is no need to render a subpage icon here - it'll be done over the subpages...
173 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id) && !($prev_dat['invertedDepth'] > $pageTree->tree[$cc]['invertedDepth'])) {
174 end($lines);
175 $margin = 'style="margin-left: ' . (($dat['invertedDepth'] - 1) * 16 + 9) . 'px;"';
176 $lines[] = '<ul class="list-tree" ' . $margin . '><li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li></ul>';
177 }
178 }
179 // If going down
180 if ($prev_dat['invertedDepth'] > $pageTree->tree[$cc]['invertedDepth']) {
181 $prevPid = $pageTree->tree[$cc]['row']['pid'];
182 } elseif ($prev_dat['invertedDepth'] < $pageTree->tree[$cc]['invertedDepth']) {
183 // If going up
184 // First of all the previous level should have an icon:
185 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) {
186 $prevPid = -$prev_dat['row']['uid'];
187 end($lines);
188 $lines[] = '<li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $prev_dat['row']['pid'])) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li>';
189 }
190 // Then set the current prevPid
191 $prevPid = -$prev_dat['row']['pid'];
192 if ($prevPid !== $dat['row']['pid']) {
193 $lines[] = '</ul>';
194 }
195 } else {
196 // In on the same level
197 $prevPid = -$prev_dat['row']['uid'];
198 }
199 } else {
200 // First in the tree
201 $prevPid = $dat['row']['pid'];
202 }
203 // print arrow on the same level
204 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
205 $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'])) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
206 }
207 // The line with the icon and title:
208 $toolTip = BackendUtility::getRecordToolTip($dat['row'], 'pages');
209 $icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord('pages', $dat['row'], Icon::SIZE_SMALL)->render() . '</span>';
210
211 $lines[] = '<span class="text-nowrap">' . $icon . $this->linkPageTitle($this->boldTitle(htmlspecialchars(GeneralUtility::fixed_lgd_cs($dat['row']['title'], $this->getBackendUser()->uc['titleLen'])), $dat, $id), $dat['row']) . '</span>';
212 }
213 // If the current page was the last in the tree:
214 $prev_dat = end($pageTree->tree);
215 if ($prev_dat['row']['uid'] == $id) {
216 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) {
217 $lines[] = '<ul class="list-tree" style="margin-left: 25px"><li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li></ul>';
218 }
219 }
220 for ($a = $latestInvDepth; $a <= $this->depth; $a++) {
221 $dat = $saveLatestUid[$a];
222 $prevPid = -$dat['row']['uid'];
223 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
224 if ($latestInvDepth < $dat['invertedDepth']) {
225 $lines[] = '</ul>';
226 }
227 $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'])) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
228 }
229 }
230
231 $code = '<ul class="list-tree">';
232
233 foreach ($lines as $line) {
234 if ((substr($line, 0, 3) === '<ul') || (substr($line, 0, 4) === '</ul')) {
235 $code .= $line;
236 } else {
237 $code .= '<li>' . $line . '</li>';
238 }
239 }
240
241 $code .= '</ul>';
242 return $code;
243 }
244
245 /**
246 * Wrap $t_code in bold IF the $dat uid matches $id
247 *
248 * @param string $t_code Title string
249 * @param array $dat Information array with record array inside.
250 * @param int $id The current id.
251 * @return string The title string.
252 */
253 public function boldTitle($t_code, $dat, $id)
254 {
255 if ($dat['row']['uid'] == $id) {
256 $t_code = '<strong>' . $t_code . '</strong>';
257 }
258 return $t_code;
259 }
260
261 /**
262 * Creates the onclick event for the insert-icons.
263 *
264 * TSconfig mod.newPageWizard.override may contain an alternative module / route which can be
265 * used instead of the normal create new page wizard.
266 *
267 * @param int $pid The pid.
268 * @param int $newPagePID New page id.
269 * @return string Onclick attribute content
270 */
271 public function onClickEvent($pid, $newPagePID)
272 {
273 $TSconfig = BackendUtility::getModTSconfig($newPagePID, 'mod.newPageWizard');
274 $TSconfig = $TSconfig['properties'];
275 if (isset($TSconfig['override']) && !empty($TSconfig['override'])) {
276 $url = BackendUtility::getModuleUrl(
277 $TSconfig['override'],
278 [
279 'positionPid' => $pid,
280 'newPageId' => $newPagePID,
281 'cmd' => 'crPage',
282 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]
283 );
284 return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue($url) . ';';
285 }
286 $params = '&edit[pages][' . $pid . ']=new&returnNewPageId=1';
287 return BackendUtility::editOnClick($params, '', $this->R_URI);
288 }
289
290 /**
291 * Get label, htmlspecialchars()'ed
292 *
293 * @return string The localized label for "insert new page here
294 */
295 public function insertlabel()
296 {
297 return htmlspecialchars($this->getLanguageService()->getLL($this->l_insertNewPageHere));
298 }
299
300 /**
301 * Wrapping page title.
302 *
303 * @param string $str Page title.
304 * @param array $rec Page record (?)
305 * @return string Wrapped title.
306 */
307 public function linkPageTitle($str, $rec)
308 {
309 return $str;
310 }
311
312 /**
313 * Checks if the user has permission to created pages inside of the $pid page.
314 * Uses caching so only one regular lookup is made - hence you can call the function multiple times without worrying about performance.
315 *
316 * @param int $pid Page id for which to test.
317 * @return bool
318 */
319 public function checkNewPageInPid($pid)
320 {
321 if (!isset($this->checkNewPageCache[$pid])) {
322 $pidInfo = BackendUtility::getRecord('pages', $pid);
323 $this->checkNewPageCache[$pid] = $this->getBackendUser()->isAdmin() || $this->getBackendUser()->doesUserHaveAccess($pidInfo, 8);
324 }
325 return $this->checkNewPageCache[$pid];
326 }
327
328 /**
329 * Returns module configuration for a pid.
330 *
331 * @param int $pid Page id for which to get the module configuration.
332 * @return array The properties of the module configuration for the page id.
333 * @see onClickEvent()
334 */
335 public function getModConfig($pid)
336 {
337 if (!isset($this->getModConfigCache[$pid])) {
338 // Acquiring TSconfig for this PID:
339 $this->getModConfigCache[$pid] = BackendUtility::getModTSconfig($pid, $this->modConfigStr);
340 }
341 return $this->getModConfigCache[$pid]['properties'];
342 }
343
344 /*************************************
345 *
346 * Content element positioning:
347 *
348 **************************************/
349 /**
350 * Creates HTML for inserting/moving content elements.
351 *
352 * @param int $pid page id onto which to insert content element.
353 * @param int $moveUid Move-uid (tt_content element uid?)
354 * @param string $colPosList List of columns to show
355 * @param bool $showHidden If not set, then hidden/starttime/endtime records are filtered out.
356 * @param string $R_URI Request URI
357 * @return string HTML
358 */
359 public function printContentElementColumns($pid, $moveUid, $colPosList, $showHidden, $R_URI)
360 {
361 $this->R_URI = $R_URI;
362 $this->moveUid = $moveUid;
363 $colPosArray = GeneralUtility::trimExplode(',', $colPosList, true);
364 $lines = [];
365 foreach ($colPosArray as $kk => $vv) {
366 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
367 $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
368 if ($showHidden) {
369 $queryBuilder->getRestrictions()
370 ->removeByType(HiddenRestriction::class)
371 ->removeByType(StartTimeRestriction::class)
372 ->removeByType(EndTimeRestriction::class);
373 }
374 $queryBuilder
375 ->select('*')
376 ->from('tt_content')
377 ->where(
378 $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)),
379 $queryBuilder->expr()->eq('colPos', $queryBuilder->createNamedParameter($vv, \PDO::PARAM_INT))
380 )
381 ->orderBy('sorting');
382
383 if ((string)$this->cur_sys_language !== '') {
384 $queryBuilder->andWhere(
385 $queryBuilder->expr()->eq(
386 'sys_language_uid',
387 $queryBuilder->createNamedParameter($this->cur_sys_language, \PDO::PARAM_INT)
388 )
389 );
390 }
391
392 $res = $queryBuilder->execute();
393 $lines[$vv] = [];
394 $lines[$vv][] = $this->insertPositionIcon('', $vv, $kk, $moveUid, $pid);
395
396 while ($row = $res->fetch()) {
397 BackendUtility::workspaceOL('tt_content', $row);
398 if (is_array($row)) {
399 $lines[$vv][] = $this->wrapRecordHeader($this->getRecordHeader($row), $row);
400 $lines[$vv][] = $this->insertPositionIcon($row, $vv, $kk, $moveUid, $pid);
401 }
402 }
403 }
404 return $this->printRecordMap($lines, $colPosArray, $pid);
405 }
406
407 /**
408 * Creates the table with the content columns
409 *
410 * @param array $lines Array with arrays of lines for each column
411 * @param array $colPosArray Column position array
412 * @param int $pid The id of the page
413 * @return string HTML
414 */
415 public function printRecordMap($lines, $colPosArray, $pid = 0)
416 {
417 $count = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(count($colPosArray), 1);
418 $backendLayout = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getSelectedBackendLayout', $pid, $this);
419 if (isset($backendLayout['__config']['backend_layout.'])) {
420 $this->getLanguageService()->includeLLFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf');
421 $table = '<div class="table-fit"><table class="table table-condensed table-bordered table-vertical-top">';
422 $colCount = (int)$backendLayout['__config']['backend_layout.']['colCount'];
423 $rowCount = (int)$backendLayout['__config']['backend_layout.']['rowCount'];
424 $table .= '<colgroup>';
425 for ($i = 0; $i < $colCount; $i++) {
426 $table .= '<col style="width:' . 100 / $colCount . '%"></col>';
427 }
428 $table .= '</colgroup>';
429 $table .= '<tbody>';
430 $tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $pid, $this);
431 // Cycle through rows
432 for ($row = 1; $row <= $rowCount; $row++) {
433 $rowConfig = $backendLayout['__config']['backend_layout.']['rows.'][$row . '.'];
434 if (!isset($rowConfig)) {
435 continue;
436 }
437 $table .= '<tr>';
438 for ($col = 1; $col <= $colCount; $col++) {
439 $columnConfig = $rowConfig['columns.'][$col . '.'];
440 if (!isset($columnConfig)) {
441 continue;
442 }
443 // Which tt_content colPos should be displayed inside this cell
444 $columnKey = (int)$columnConfig['colPos'];
445 $head = '';
446 foreach ($tcaItems as $item) {
447 if ($item[1] == $columnKey) {
448 $head = htmlspecialchars($this->getLanguageService()->sL($item[0]));
449 }
450 }
451 // Render the grid cell
452 $table .= '<td'
453 . (isset($columnConfig['colspan']) ? ' colspan="' . $columnConfig['colspan'] . '"' : '')
454 . (isset($columnConfig['rowspan']) ? ' rowspan="' . $columnConfig['rowspan'] . '"' : '')
455 . ' class="col-nowrap col-min'
456 . (!isset($columnConfig['colPos']) ? ' warning' : '')
457 . (isset($columnConfig['colPos']) && !$head ? ' danger' : '') . '">';
458 // Render header
459 $table .= '<p>';
460 if (isset($columnConfig['colPos']) && $head) {
461 $table .= '<strong>' . $this->wrapColumnHeader($head, '', '') . '</strong>';
462 } elseif ($columnConfig['colPos']) {
463 $table .= '<em>' . $this->wrapColumnHeader($this->getLanguageService()->getLL('noAccess'), '', '') . '</em>';
464 } else {
465 $table .= '<em>' . $this->wrapColumnHeader(($this->getLanguageService()->sL($columnConfig['name']) ?: '') . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '', '') . '</em>';
466 }
467 $table .= '</p>';
468 // Render lines
469 if (isset($columnConfig['colPos']) && $head && !empty($lines[$columnKey])) {
470 $table .= '<ul class="list-unstyled">';
471 foreach ($lines[$columnKey] as $line) {
472 $table .= '<li>' . $line . '</li>';
473 }
474 $table .= '</ul>';
475 }
476 $table .= '</td>';
477 }
478 $table .= '</tr>';
479 }
480 $table .= '</tbody>';
481 $table .= '</table></div>';
482 } else {
483 // Traverse the columns here:
484 $row = '';
485 foreach ($colPosArray as $kk => $vv) {
486 $row .= '<td class="col-nowrap col-min" width="' . round(100 / $count) . '%">';
487 $row .= '<p><strong>' . $this->wrapColumnHeader(htmlspecialchars($this->getLanguageService()->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $vv))), $vv) . '</strong></p>';
488 if (!empty($lines[$vv])) {
489 $row .= '<ul class="list-unstyled">';
490 foreach ($lines[$vv] as $line) {
491 $row .= '<li>' . $line . '</li>';
492 }
493 $row .= '</ul>';
494 }
495 $row .= '</td>';
496 }
497 $table = '
498
499 <!--
500 Map of records in columns:
501 -->
502 <div class="table-fit">
503 <table class="table table-condensed table-bordered table-vertical-top">
504 <tr>' . $row . '</tr>
505 </table>
506 </div>
507
508 ';
509 }
510 return $table;
511 }
512
513 /**
514 * Wrapping the column header
515 *
516 * @param string $str Header value
517 * @param string $vv Column info.
518 * @return string
519 * @see printRecordMap()
520 */
521 public function wrapColumnHeader($str, $vv)
522 {
523 return $str;
524 }
525
526 /**
527 * Creates a linked position icon.
528 *
529 * @param mixed $row Element row. If this is an array the link will cause an insert after this content element, otherwise
530 * the link will insert at the first position in the column
531 * @param string $vv Column position value.
532 * @param int $kk Column key.
533 * @param int $moveUid Move uid
534 * @param int $pid PID value.
535 * @return string
536 */
537 public function insertPositionIcon($row, $vv, $kk, $moveUid, $pid)
538 {
539 if (is_array($row) && !empty($row['uid'])) {
540 // Use record uid for the hash when inserting after this content element
541 $uid = $row['uid'];
542 } else {
543 // No uid means insert at first position in the column
544 $uid = '';
545 }
546 $cc = hexdec(substr(md5($uid . '-' . $vv . '-' . $kk), 0, 4));
547 return '<a href="#" onclick="' . htmlspecialchars($this->onClickInsertRecord($row, $vv, $moveUid, $pid, $this->cur_sys_language)) . '" data-dismiss="modal">' . '<i class="t3-icon fa fa-long-arrow-left" name="mImgEnd' . $cc . '" title="' . htmlspecialchars($this->getLanguageService()->getLL($this->l_insertNewRecordHere)) . '"></i></a>';
548 }
549
550 /**
551 * Create on-click event value.
552 *
553 * @param mixed $row The record. If this is not an array with the record data the insert will be for the first position
554 * in the column
555 * @param string $vv Column position value.
556 * @param int $moveUid Move uid
557 * @param int $pid PID value.
558 * @param int $sys_lang System language (not used currently)
559 * @return string
560 */
561 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
562 {
563 $table = 'tt_content';
564 if (is_array($row)) {
565 $location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=-' . $row['uid'];
566 } else {
567 $location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&data[' . $table . '][' . $moveUid . '][colPos]=' . $vv;
568 }
569 $location .= '&redirect=' . rawurlencode($this->R_URI);
570 // returns to prev. page
571 return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue($location) . ';return false;';
572 }
573
574 /**
575 * Wrapping the record header (from getRecordHeader())
576 *
577 * @param string $str HTML content
578 * @param string $row Record array.
579 * @return string HTML content
580 */
581 public function wrapRecordHeader($str, $row)
582 {
583 return $str;
584 }
585
586 /**
587 * Create record header (includes the record icon, record title etc.)
588 *
589 * @param array $row Record row.
590 * @return string HTML
591 */
592 public function getRecordHeader($row)
593 {
594 $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
595 $toolTip = BackendUtility::getRecordToolTip($row, 'tt_content');
596 $line = '<span ' . $toolTip . ' title="' . BackendUtility::getRecordIconAltText($row, 'tt_content') . '">' . $iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL)->render() . '</span>';
597 $line .= BackendUtility::getRecordTitle('tt_content', $row, true);
598 return $this->wrapRecordTitle($line, $row);
599 }
600
601 /**
602 * Wrapping the title of the record.
603 *
604 * @param string $str The title value.
605 * @param array $row The record row.
606 * @return string Wrapped title string.
607 */
608 public function wrapRecordTitle($str, $row)
609 {
610 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(['uid' => (int)$row['uid'], 'moveUid' => ''])) . '">' . $str . '</a>';
611 }
612
613 /**
614 * Returns the BackendUser
615 *
616 * @return BackendUserAuthentication
617 */
618 protected function getBackendUser()
619 {
620 return $GLOBALS['BE_USER'];
621 }
622
623 /**
624 * Returns the LanguageService
625 *
626 * @return LanguageService
627 */
628 protected function getLanguageService()
629 {
630 return $GLOBALS['LANG'];
631 }
632 }