17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
50 'perms_clause' =>
'Using InfoModuleController::$perms_clause is deprecated and will not be possible anymore in TYPO3 v10.0.',
51 'modTSconfig' =>
'Using InfoModuleController::$modTSconfig is deprecated and will not be possible anymore in TYPO3 v10.0.',
52 'modMenu_setDefaultList' =>
'Using InfoModuleController::$modMenu_setDefaultList is deprecated and will not be possible anymore in TYPO3 v10.0.',
53 'modMenu_dontValidateList' =>
'Using InfoModuleController::$modMenu_dontValidateList is deprecated and will not be possible anymore in TYPO3 v10.0.',
54 'modMenu_type' =>
'Using InfoModuleController::$modMenu_type$ is deprecated and will not be possible anymore in TYPO3 v10.0.',
55 'extClassConf' =>
'Using InfoModuleController::extClassConf$ is deprecated and will not be possible anymore in TYPO3 v10.0.',
56 'extObj' =>
'Using InfoModuleController::$extObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
57 'content' =>
'Using InfoModuleController::$content is deprecated and will not be possible anymore in TYPO3 v10.0.',
58 'pObj' =>
'Using InfoModuleController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
59 'id' =>
'Using InfoModuleController::id$ is deprecated and will not be possible anymore in TYPO3 v10.0.',
60 'CMD' =>
'Using InfoModuleController::$CMD is deprecated, property will be removed in TYPO3 v10.0.',
61 'doc' =>
'Using InfoModuleController::$doc is deprecated, property will be removed in TYPO3 v10.0.',
62 'MCONF' =>
'Using InfoModuleController::$MCONF is deprecated, property will be removed in TYPO3 v10.0.',
69 'main' =>
'Using InfoModuleController::main() is deprecated and will not be possible anymore in TYPO3 v10.0.',
70 'init' =>
'Using InfoModuleController::init() is deprecated and will not be possible anymore in TYPO3 v10.0.',
71 'getModuleTemplate' =>
'Using InfoModuleController::getModuleTemplate() is deprecated and will not be possible anymore in TYPO3 v10.0.',
72 'menuConfig' =>
'Using InfoModuleController::menuConfig() is deprecated and will not be possible anymore in TYPO3 v10.0.',
73 'handleExternalFunctionValue' =>
'Using InfoModuleController::handleExternalFunctionValue() is deprecated and will not be possible anymore in TYPO3 v10.0.',
74 'mergeExternalItems' =>
'Using InfoModuleController::mergeExternalItems() is deprecated and will not be possible anymore in TYPO3 v10.0.',
75 'getExternalItemConfig' =>
'Using InfoModuleController::getExternalItemConfig() is deprecated and will not be possible anymore in TYPO3 v10.0.',
76 'extObjContent' =>
'Using InfoModuleController::extObjContent() is deprecated and will not be possible anymore in TYPO3 v10.0.',
77 'getExtObjContent' =>
'Using InfoModuleController::getExtObjContent() is deprecated and will not be possible anymore in TYPO3 v10.0.',
78 'checkExtObj' =>
'Using InfoModuleController::checkExtObj() is deprecated and will not be possible anymore in TYPO3 v10.0.',
79 'extObjHeader' =>
'Using InfoModuleController::extObjHeader() is deprecated, method will be removed in TYPO3 v10.0.',
80 'checkSubExtObj' =>
'Using InfoModuleController::checkSubExtObj() is deprecated, method will be removed in TYPO3 v10.0.',
212 $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
214 $languageService->includeLLFile(
'EXT:info/Resources/Private/Language/locallang_mod_web_info.xlf');
225 protected function init()
227 $this->
id = (int)GeneralUtility::_GP(
'id');
229 $this->CMD = GeneralUtility::_GP(
'CMD');
238 protected function main()
241 $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
249 if ($this->pageinfo) {
250 $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
252 $access = is_array($this->pageinfo);
253 if ($this->
id && $access || $backendUser->isAdmin() && !$this->id) {
254 if ($backendUser->isAdmin() && !$this->id) {
255 $this->pageinfo = [
'title' =>
'[root-level]',
'uid' => 0,
'pid' => 0];
258 $this->moduleTemplate->addJavaScriptCode(
260 'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (
int)$this->
id .
';
261 function jumpToUrl(URL) {
262 window.location.href = URL;
268 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/ContextMenu');
271 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
272 $this->view->assign(
'moduleName', (
string)$uriBuilder->buildUriFromRoute($this->moduleName));
277 $this->content .= $this->view->render();
280 $this->content = $this->moduleTemplate->header($languageService->getLL(
'title'));
291 public function mainAction(ServerRequestInterface $request): ResponseInterface
306 $this->moduleTemplate->setContent($this->content);
307 return new HtmlResponse($this->moduleTemplate->renderContent());
316 $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
318 $viewButton = $buttonBar->makeLinkButton()
321 $this->pageinfo[
'uid'],
325 ->setTitle($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
326 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-view-page',
Icon::SIZE_SMALL));
329 $shortCutButton = $buttonBar->makeShortcutButton()
330 ->setModuleName($this->moduleName)
331 ->setDisplayName($this->MOD_MENU[
'function'][$this->MOD_SETTINGS[
'function']])
342 ->setSetVariables(array_keys($this->MOD_MENU));
346 $cshButton = $buttonBar->makeHelpButton()
347 ->setModuleName(
'xMOD_csh_corebe')
348 ->setFieldName(
'pagetree_overview');
349 $buttonBar->addButton($cshButton);
357 $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
358 $menu->setIdentifier(
'WebInfoJumpMenu');
359 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
360 foreach ($this->MOD_MENU[
'function'] as $controller => $title) {
364 (
string)$uriBuilder->buildUriFromRoute(
369 'function' => $controller
375 if ($controller === $this->MOD_SETTINGS[
'function']) {
376 $item->setActive(
true);
378 $menu->addMenuItem($item);
380 $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
401 $view = GeneralUtility::makeInstance(StandaloneView::class);
421 $this->MOD_MENU[
'function'] = $this->
mergeExternalItems(
'web_info',
'function', $this->MOD_MENU[
'function']);
422 $blindActions = $this->modTSconfig[
'properties'][
'menu.'][
'function.'] ?? [];
423 foreach ($blindActions as $key => $value) {
424 if (!$value && array_key_exists($key, $this->MOD_MENU[
'function'])) {
425 unset($this->MOD_MENU[
'function'][$key]);
428 $this->MOD_SETTINGS =
BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP(
'SET'),
'web_info', $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
442 $mergeArray =
$GLOBALS[
'TBE_MODULES_EXT'][$modName][
'MOD_MENU'][$menuKey];
443 if (is_array($mergeArray)) {
445 foreach ($mergeArray as $k => $v) {
446 if (((
string)$v[
'ws'] ===
'' || $backendUser->workspace === 0 && GeneralUtility::inList($v[
'ws'],
'online'))
447 || $backendUser->workspace === -1 && GeneralUtility::inList($v[
'ws'],
'offline')
448 || $backendUser->workspace > 0 && GeneralUtility::inList($v[
'ws'],
'custom')
465 if ($MS_value ===
null) {
466 $MS_value = $this->MOD_SETTINGS[$MM_key];
483 if (isset(
$GLOBALS[
'TBE_MODULES_EXT'][$modName])) {
484 return (
string)$value !==
''
485 ?
$GLOBALS[
'TBE_MODULES_EXT'][$modName][
'MOD_MENU'][$menuKey][$value]
486 :
$GLOBALS[
'TBE_MODULES_EXT'][$modName][
'MOD_MENU'][$menuKey];
499 if (is_array($this->extClassConf) && $this->extClassConf[
'name']) {
500 $this->extObj = GeneralUtility::makeInstance($this->extClassConf[
'name']);
501 if (is_callable([$this->extObj,
'init'])) {
502 $this->extObj->init($this);
505 $this->MOD_SETTINGS =
BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP(
'SET'),
'web_info', $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
516 if (is_object($this->extObj) && is_callable([$this->extObj,
'checkExtObj'])) {
517 $this->extObj->checkExtObj();
529 if (is_callable([$this->extObj,
'head'])) {
530 $this->extObj->head();
539 if ($this->extObj ===
null) {
541 $flashMessage = GeneralUtility::makeInstance(
543 $languageService->sL(
'LLL:EXT:backend/Resources/Private/Language/locallang.xlf:no_modules_registered'),
544 $languageService->getLL(
'title'),
547 $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
549 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
550 $defaultFlashMessageQueue->enqueue($flashMessage);
552 if (is_callable([$this->extObj,
'main'])) {
553 $main = $this->extObj->main();
554 if ($main instanceof ResponseInterface) {
555 $stream = $main->getBody();
557 $main = $stream->getContents();
559 $this->content .= $main;
575 $this->content = $savedContent;