‪TYPO3CMS  11.5
UrlLinkHandler.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 
18 use Psr\Http\Message\ServerRequestInterface;
19 
25 {
31  protected ‪$linkParts = [];
32 
38  protected ‪$updateSupported = false;
39 
43  public function ‪__construct()
44  {
45  parent::__construct();
46  // remove unsupported link attribute
47  unset($this->linkAttributes[array_search('params', $this->linkAttributes, true)]);
48  }
49 
59  public function ‪canHandleLink(array ‪$linkParts)
60  {
61  if (!isset(‪$linkParts['url']['url'])) {
62  return false;
63  }
64  ‪$linkParts['url'] = ‪$linkParts['url']['url'];
65  $this->linkParts = ‪$linkParts;
66 
67  return true;
68  }
69 
75  public function ‪formatCurrentUrl()
76  {
77  return $this->linkParts['url'];
78  }
79 
87  public function ‪render(ServerRequestInterface $request)
88  {
89  $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/UrlLinkHandler');
90 
91  $this->view->assign('url', !empty($this->linkParts) ? $this->linkParts['url'] : '');
92  $this->view->setTemplate('Url');
93  return '';
94  }
95 
99  public function ‪getBodyTagAttributes()
100  {
101  return [];
102  }
103 }