‪TYPO3CMS  11.5
ContentMovingPagePositionMap.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 
21 use TYPO3\CMS\Backend\Utility\BackendUtility;
26 
33 {
37  public int ‪$moveUid = 0;
38 
42  public string ‪$copyMode = 'move';
43 
47  public string ‪$R_URI = '';
48 
51 
53  {
54  $this->iconFactory = ‪$iconFactory;
55  $this->uriBuilder = ‪$uriBuilder;
56  parent::__construct(‪$backendLayoutView);
57  }
58 
62  protected function ‪insertPositionIcon(?array $row, int $colPos, int $pid): string
63  {
64  if (is_array($row)) {
65  $location = (string)$this->uriBuilder->buildUriFromRoute('tce_db', [
66  'cmd[tt_content][' . $this->moveUid . '][' . $this->copyMode . ']' => '-' . $row['uid'],
67  'redirect' => $this->R_URI,
68  ]);
69  } else {
70  $location = (string)$this->uriBuilder->buildUriFromRoute('tce_db', [
71  'cmd[tt_content][' . $this->moveUid . '][' . $this->copyMode . ']' => $pid,
72  'data[tt_content][' . $this->moveUid . '][colPos]' => $colPos,
73  'redirect' => $this->R_URI,
74  ]);
75  }
76  return '
77  <a href="' . htmlspecialchars($location) . '" title="' . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:insertNewRecordHere')) . '">
78  ' . $this->iconFactory->getIcon('actions-arrow-left', ‪Icon::SIZE_SMALL)->render() . '
79  </a>';
80  }
81 
88  protected function ‪getRecordHeader(array $row): string
89  {
90  $linkContent = '
91  <span ' . BackendUtility::getRecordToolTip($row, 'tt_content') . '>
92  ' . $this->iconFactory->getIconForRecord('tt_content', $row, ‪Icon::SIZE_SMALL)->render() . '
93  </span>' . BackendUtility::getRecordTitle('tt_content', $row, true);
94 
95  if ($this->moveUid === (int)$row['uid']) {
96  $linkContent = '<strong>' . $linkContent . '</strong>';
97  }
98 
99  return '
100  <a href="' . htmlspecialchars(GeneralUtility::linkThisScript(['uid' => (int)$row['uid'], 'moveUid' => ''])) . '">
101  ' . $linkContent . '
102  </a>';
103  }
104 }
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:30
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$iconFactory
‪IconFactory $iconFactory
Definition: ContentMovingPagePositionMap.php:49
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$R_URI
‪string $R_URI
Definition: ContentMovingPagePositionMap.php:47
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Tree\View\AbstractContentPagePositionMap\$backendLayoutView
‪BackendLayoutView $backendLayoutView
Definition: AbstractContentPagePositionMap.php:39
‪TYPO3\CMS\Backend\Tree\View\AbstractContentPagePositionMap\getLanguageService
‪getLanguageService()
Definition: AbstractContentPagePositionMap.php:322
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$moveUid
‪int $moveUid
Definition: ContentMovingPagePositionMap.php:37
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$copyMode
‪string $copyMode
Definition: ContentMovingPagePositionMap.php:42
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\getRecordHeader
‪string getRecordHeader(array $row)
Definition: ContentMovingPagePositionMap.php:88
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap
Definition: ContentMovingPagePositionMap.php:33
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:40
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$uriBuilder
‪UriBuilder $uriBuilder
Definition: ContentMovingPagePositionMap.php:50
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\insertPositionIcon
‪insertPositionIcon(?array $row, int $colPos, int $pid)
Definition: ContentMovingPagePositionMap.php:62
‪TYPO3\CMS\Backend\Tree\View
Definition: AbstractContentPagePositionMap.php:18
‪TYPO3\CMS\Backend\Tree\View\AbstractContentPagePositionMap
Definition: AbstractContentPagePositionMap.php:33
‪TYPO3\CMS\Backend\View\BackendLayoutView
Definition: BackendLayoutView.php:37
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\__construct
‪__construct(IconFactory $iconFactory, UriBuilder $uriBuilder, BackendLayoutView $backendLayoutView)
Definition: ContentMovingPagePositionMap.php:52