[!!!][TASK] Remove tce_db options "prErr" and "uPT"
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / PageMovingPagePositionMap.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 /**
18 * Position map class for moving pages,
19 * previously resided in typo3/move_el.php
20 */
21 class PageMovingPagePositionMap extends PagePositionMap
22 {
23 /**
24 * @var string
25 */
26 public $l_insertNewPageHere = 'movePageToHere';
27
28 /**
29 * Page tree implementation class name
30 *
31 * @var string
32 */
33 protected $pageTreeClassName = PageTreeView::class;
34
35 /**
36 * Creates the onclick event for the insert-icons.
37 *
38 * @param int $pid The pid.
39 * @param int $newPagePID New page id.
40 * @return string Onclick attribute content
41 */
42 public function onClickEvent($pid, $newPagePID)
43 {
44 return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tce_db') . '&cmd[pages][' . $GLOBALS['SOBE']->moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&redirect=' . rawurlencode($this->R_URI)) . ';return false;';
45 }
46
47 /**
48 * Wrapping page title.
49 *
50 * @param string $str Page title.
51 * @param array $rec Page record (?)
52 * @return string Wrapped title.
53 */
54 public function linkPageTitle($str, $rec)
55 {
56 $url = \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(['uid' => (int)$rec['uid'], 'moveUid' => $GLOBALS['SOBE']->moveUid]);
57 return '<a href="' . htmlspecialchars($url) . '">' . $str . '</a>';
58 }
59
60 /**
61 * Wrap $t_code in bold IF the $dat uid matches $id
62 *
63 * @param string $t_code Title string
64 * @param array $dat Information array with record array inside.
65 * @param int $id The current id.
66 * @return string The title string.
67 */
68 public function boldTitle($t_code, $dat, $id)
69 {
70 return parent::boldTitle($t_code, $dat, $GLOBALS['SOBE']->moveUid);
71 }
72 }