220 $this->view->assign(
'content',
$content);
254 $this->view = GeneralUtility::makeInstance(StandaloneView::class);
255 $this->view->setPartialRootPaths($this->partialRootPaths);
256 $this->view->setTemplateRootPaths($this->templateRootPaths);
257 $this->view->setLayoutRootPaths($this->layoutRootPaths);
258 $this->view->setTemplate($this->templateFile);
259 $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
260 $this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);
261 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
269 $this->pageRenderer->loadRequireJsModule(
'bootstrap');
271 $this->pageRenderer->loadRequireJsModule(
'TYPO3/CMS/Backend/ContextHelp');
272 $this->pageRenderer->loadRequireJsModule(
'TYPO3/CMS/Backend/DocumentHeader');
273 $this->pageRenderer->loadRequireJsModule(
'TYPO3/CMS/Backend/SplitButtons');
282 if (!empty(
$GLOBALS[
'TBE_STYLES'][
'stylesheet'])) {
283 $this->pageRenderer->addCssFile(
$GLOBALS[
'TBE_STYLES'][
'stylesheet']);
285 if (!empty(
$GLOBALS[
'TBE_STYLES'][
'stylesheet2'])) {
286 $this->pageRenderer->addCssFile(
$GLOBALS[
'TBE_STYLES'][
'stylesheet2']);
296 $this->pageRenderer->setXmlPrologAndDocType(
'<!DOCTYPE html>');
297 $this->pageRenderer->setCharSet(
'utf-8');
298 $this->pageRenderer->setLanguage(
$GLOBALS[
'LANG']->lang);
299 $this->pageRenderer->setMetaTag(
'name',
'viewport',
'width=device-width, initial-scale=1');
307 foreach ($this->javascriptCodeArray as $name => $code) {
308 $this->pageRenderer->addJsInlineCode($name, $code,
false);
321 $this->javascriptCodeArray[$name] = $code;
343 $this->pageRenderer->setTitle($this->title);
348 $this->view->assign(
'docHeader', $this->docHeaderComponent->docHeaderContent());
349 if ($this->moduleId) {
350 $this->view->assign(
'moduleId', $this->moduleId);
352 if ($this->moduleName) {
353 $this->view->assign(
'moduleName', $this->moduleName);
355 $this->view->assign(
'uiBlock', $this->uiBlock);
359 $renderedPage .= $this->view->render();
363 return $renderedPage;
382 public function setForm($formTag =
''): self
384 $this->view->assign(
'formTag', $formTag);
421 if (isset(
$GLOBALS[
'TBE_MODULES_EXT'][$moduleMenuIdentifier])) {
423 $GLOBALS[
'TBE_MODULES_EXT'][$moduleMenuIdentifier][
'MOD_MENU'][
'function'];
425 foreach ($menuEntries as $menuEntry) {
429 $menu->addMenuItem($menuItem);
431 $this->docHeaderComponent->getMenuRegistry()->addMenu($menu);
453 public function getDynamicTabMenu(array $menuItems, $domId, $defaultTabIndex = 1, $collapsible =
false, $wrapContent =
true, $storeLastActiveTab =
true)
455 $this->pageRenderer->loadRequireJsModule(
'TYPO3/CMS/Backend/Tabs');
457 .
'Resources/Private/Templates/DocumentTemplate/';
458 $view = GeneralUtility::makeInstance(StandaloneView::class);
462 'id' =>
'DTM-' . GeneralUtility::shortMD5($domId),
463 'items' => $menuItems,
464 'defaultTabIndex' => $defaultTabIndex,
465 'wrapContent' => $wrapContent,
466 'storeLastActiveTab' => $storeLastActiveTab,
497 trigger_error(
'ModuleTemplate->loadJavascriptLib() should not be used any longer, as this method will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
498 $this->pageRenderer->addJsFile($lib);
525 public function makeShortcutIcon($gvList, $setList, $modName, $motherModName =
'', $displayName =
'', $classes =
'btn btn-default btn-sm')
527 $gvList =
'route,id,' . $gvList;
529 $pathInfo = parse_url(GeneralUtility::getIndpEnv(
'REQUEST_URI'));
534 $moduleName = $modName ===
'xMOD_alt_doc.php' ?
'record_edit' : $modName;
537 if (GeneralUtility::_GET(
'route') !==
null) {
540 if ((
int)$motherModName === 1) {
541 $motherModule =
'top.currentModuleLoaded';
542 } elseif ($motherModName) {
543 $motherModule = GeneralUtility::quoteJSvalue($motherModName);
545 $motherModule =
'\'\
'';
547 $confirmationText = GeneralUtility::quoteJSvalue(
548 $this->
getLanguageService()->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.makeBookmark')
551 $shortcutUrl = $pathInfo[
'path'] .
'?' . $storeUrl;
552 $shortcutRepository = GeneralUtility::makeInstance(ShortcutRepository::class);
553 $shortcutExist = $shortcutRepository->shortcutExists($shortcutUrl);
555 if ($shortcutExist) {
556 return '<a class="active ' . htmlspecialchars($classes) .
'" title="">' .
557 $this->iconFactory->getIcon(
'actions-system-shortcut-active',
Icon::SIZE_SMALL)->render() .
'</a>';
560 $url = GeneralUtility::quoteJSvalue(rawurlencode($shortcutUrl));
561 $onClick =
'top.TYPO3.ShortcutMenu.createShortcut(' . GeneralUtility::quoteJSvalue(rawurlencode($modName)) .
562 ', ' . $url .
', ' . $confirmationText .
', ' . $motherModule .
', this, ' . GeneralUtility::quoteJSvalue($displayName) .
');return false;';
564 return '<a href="#" class="' . htmlspecialchars($classes) .
'" onclick="' . htmlspecialchars($onClick) .
'" title="' .
565 htmlspecialchars($this->
getLanguageService()->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.makeBookmark')) .
'">' .
566 $this->iconFactory->getIcon(
'actions-system-shortcut-new',
Icon::SIZE_SMALL)->render() .
'</a>';
583 $getParams = GeneralUtility::_GET();
584 $storeArray = array_merge(
585 GeneralUtility::compileSelectedGetVarsFromArray($gvList, $getParams),
586 [
'SET' => GeneralUtility::compileSelectedGetVarsFromArray($setList, (array)
$GLOBALS[
'SOBE']->MOD_SETTINGS)]
626 public function icons($type)
628 trigger_error(
'ModuleTemplate->icons() should not be used any longer, as this will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
632 $icon =
'status-dialog-error';
635 $icon =
'status-dialog-warning';
638 $icon =
'status-dialog-notification';
641 $icon =
'status-dialog-ok';
663 $thisLocation = $thisLocation ? $thisLocation : GeneralUtility::linkThisScript([
670 var T3_RETURN_URL = ' . GeneralUtility::quoteJSvalue(str_replace(
'%20',
'', rawurlencode(GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP(
'returnUrl'))))) .
';
671 var T3_THIS_LOCATION = ' . GeneralUtility::quoteJSvalue(str_replace(
'%20',
'', rawurlencode($thisLocation))) .
'
688 <!-- MAIN Header in page top -->
689 <h1 class="t3js-title-inlineedit">' . htmlspecialchars($text) .
'</h1>
705 if (!is_string($messageBody)) {
706 throw new \InvalidArgumentException(
'The message body must be of type string, "' . gettype($messageBody) .
'" given.', 1446483133);
709 $flashMessage = GeneralUtility::makeInstance(
710 \
TYPO3\CMS\Core\Messaging\FlashMessage::class,
735 if (!isset($this->flashMessageQueue)) {
737 $service = GeneralUtility::makeInstance(FlashMessageService::class);
738 $this->flashMessageQueue = $service->getMessageQueueByIdentifier();