‪TYPO3CMS  10.4
ElementBrowserFolderTreeView.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
21 
31 {
35  public ‪$ext_IconMode = 'titlelink';
36 
40  protected ‪$linkParameterProvider;
41 
46  {
47  $this->linkParameterProvider = ‪$linkParameterProvider;
48  $this->thisScript = ‪$linkParameterProvider->‪getScriptUrl();
49  }
50 
60  public function ‪wrapIcon($icon, $folderObject)
61  {
62  // Add title attribute to input icon tag
63  $theFolderIcon = '';
64 
65  // Wrap icon in link (in ElementBrowser only the "titlelink" is used).
66  if ($this->ext_IconMode === 'titlelink') {
68  $this->linkParameterProvider->getUrlParameters(['identifier' => $folderObject->getCombinedIdentifier()])
69  );
70  $theFolderIcon = '<a href="' . htmlspecialchars($this->‪getThisScript() . $parameters) . '">' . $icon . '</a>';
71  }
72 
73  return $theFolderIcon;
74  }
75 
84  public function ‪wrapTitle(‪$title, $folderObject, ‪$bank = 0)
85  {
87  $this->linkParameterProvider->getUrlParameters(['identifier' => $folderObject->getCombinedIdentifier()])
88  );
89  return '<a href="' . htmlspecialchars($this->‪getThisScript() . $parameters) . '">' . ‪$title . '</a>';
90  }
91 
97  protected function ‪renderPMIconAndLink($cmd, $isOpen)
98  {
99  if (static::class === __CLASS__) {
100  return $this->‪PMiconATagWrap('', $cmd, !$isOpen);
101  }
102  return parent::renderPMIconAndLink($cmd, $isOpen);
103  }
104 
115  public function ‪PM_ATagWrap($icon, $cmd, $bMark = '', $isOpen = false)
116  {
117  $anchor = $bMark ? '#' . $bMark : '';
118  $name = $bMark ? ' name=' . $bMark : '';
119  $urlParameters = $this->linkParameterProvider->getUrlParameters([]);
120  $urlParameters['PM'] = $cmd;
121  $url = $this->‪getThisScript() . ‪HttpUtility::buildQueryString($urlParameters) . $anchor;
122  return '<a href="' . htmlspecialchars($url) . '"' . htmlspecialchars($name) . '>' . $icon . '</a>';
123  }
124 
134  public function ‪PMiconATagWrap($icon, $cmd, $isExpand = true)
135  {
136  if (empty($this->scope)) {
137  $this->scope = [
138  'class' => static::class,
139  'script' => ‪$this->thisScript,
140  'browser' => $this->linkParameterProvider->getUrlParameters([]),
141  ];
142  }
143 
144  return parent::PMiconATagWrap($icon, $cmd, $isExpand);
145  }
146 }
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\renderPMIconAndLink
‪string renderPMIconAndLink($cmd, $isOpen)
Definition: ElementBrowserFolderTreeView.php:95
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$title
‪string $title
Definition: AbstractTreeView.php:74
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\setLinkParameterProvider
‪setLinkParameterProvider(LinkParameterProviderInterface $linkParameterProvider)
Definition: ElementBrowserFolderTreeView.php:43
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView
Definition: ElementBrowserFolderTreeView.php:31
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\wrapIcon
‪string wrapIcon($icon, $folderObject)
Definition: ElementBrowserFolderTreeView.php:58
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\PM_ATagWrap
‪string PM_ATagWrap($icon, $cmd, $bMark='', $isOpen=false)
Definition: ElementBrowserFolderTreeView.php:113
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:37
‪TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString
‪static string buildQueryString(array $parameters, string $prependCharacter='', bool $skipEmptyParameters=false)
Definition: HttpUtility.php:163
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$bank
‪int $bank
Definition: AbstractTreeView.php:219
‪TYPO3\CMS\Backend\Tree\View\FolderTreeView
Definition: FolderTreeView.php:38
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\wrapTitle
‪string wrapTitle($title, $folderObject, $bank=0)
Definition: ElementBrowserFolderTreeView.php:82
‪TYPO3\CMS\Backend\Tree\View
Definition: AbstractTreeView.php:16
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\$linkParameterProvider
‪LinkParameterProviderInterface $linkParameterProvider
Definition: ElementBrowserFolderTreeView.php:38
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\getThisScript
‪string getThisScript()
Definition: AbstractTreeView.php:250
‪TYPO3\CMS\Core\Utility\HttpUtility
Definition: HttpUtility.php:24
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\PMiconATagWrap
‪string PMiconATagWrap($icon, $cmd, $isExpand=true)
Definition: ElementBrowserFolderTreeView.php:132
‪TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView\$ext_IconMode
‪string $ext_IconMode
Definition: ElementBrowserFolderTreeView.php:34
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$thisScript
‪string $thisScript
Definition: AbstractTreeView.php:49