‪TYPO3CMS  ‪main
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;
24 use TYPO3\CMS\Core\Imaging\IconSize;
25 
32 {
36  public int ‪$moveUid = 0;
37 
41  public string ‪$copyMode = 'move';
42 
46  public string ‪$R_URI = '';
47 
50 
52  {
53  $this->iconFactory = ‪$iconFactory;
54  $this->uriBuilder = ‪$uriBuilder;
55  parent::__construct(‪$backendLayoutView);
56  }
57 
61  protected function ‪insertPositionIcon(?array $row, int $colPos, int $pid): string
62  {
63  if (is_array($row)) {
64  $location = (string)$this->uriBuilder->buildUriFromRoute('tce_db', [
65  'cmd[tt_content][' . $this->moveUid . '][' . $this->copyMode . ']' => '-' . $row['uid'],
66  'redirect' => $this->R_URI,
67  ]);
68  } else {
69  $location = (string)$this->uriBuilder->buildUriFromRoute('tce_db', [
70  'cmd[tt_content][' . $this->moveUid . '][' . $this->copyMode . ']' => $pid,
71  'data[tt_content][' . $this->moveUid . '][colPos]' => $colPos,
72  'redirect' => $this->R_URI,
73  ]);
74  }
75  return '
76  <a class="btn btn-link" href="' . htmlspecialchars($location) . '" title="' . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:moveElementToHere')) . '">
77  ' . $this->iconFactory->getIcon('actions-arrow-left-alt', IconSize::SMALL)->render() . '
78  </a>';
79  }
80 
87  protected function ‪getRecordHeader(array $row): string
88  {
89  return '
90  <span class="py-2" title="' . BackendUtility::getRecordIconAltText($row, 'tt_content') . '">
91  ' . $this->iconFactory->getIconForRecord('tt_content', $row, IconSize::SMALL)->render() . '
92  ' . ($this->moveUid === (int)$row['uid'] ? '<strong>' : '') . '
93  ' . BackendUtility::getRecordTitle('tt_content', $row, true) . '
94  ' . ($this->moveUid === (int)$row['uid'] ? '</strong>' : '') . '
95  </span>';
96  }
97 }
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$iconFactory
‪IconFactory $iconFactory
Definition: ContentMovingPagePositionMap.php:48
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$R_URI
‪string $R_URI
Definition: ContentMovingPagePositionMap.php:46
‪TYPO3\CMS\Backend\Tree\View\AbstractContentPagePositionMap\$backendLayoutView
‪BackendLayoutView $backendLayoutView
Definition: AbstractContentPagePositionMap.php:42
‪TYPO3\CMS\Backend\Tree\View\AbstractContentPagePositionMap\getLanguageService
‪getLanguageService()
Definition: AbstractContentPagePositionMap.php:324
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$moveUid
‪int $moveUid
Definition: ContentMovingPagePositionMap.php:36
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$copyMode
‪string $copyMode
Definition: ContentMovingPagePositionMap.php:41
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\getRecordHeader
‪string getRecordHeader(array $row)
Definition: ContentMovingPagePositionMap.php:87
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap
Definition: ContentMovingPagePositionMap.php:32
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:44
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\$uriBuilder
‪UriBuilder $uriBuilder
Definition: ContentMovingPagePositionMap.php:49
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\insertPositionIcon
‪insertPositionIcon(?array $row, int $colPos, int $pid)
Definition: ContentMovingPagePositionMap.php:61
‪TYPO3\CMS\Backend\Tree\View
Definition: AbstractContentPagePositionMap.php:18
‪TYPO3\CMS\Backend\Tree\View\AbstractContentPagePositionMap
Definition: AbstractContentPagePositionMap.php:36
‪TYPO3\CMS\Backend\View\BackendLayoutView
Definition: BackendLayoutView.php:37
‪TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap\__construct
‪__construct(IconFactory $iconFactory, UriBuilder $uriBuilder, BackendLayoutView $backendLayoutView)
Definition: ContentMovingPagePositionMap.php:51