17 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
66 parent::initializeArguments();
67 $this->registerArgument(
'email',
'string',
'The email address to be turned into a link',
true);
68 $this->registerUniversalTagAttributes();
69 $this->registerTagAttribute(
'name',
'string',
'Specifies the name of an anchor');
70 $this->registerTagAttribute(
'rel',
'string',
'Specifies the relationship between the current document and the linked document');
71 $this->registerTagAttribute(
'rev',
'string',
'Specifies the relationship between the linked document and the current document');
72 $this->registerTagAttribute(
'target',
'string',
'Specifies where to open the linked document');
80 $email = $this->arguments[
'email'];
83 list($linkHref, $linkText) =
$GLOBALS[
'TSFE']->cObj->getMailTo($email,
'');
84 $escapeSpecialCharacters = !isset(
$GLOBALS[
'TSFE']->spamProtectEmailAddresses) ||
$GLOBALS[
'TSFE']->spamProtectEmailAddresses !==
'ascii';
86 $linkHref =
'mailto:' . $email;
87 $linkText = htmlspecialchars($email);
88 $escapeSpecialCharacters =
true;
90 $tagContent = $this->renderChildren();
91 if ($tagContent !==
null) {
92 $linkText = $tagContent;
94 $this->tag->setContent($linkText);
95 $this->tag->addAttribute(
'href', $linkHref, $escapeSpecialCharacters);
96 $this->tag->forceClosingTag(
true);
97 return $this->tag->render();
105 return TYPO3_MODE ===
'FE';