‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Template\ModuleTemplate Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\ModuleTemplate:
TYPO3\CMS\Core\View\ViewInterface TYPO3\CMS\Core\View\ResponsableViewInterface

Public Member Functions

 __construct (protected readonly PageRenderer $pageRenderer, protected readonly IconFactory $iconFactory, protected readonly UriBuilder $uriBuilder, protected readonly ModuleProvider $moduleProvider, protected readonly FlashMessageService $flashMessageService, protected readonly ExtensionConfiguration $extensionConfiguration, protected readonly ViewInterface $view, protected readonly ServerRequestInterface $request,)
 
 assign (string $key, mixed $value)
 
 assignMultiple (array $values)
 
 render (string $templateFileName='')
 
 renderResponse (string $templateFileName='')
 
 setBodyTag (string $bodyTag)
 
 setTitle (string $title, string $context='')
 
 getDocHeaderComponent ()
 
 setForm (string $formTag='')
 
 setModuleId (string $moduleId)
 
 setModuleName (string $moduleName)
 
 setModuleClass (string $moduleClass)
 
 addFlashMessage (string $messageBody, string $messageTitle='', ContextualFeedbackSeverity $severity=ContextualFeedbackSeverity::OK, bool $storeInSession=true)
 
 setFlashMessageQueue (FlashMessageQueue $flashMessageQueue)
 
 setUiBlock (bool $uiBlock)
 
 makeDocHeaderModuleMenu (array $additionalQueryParams=[])
 

Protected Member Functions

 prepareRender (string $templateFileName)
 
 dispatchNotificationMessages ()
 
 getLanguageService ()
 
 getBackendUser ()
 

Protected Attributes

bool $uiBlock = false
 
string $moduleId = ''
 
string $moduleName = ''
 
string $moduleClass = ''
 
string $title = ''
 
string $bodyTag = '<body>'
 
string $formTag = ''
 
FlashMessageQueue $flashMessageQueue
 
DocHeaderComponent $docHeaderComponent
 

Detailed Description

A class taking care of the "outer" HTML of a module, especially the doc header and other related parts.

Definition at line 45 of file ModuleTemplate.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Template\ModuleTemplate::__construct ( protected readonly PageRenderer  $pageRenderer,
protected readonly IconFactory  $iconFactory,
protected readonly UriBuilder  $uriBuilder,
protected readonly ModuleProvider  $moduleProvider,
protected readonly FlashMessageService  $flashMessageService,
protected readonly ExtensionConfiguration  $extensionConfiguration,
protected readonly ViewInterface  $view,
protected readonly ServerRequestInterface  $request 
)

Member Function Documentation

◆ addFlashMessage()

TYPO3\CMS\Backend\Template\ModuleTemplate::addFlashMessage ( string  $messageBody,
string  $messageTitle = '',
ContextualFeedbackSeverity  $severity = ContextualFeedbackSeverity::OK,
bool  $storeInSession = true 
)

◆ assign()

TYPO3\CMS\Backend\Template\ModuleTemplate::assign ( string  $key,
mixed  $value 
)

Add a variable to the view data collection.

Implements TYPO3\CMS\Core\View\ViewInterface.

Definition at line 94 of file ModuleTemplate.php.

Referenced by TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController\searchAction().

◆ assignMultiple()

◆ dispatchNotificationMessages()

TYPO3\CMS\Backend\Template\ModuleTemplate::dispatchNotificationMessages ( )
protected

Dispatches all messages in a special FlashMessageQueue to the PageRenderer to be rendered as inline notifications

Definition at line 308 of file ModuleTemplate.php.

References TYPO3\CMS\Core\Page\JavaScriptModuleInstruction\create(), and TYPO3\CMS\Core\Messaging\FlashMessageQueue\NOTIFICATION_QUEUE.

Referenced by TYPO3\CMS\Backend\Template\ModuleTemplate\prepareRender().

◆ getBackendUser()

TYPO3\CMS\Backend\Template\ModuleTemplate::getBackendUser ( )
protected

Definition at line 323 of file ModuleTemplate.php.

References $GLOBALS.

◆ getDocHeaderComponent()

TYPO3\CMS\Backend\Template\ModuleTemplate::getDocHeaderComponent ( )

Get the DocHeader. Can be used in controllers to add custom buttons / menus / ... to the doc header.

Definition at line 181 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$docHeaderComponent.

Referenced by TYPO3\CMS\Tstemplate\Controller\ActiveTypoScriptController\addBackButtonToDocHeader(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderAddTaskButton(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderAddTaskGroupButton(), TYPO3\CMS\Filelist\Controller\File\FileUploadController\addDocHeaderButtons(), TYPO3\CMS\Filelist\Controller\File\EditFileController\addDocHeaderButtons(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderCloseAndSaveButtons(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderDeleteButton(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderNewButton(), TYPO3\CMS\Impexp\Controller\ImportController\addDocHeaderPreviewButton(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderReloadButton(), TYPO3\CMS\Scheduler\Controller\AvailableSchedulerTasksController\addDocHeaderShortcutButton(), TYPO3\CMS\Scheduler\Controller\SchedulerSetupCheckController\addDocHeaderShortcutButton(), TYPO3\CMS\Styleguide\Controller\StylesController\addDocHeaderShortcutButton(), TYPO3\CMS\Styleguide\Controller\PageTreesController\addDocHeaderShortcutButton(), TYPO3\CMS\Styleguide\Controller\ComponentsController\addDocHeaderShortcutButton(), TYPO3\CMS\Linkvalidator\Controller\LinkValidatorController\addDocHeaderShortCutButton(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\addDocHeaderShortcutButton(), TYPO3\CMS\Workspaces\Controller\ReviewController\addEditWorkspaceRecordButton(), TYPO3\CMS\Reports\Controller\ReportController\addMainMenu(), TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\addPreviewButtonToDocHeader(), TYPO3\CMS\Workspaces\Controller\ReviewController\addPreviewLink(), TYPO3\CMS\Lowlevel\Controller\ConfigurationController\addProviderDropDownToDocHeader(), TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\addSaveButtonToDocHeader(), TYPO3\CMS\Reports\Controller\ReportController\addShortcutButton(), TYPO3\CMS\Workspaces\Controller\ReviewController\addShortcutButton(), TYPO3\CMS\Tstemplate\Controller\TemplateRecordsOverviewController\addShortcutButtonToDocHeader(), TYPO3\CMS\Tstemplate\Controller\InfoModifyController\addShortcutButtonToDocHeader(), TYPO3\CMS\Lowlevel\Controller\ConfigurationController\addShortcutButtonToDocHeader(), TYPO3\CMS\Backend\Controller\PageTsConfig\PageTsConfigRecordsOverviewController\addShortcutButtonToDocHeader(), TYPO3\CMS\Backend\Controller\PageTsConfig\PageTsConfigActiveController\addShortcutButtonToDocHeader(), TYPO3\CMS\Tstemplate\Controller\TemplateAnalyzerController\addShortcutButtonToDocHeader(), TYPO3\CMS\Backend\Controller\PageTsConfig\PageTsConfigIncludesController\addShortcutButtonToDocHeader(), TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\addShortcutButtonToDocHeader(), TYPO3\CMS\Tstemplate\Controller\ActiveTypoScriptController\addShortcutButtonToDocHeader(), TYPO3\CMS\Workspaces\Controller\ReviewController\addWorkspaceSelector(), TYPO3\CMS\Backend\Controller\SiteConfigurationController\configureEditViewDocHeader(), TYPO3\CMS\Backend\Controller\SiteConfigurationController\configureOverViewDocHeader(), TYPO3\CMS\Backend\Controller\ContentElement\MoveElementController\getButtons(), TYPO3\CMS\Setup\Controller\SetupModuleController\getButtons(), TYPO3\CMS\Backend\Controller\EditDocumentController\getButtons(), TYPO3\CMS\Backend\Controller\RecordListController\getDocHeaderButtons(), TYPO3\CMS\Form\Controller\FormEditorController\initializeModuleTemplate(), TYPO3\CMS\Form\Controller\FormManagerController\initializeModuleTemplate(), TYPO3\CMS\Backend\Controller\EditDocumentController\languageSwitch(), TYPO3\CMS\Backend\Controller\PageLayoutController\makeActionMenu(), TYPO3\CMS\Backend\Controller\PageLayoutController\makeButtons(), TYPO3\CMS\Backend\Template\ModuleTemplate\makeDocHeaderModuleMenu(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\registerDocHeader(), TYPO3\CMS\Webhooks\Controller\ManagementController\registerDocHeaderButtons(), TYPO3\CMS\Recycler\Controller\RecyclerModuleController\registerDocHeaderButtons(), TYPO3\CMS\Reactions\Controller\ManagementController\registerDocHeaderButtons(), TYPO3\CMS\Redirects\Controller\ManagementController\registerDocHeaderButtons(), TYPO3\CMS\Beuser\Controller\PermissionController\registerDocHeaderButtons(), TYPO3\CMS\Backend\Controller\EditDocumentController\resolveMetaInformation(), and TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController\setUpDocHeader().

◆ getLanguageService()

TYPO3\CMS\Backend\Template\ModuleTemplate::getLanguageService ( )
protected

◆ makeDocHeaderModuleMenu()

◆ prepareRender()

◆ render()

TYPO3\CMS\Backend\Template\ModuleTemplate::render ( string  $templateFileName = '')

Render the module.

Implements TYPO3\CMS\Core\View\ViewInterface.

Definition at line 112 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\prepareRender().

◆ renderResponse()

◆ setBodyTag()

TYPO3\CMS\Backend\Template\ModuleTemplate::setBodyTag ( string  $bodyTag)

Set to something like '<body id="foo">' when a special body tag is needed.

Definition at line 158 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$bodyTag.

◆ setFlashMessageQueue()

TYPO3\CMS\Backend\Template\ModuleTemplate::setFlashMessageQueue ( FlashMessageQueue  $flashMessageQueue)

ModuleTemplate by default uses queue 'core.template.flashMessages'. Modules may want to maintain an own queue. Use this method to render flash messages of a non-default queue at the default position in module HTML output. Call this method before adding single messages with addFlashMessage().

Definition at line 242 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$flashMessageQueue.

◆ setForm()

TYPO3\CMS\Backend\Template\ModuleTemplate::setForm ( string  $formTag = '')

A "<form>" tag encapsulating the entire module, including doc-header.

Definition at line 189 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$formTag.

◆ setModuleClass()

TYPO3\CMS\Backend\Template\ModuleTemplate::setModuleClass ( string  $moduleClass)

Optional 'class="module {moduleClass}"' on first

in body. Can be helpful styling modules.

Definition at line 219 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$moduleClass.

◆ setModuleId()

TYPO3\CMS\Backend\Template\ModuleTemplate::setModuleId ( string  $moduleId)

Optional 'data-module-id="{moduleId}"' on first

in body. Can be helpful in JavaScript.

Definition at line 199 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$moduleId.

◆ setModuleName()

TYPO3\CMS\Backend\Template\ModuleTemplate::setModuleName ( string  $moduleName)

Optional 'data-module-name="{moduleName}"' on first

in body. Can be helpful in JavaScript.

Definition at line 209 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$moduleName.

Referenced by TYPO3\CMS\Backend\Template\ModuleTemplate\__construct().

◆ setTitle()

TYPO3\CMS\Backend\Template\ModuleTemplate::setTitle ( string  $title,
string  $context = '' 
)

◆ setUiBlock()

TYPO3\CMS\Backend\Template\ModuleTemplate::setUiBlock ( bool  $uiBlock)

UI block is a spinner shown during browser rendering phase of the module, automatically removed when rendering finished. This is done by default, but the UI block can be turned off when needed for whatever reason.

Definition at line 253 of file ModuleTemplate.php.

References TYPO3\CMS\Backend\Template\ModuleTemplate\$uiBlock.

Referenced by TYPO3\CMS\Backend\Controller\EditDocumentController\main().

Member Data Documentation

◆ $bodyTag

string TYPO3\CMS\Backend\Template\ModuleTemplate::$bodyTag = '<body>'
protected

◆ $docHeaderComponent

DocHeaderComponent TYPO3\CMS\Backend\Template\ModuleTemplate::$docHeaderComponent
protected

◆ $flashMessageQueue

FlashMessageQueue TYPO3\CMS\Backend\Template\ModuleTemplate::$flashMessageQueue
protected

◆ $formTag

string TYPO3\CMS\Backend\Template\ModuleTemplate::$formTag = ''
protected

◆ $moduleClass

string TYPO3\CMS\Backend\Template\ModuleTemplate::$moduleClass = ''
protected

◆ $moduleId

string TYPO3\CMS\Backend\Template\ModuleTemplate::$moduleId = ''
protected

◆ $moduleName

string TYPO3\CMS\Backend\Template\ModuleTemplate::$moduleName = ''
protected

◆ $title

string TYPO3\CMS\Backend\Template\ModuleTemplate::$title = ''
protected

◆ $uiBlock

bool TYPO3\CMS\Backend\Template\ModuleTemplate::$uiBlock = false
protected