‪TYPO3CMS  ‪main
TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser Class Reference
Inheritance diagram for TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser:
TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface

Public Member Functions

 __construct (EventDispatcherInterface $eventDispatcher)
 
 parse (string $table, string $field, int $uid, string $content, string $structurePath='')
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser
string makeTokenID (string $index='')
 
 setParserKey (string $parserKey, array $parameters)
 
 getParserKey ()
 

Protected Member Functions

array getTypoLinkParts (string $typolinkValue, string $referenceTable, int $referenceUid)
 
string setTypoLinkPartsElement ($tLP, &$elements, $content, $idx)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser
 setTokenIdBasePrefix (string $table, string $uid, string $field, string $structurePath)
 

Protected Attributes

EventDispatcherInterface $eventDispatcher
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser
string $tokenID_basePrefix = ''
 
string $parserKey = ''
 
array $parameters = []
 

Detailed Description

TypoLink value processing. Will process input value as a TypoLink value. References to page id or file, possibly with anchor/target, possibly commaseparated list.

Definition at line 35 of file TypolinkSoftReferenceParser.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser::__construct ( EventDispatcherInterface  $eventDispatcher)

Member Function Documentation

◆ getTypoLinkParts()

array TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser::getTypoLinkParts ( string  $typolinkValue,
string  $referenceTable,
int  $referenceUid 
)
protected

Analyze content as a TypoLink value and return an array with properties. TypoLinks format is: <link [typolink] [browser target] [css class] [title attribute] [additionalParams]>. See TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::typolink() The syntax of the [typolink] part is: [typolink] = [page id][,[type value]][#[anchor, if integer = tt_content uid]] The extraction is based on how \TYPO3\CMS\Frontend\ContentObject::typolink() behaves.

Parameters
string$typolinkValue‪TypoLink value.
string$referenceTable‪The reference table
int$referenceUid‪The UID of the reference record
Returns
‪array Array with the properties of the input link specified. The key "type" will reveal the type. If that is blank it could not be determined.
See also
‪\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::typolink()
setTypoLinkPartsElement()

Definition at line 84 of file TypolinkSoftReferenceParser.php.

References TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_FILE, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_PAGE, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_RECORD, and TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_UNKNOWN.

Referenced by TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser\parse().

◆ parse()

TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser::parse ( string  $table,
string  $field,
int  $uid,
string  $content,
string  $structurePath = '' 
)

Main function through which can parse content for a specific field.

Parameters
string$tableDatabase table name
string$field‪Field name for which processing occurs
int$uid‪UID of the record
string$content‪The content/value of the field
string$structurePath‪If running from inside a FlexForm structure, this is the path of the tag.
Returns
SoftReferenceParserResult Result object on positive matches, see description above.
See also
SoftReferenceParserResult

Implements TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface.

Definition at line 44 of file TypolinkSoftReferenceParser.php.

References TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult\create(), TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser\getTypoLinkParts(), TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser\setTokenIdBasePrefix(), and TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser\setTypoLinkPartsElement().

◆ setTypoLinkPartsElement()

string TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser::setTypoLinkPartsElement (   $tLP,
$elements,
  $content,
  $idx 
)
protected

Recompile a TypoLink value from the array of properties made with getTypoLinkParts() into an elements array

Parameters
array$tLP‪TypoLink properties
array$elements‪Array of elements to be modified with substitution / information entries.
string$content‪The content to process.
int$idx‪Index value of the found element - user to make unique but stable tokenID
Returns
‪string The input content, possibly containing tokens now according to the added substitution entries in $elements
See also
getTypoLinkParts()

Definition at line 158 of file TypolinkSoftReferenceParser.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser\makeTokenID(), TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_EMAIL, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_FILE, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_FOLDER, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_PAGE, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_RECORD, TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_TELEPHONE, and TYPO3\CMS\Core\LinkHandling\LinkService\TYPE_URL.

Referenced by TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser\parse().

Member Data Documentation

◆ $eventDispatcher

EventDispatcherInterface TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser::$eventDispatcher
protected