[BUGFIX] RTE Image Wizard
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / LinkHandler / LinkHandlerInterface.php
1 <?php
2 namespace TYPO3\CMS\Recordlist\LinkHandler;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use Psr\Http\Message\ServerRequestInterface;
18 use TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController;
19
20 /**
21 * Interface for link handlers displayed in the LinkBrowser
22 */
23 interface LinkHandlerInterface
24 {
25 /**
26 * @return array
27 */
28 public function getLinkAttributes();
29
30 /**
31 * @param string[] $fieldDefinitions Array of link attribute field definitions
32 * @return string[]
33 */
34 public function modifyLinkAttributes(array $fieldDefinitions);
35
36 /**
37 * Initialize the handler
38 *
39 * @param AbstractLinkBrowserController $linkBrowser
40 * @param string $identifier
41 * @param array $configuration Page TSconfig
42 *
43 * @return void
44 */
45 public function initialize(AbstractLinkBrowserController $linkBrowser, $identifier, array $configuration);
46
47 /**
48 * Checks if this is the handler for the given link
49 *
50 * The handler may store this information locally for later usage.
51 *
52 * @param array $linkParts Link parts as returned from TypoLinkCodecService
53 *
54 * @return bool
55 */
56 public function canHandleLink(array $linkParts);
57
58 /**
59 * Format the current link for HTML output
60 *
61 * @return string
62 */
63 public function formatCurrentUrl();
64
65 /**
66 * Render the link handler
67 *
68 * @param ServerRequestInterface $request
69 *
70 * @return string
71 */
72 public function render(ServerRequestInterface $request);
73
74 /**
75 * Return TRUE if the handler supports to update a link.
76 *
77 * This is useful for file or page links, when only attributes are changed.
78 *
79 * @return bool
80 */
81 public function isUpdateSupported();
82
83 /**
84 * @return string[] Array of body-tag attributes
85 */
86 public function getBodyTagAttributes();
87 }