‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler Class Reference
Inheritance diagram for TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler:
TYPO3\CMS\Backend\LinkHandler\AbstractLinkHandler TYPO3\CMS\Backend\LinkHandler\LinkHandlerInterface TYPO3\CMS\Backend\Tree\View\LinkParameterProviderInterface

Public Member Functions

 __construct (private readonly ElementBrowserRecordList $elementBrowserRecordList, private readonly RecordSearchBoxComponent $recordSearchBoxComponent, private readonly LinkService $linkService,)
 
 initialize (AbstractLinkBrowserController $linkBrowser, $identifier, array $configuration)
 
 canHandleLink (array $linkParts)
 
 formatCurrentUrl ()
 
 render (ServerRequestInterface $request)
 
string[] getBodyTagAttributes ()
 
string[] getUrlParameters (array $values)
 

Protected Member Functions

 renderTableRecords (ServerRequestInterface $request)
 

Protected Attributes

string $identifier
 
array $configuration = []
 
array $linkParts = []
 
int $expandPage = 0
 

Detailed Description

This link handler allows linking to arbitrary database records. They can be configured in addition to default core link handlers and are rendered as additional tab in the link browser.

A typical use case is linking a single new record.

Additional page TSconfig TCEMAIN.linkHandler setup is necessary to use this.

A typical configuration looks like the below snippet. It configures a tab that allows linking to ext:news news records ("table" is mandatory), labels them as "Book reports" (LLL: is possible), forces a specific page-uid (optional), and hides page-tree selection (optional).

TCEMAIN.linkHandler.bookreports { handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler label = Book Reports configuration { table = tx_news_domain_model_news storagePid = 42 hidePageTree = 1 } }

This class is a specific LinkHandler implementation and is not part of the TYPO3's Core API.

Definition at line 57 of file RecordLinkHandler.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::__construct ( private readonly ElementBrowserRecordList  $elementBrowserRecordList,
private readonly RecordSearchBoxComponent  $recordSearchBoxComponent,
private readonly LinkService  $linkService 
)

Definition at line 76 of file RecordLinkHandler.php.

Member Function Documentation

◆ canHandleLink()

TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::canHandleLink ( array  $linkParts)

Checks if this is the right handler for the given link. Also stores information locally about currently linked record.

Parameters
array$linkParts‪Link parts as returned from TypoLinkCodecService

Implements TYPO3\CMS\Backend\LinkHandler\LinkHandlerInterface.

Definition at line 103 of file RecordLinkHandler.php.

References $GLOBALS, TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler\$linkParts, TYPO3\CMS\Webhooks\Message\$record, and TYPO3\CMS\Backend\LinkHandler\AbstractLinkHandler\getLanguageService().

◆ formatCurrentUrl()

TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::formatCurrentUrl ( )

Formats information for the current record for HTML output.

Implements TYPO3\CMS\Backend\LinkHandler\LinkHandlerInterface.

Definition at line 130 of file RecordLinkHandler.php.

◆ getBodyTagAttributes()

string [] TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::getBodyTagAttributes ( )

Returns attributes for the body tag.

Returns
‪string[] Array of body-tag attributes

Implements TYPO3\CMS\Backend\LinkHandler\LinkHandlerInterface.

Definition at line 178 of file RecordLinkHandler.php.

◆ getUrlParameters()

string [] TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::getUrlParameters ( array  $values)

Returns all parameters needed to build a URL with all the necessary information.

Parameters
array$values‪Array of values to include into the parameters or which might influence the parameters
Returns
‪string[] Array of parameters which have to be added to URLs

Implements TYPO3\CMS\Backend\Tree\View\LinkParameterProviderInterface.

Definition at line 195 of file RecordLinkHandler.php.

Referenced by TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler\renderTableRecords().

◆ initialize()

TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::initialize ( AbstractLinkBrowserController  $linkBrowser,
  $identifier,
array  $configuration 
)

◆ render()

TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::render ( ServerRequestInterface  $request)

◆ renderTableRecords()

Member Data Documentation

◆ $configuration

array TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::$configuration = []
protected

Specific TSconfig for the current instance (corresponds to TCEMAIN.linkHandler.record.<identifier>.configuration)

Definition at line 67 of file RecordLinkHandler.php.

Referenced by TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler\initialize().

◆ $expandPage

int TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::$expandPage = 0
protected

◆ $identifier

string TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::$identifier
protected

Configuration key in TSconfig TCEMAIN.linkHandler.<identifier>

Definition at line 62 of file RecordLinkHandler.php.

Referenced by TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler\initialize().

◆ $linkParts

array TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler::$linkParts = []
protected

Parts of the current link

Definition at line 72 of file RecordLinkHandler.php.

Referenced by TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler\canHandleLink().