17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
41 'main' =>
'Using ElementBrowserController::main() is deprecated and will not be possible anymore in TYPO3 v10.0.',
73 $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
81 protected function init()
85 $this->mode = GeneralUtility::_GP(
'mode');
95 public function mainAction(ServerRequestInterface $request): ResponseInterface
98 if ($this->mode ===
'wizard' || $this->mode ===
'rte') {
99 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
100 return new RedirectResponse((
string)$uriBuilder->buildUriFromRoute(
'wizard_link', $_GET), 303);
102 return new HtmlResponse($this->
main());
110 protected function main()
115 $browserRendered =
false;
116 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/browse_links.php'][
'browserRendering'] ?? [] as $className) {
117 $browserRenderObj = GeneralUtility::makeInstance($className);
118 if (is_object($browserRenderObj) && method_exists($browserRenderObj,
'isValid') && method_exists($browserRenderObj,
'render')) {
119 if ($browserRenderObj->isValid($this->mode, $this)) {
120 $content = $browserRenderObj->render($this->mode, $this);
121 $browserRendered =
true;
128 if (!$browserRendered) {
132 $modData = $backendUser->getModuleData(
'browse_links.php',
'ses');
133 list($modData) = $browser->processSessionData($modData);
134 $backendUser->pushModuleData(
'browse_links.php', $modData);
136 $content = $browser->render();
153 $browser = GeneralUtility::makeInstance($className);
154 if (!$browser instanceof ElementBrowserInterface) {
155 throw new \UnexpectedValueException(
'The specified element browser "' . $className .
'" does not implement the required ElementBrowserInterface', 1442763890);