‪TYPO3CMS  ‪main
PageMovingPagePositionMap.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ServerRequestInterface;
23 
30 {
38  public function ‪getActionLink($pid, $newPagePID): string
39  {
40  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
41  return (string)$uriBuilder->buildUriFromRoute('tce_db', [
42  'cmd[pages][' . $this->moveUid . '][' . $this->moveOrCopy . ']' => $pid,
43  'redirect' => $this->R_URI,
44  ]);
45  }
46 
54  public function ‪linkPageTitle($str, $rec, ServerRequestInterface $request)
55  {
56  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
57  $queryParams = $request->getQueryParams();
58  ‪$url = (string)$uriBuilder->buildUriFromRoute(
59  'move_element',
60  [
61  'table' => $queryParams['table'] ?? '',
62  'uid' => (int)($rec['uid'] ?? 0),
63  'moveUid' => $this->moveUid,
64  'makeCopy' => $queryParams['makeCopy'] ?? 0,
65  'returnUrl' => $queryParams['returnUrl'] ?? '',
66  ]
67  );
68  return '<a href="' . htmlspecialchars(‪$url) . '">' . $str . '</a>';
69  }
70 
79  public function ‪boldTitle($t_code, $dat, $id)
80  {
81  return parent::boldTitle($t_code, $dat, (int)$this->moveUid);
82  }
83 
89  protected function ‪insertlabel()
90  {
91  return htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:movePageToHere'));
92  }
93 }
‪TYPO3\CMS\Backend\Tree\View\PagePositionMap\getLanguageService
‪getLanguageService()
Definition: PagePositionMap.php:319
‪TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap\linkPageTitle
‪string linkPageTitle($str, $rec, ServerRequestInterface $request)
Definition: PageMovingPagePositionMap.php:54
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:44
‪TYPO3\CMS\Backend\Tree\View\PagePositionMap
Definition: PagePositionMap.php:39
‪TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap
Definition: PageMovingPagePositionMap.php:30
‪TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap\insertlabel
‪string insertlabel()
Definition: PageMovingPagePositionMap.php:89
‪TYPO3\CMS\Backend\Tree\View
Definition: AbstractContentPagePositionMap.php:18
‪TYPO3\CMS\Webhooks\Message\$url
‪identifier readonly UriInterface $url
Definition: LoginErrorOccurredMessage.php:36
‪TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap\getActionLink
‪string getActionLink($pid, $newPagePID)
Definition: PageMovingPagePositionMap.php:38
‪TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap\boldTitle
‪string boldTitle($t_code, $dat, $id)
Definition: PageMovingPagePositionMap.php:79
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52