‪TYPO3CMS  11.5
MailLinkHandler.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 attributes
47  foreach (['target', 'rel'] as $attribute) {
48  $position = array_search($attribute, $this->linkAttributes, true);
49  if ($position !== false) {
50  unset($this->linkAttributes[$position]);
51  }
52  }
53  }
54 
64  public function ‪canHandleLink(array ‪$linkParts)
65  {
66  if (isset(‪$linkParts['url']['email'])) {
67  $this->linkParts = ‪$linkParts;
68  return true;
69  }
70  return false;
71  }
72 
78  public function ‪formatCurrentUrl()
79  {
80  return $this->linkParts['url']['email'];
81  }
82 
90  public function ‪render(ServerRequestInterface $request)
91  {
92  $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/MailLinkHandler');
93  $this->view->assign('email', !empty($this->linkParts) ? $this->linkParts['url']['email'] : '');
94  $this->view->setTemplate('Mail');
95  return '';
96  }
97 
101  public function ‪getBodyTagAttributes()
102  {
103  return [];
104  }
105 }