/** * Injects the request object for the current request or subrequest * As this controller goes only through the main() method, it is rather simple for now * * @param ServerRequestInterface $request the current request * @param ResponseInterface $response the prepared response object * @return ResponseInterface the response with the content */ public function mainAction(ServerRequestInterface $request, ResponseInterface $response) { $this->determineScriptUrl($request); $this->initVariables($request); $this->loadLinkHandlers(); $this->initCurrentUrl(); $menuData = $this->buildMenuArray(); $renderLinkAttributeFields = $this->renderLinkAttributeFields(); $browserContent = $this->displayedLinkHandler->render($request); $this->initDocumentTemplate(); $content = $this->doc->startPage('Link Browser'); $content .= $this->doc->getFlashMessages(); if ($this->currentLink) { $content .= '<!-- Print current URL --> <table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl"> <tr> <td>' . $this->getLanguageService()->getLL('currentLink', true) . ': ' . htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) . '</td> </tr> </table>'; } $content .= $this->doc->getTabMenuRaw($menuData); $content .= $renderLinkAttributeFields; $content .= '<div class="linkBrowser-tabContent">' . $browserContent . '</div>'; $content .= $this->doc->endPage(); $response->getBody()->write($this->doc->insertStylesAndJS($content)); return $response; }
/** * Injects the request object for the current request or subrequest * As this controller goes only through the main() method, it is rather simple for now * * @param ServerRequestInterface $request the current request * @param ResponseInterface $response the prepared response object * @return ResponseInterface the response with the content */ public function mainAction(ServerRequestInterface $request, ResponseInterface $response) { $this->determineScriptUrl($request); $this->initVariables($request); $this->loadLinkHandlers(); $this->initCurrentUrl(); $menuData = $this->buildMenuArray(); $renderLinkAttributeFields = $this->renderLinkAttributeFields(); $browserContent = $this->displayedLinkHandler->render($request); $this->initDocumentTemplate(); $content = $this->doc->startPage('Link Browser'); $content .= $this->doc->getFlashMessages(); if (!empty($this->currentLinkParts)) { $content .= $this->renderCurrentUrl(); } $content .= '<div class="link-browser-section link-browser-tabs">' . $this->doc->getTabMenuRaw($menuData) . '</div>'; $content .= $renderLinkAttributeFields; $content .= $browserContent; $content .= $this->doc->endPage(); $response->getBody()->write($this->doc->insertStylesAndJS($content)); return $response; }