‪TYPO3CMS  10.4
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;
21 
27 {
33  protected ‪$linkParts = [];
34 
40  protected ‪$updateSupported = false;
41 
45  public function ‪__construct()
46  {
47  parent::__construct();
48  // remove unsupported link attributes
49  foreach (['target', 'rel'] as $attribute) {
50  $position = array_search($attribute, $this->linkAttributes, true);
51  if ($position !== false) {
52  unset($this->linkAttributes[$position]);
53  }
54  }
55  }
56 
66  public function ‪canHandleLink(array ‪$linkParts)
67  {
68  if (isset(‪$linkParts['url']['email'])) {
69  $this->linkParts = ‪$linkParts;
70  return true;
71  }
72  return false;
73  }
74 
80  public function ‪formatCurrentUrl()
81  {
82  return $this->linkParts['url']['email'];
83  }
84 
92  public function ‪render(ServerRequestInterface $request)
93  {
94  GeneralUtility::makeInstance(PageRenderer::class)->loadRequireJsModule('TYPO3/CMS/Recordlist/MailLinkHandler');
95 
96  $this->view->assign('email', !empty($this->linkParts) ? $this->linkParts['url']['email'] : '');
97  return $this->view->render('Mail');
98  }
99 
103  public function ‪getBodyTagAttributes()
104  {
105  return [];
106  }
107 }
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46