InfoModuleController
Script Class for the Web > Info module This class creates the framework to which other extensions can connect their sub-modules
This class is a specific Backend controller implementation and is not part of the TYPO3's Core API.
Table of Contents
Properties
- $MOD_MENU : array<string|int, mixed>
- The module menu items array. Each key represents a key for which values can range between the items in the array of that key.
- $MOD_SETTINGS : array<string|int, mixed>
- Current settings for the keys of the MOD_MENU array Written by client classes.
- $pageinfo : array<string|int, mixed>
- $container : ContainerInterface
- $content : string
- Generally used for accumulating the output content of backend modules
- $extClassConf : array<string|int, mixed>
- $extObj : object
- May contain an instance of a 'Function menu module' which connects to this backend module.
- $flashMessageService : FlashMessageService
- $iconFactory : IconFactory
- $id : int
- $modMenu_dontValidateList : string
- dontValidateList can be used to list variables that should not be checked if their value is found in the MOD_MENU array. Used for dynamically generated menus.
- $modMenu_setDefaultList : string
- List of default values from $MOD_MENU to set in the output array (only if the values from MOD_MENU are not arrays) Can be set from extension classes of this class before the init() function is called.
- $modMenu_type : string
- If type is 'ses' then the data is stored as session-lasting data. This means that it'll be wiped out the next time the user logs in.
- $modTSconfig : array<string|int, mixed>
- Module TSconfig based on PAGE TSconfig / USER TSconfig
- $moduleName : string
- The name of the module
- $moduleTemplate : ModuleTemplate
- ModuleTemplate Container
- $moduleTemplateFactory : ModuleTemplateFactory
- $pageRenderer : PageRenderer
- $perms_clause : string
- A WHERE clause for selection records from the pages table based on read-permissions of the current backend user.
- $uriBuilder : UriBuilder
- $view : StandaloneView
Methods
- __construct() : mixed
- mainAction() : ResponseInterface
- Injects the request object for the current request or subrequest Then checks for module functions that have hooked in, and renders menu etc.
- checkExtObj() : mixed
- Creates an instance of the class found in $this->extClassConf['name'] in $this->extObj if any (this should hold three keys, "name", "path" and "title" if a "Function menu module" tries to connect...) This value in extClassConf might be set by an extension (in an ext_tables/ext_localconf file) which thus "connects" to a module.
- extObjContent() : mixed
- Calls the 'main' function inside the "Function menu module" if present
- generateMenu() : mixed
- Generate the ModuleMenu
- getBackendUser() : BackendUserAuthentication
- getButtons() : mixed
- Create the panel of buttons for submitting the form or otherwise perform operations.
- getExternalItemConfig() : mixed
- Returns configuration values from the global variable $TBE_MODULES_EXT for the module given.
- getFluidTemplateObject() : StandaloneView
- returns a new standalone view, shorthand function
- getLanguageService() : LanguageService
- handleExternalFunctionValue() : mixed
- Loads $this->extClassConf with the configuration for the CURRENT function of the menu.
- init() : mixed
- Initializes the backend module by setting internal variables, initializing the menu.
- main() : mixed
- Initialize module header etc and call extObjContent function
- menuConfig() : mixed
- Initializes the internal MOD_MENU array setting and unsetting items based on various conditions. It also merges in external menu items from the global array TBE_MODULES_EXT (see mergeExternalItems()) Then MOD_SETTINGS array is cleaned up (see \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData()) so it contains only valid values. It's also updated with any SET[] values submitted.
- mergeExternalItems() : array<string|int, mixed>
- Merges menu items from global array $TBE_MODULES_EXT
Properties
$MOD_MENU
The module menu items array. Each key represents a key for which values can range between the items in the array of that key.
public
array<string|int, mixed>
$MOD_MENU
= ['function' => []]
Written by client classes.
$MOD_SETTINGS
Current settings for the keys of the MOD_MENU array Written by client classes.
public
array<string|int, mixed>
$MOD_SETTINGS
= []
$pageinfo
public
array<string|int, mixed>
$pageinfo
= []
Used by client classes.
$container
protected
ContainerInterface
$container
$content
Generally used for accumulating the output content of backend modules
protected
string
$content
= ''
$extClassConf
protected
array<string|int, mixed>
$extClassConf
Contains module configuration parts from TBE_MODULES_EXT if found
$extObj
May contain an instance of a 'Function menu module' which connects to this backend module.
protected
object
$extObj
$flashMessageService
protected
FlashMessageService
$flashMessageService
$iconFactory
protected
IconFactory
$iconFactory
$id
protected
int
$id
Value of the GET/POST var 'id'
$modMenu_dontValidateList
dontValidateList can be used to list variables that should not be checked if their value is found in the MOD_MENU array. Used for dynamically generated menus.
protected
string
$modMenu_dontValidateList
= ''
Can be set from extension classes of this class before the init() function is called.
$modMenu_setDefaultList
List of default values from $MOD_MENU to set in the output array (only if the values from MOD_MENU are not arrays) Can be set from extension classes of this class before the init() function is called.
protected
string
$modMenu_setDefaultList
= ''
$modMenu_type
If type is 'ses' then the data is stored as session-lasting data. This means that it'll be wiped out the next time the user logs in.
protected
string
$modMenu_type
= ''
Can be set from extension classes of this class before the init() function is called.
$modTSconfig
Module TSconfig based on PAGE TSconfig / USER TSconfig
protected
array<string|int, mixed>
$modTSconfig
$moduleName
The name of the module
protected
string
$moduleName
= 'web_info'
$moduleTemplate
ModuleTemplate Container
protected
ModuleTemplate
$moduleTemplate
$moduleTemplateFactory
protected
ModuleTemplateFactory
$moduleTemplateFactory
$pageRenderer
protected
PageRenderer
$pageRenderer
$perms_clause
A WHERE clause for selection records from the pages table based on read-permissions of the current backend user.
protected
string
$perms_clause
$uriBuilder
protected
UriBuilder
$uriBuilder
$view
protected
StandaloneView
$view
Methods
__construct()
public
__construct(IconFactory $iconFactory, PageRenderer $pageRenderer, UriBuilder $uriBuilder, FlashMessageService $flashMessageService, ContainerInterface $container, ModuleTemplateFactory $moduleTemplateFactory) : mixed
Parameters
- $iconFactory : IconFactory
- $pageRenderer : PageRenderer
- $uriBuilder : UriBuilder
- $flashMessageService : FlashMessageService
- $container : ContainerInterface
- $moduleTemplateFactory : ModuleTemplateFactory
mainAction()
Injects the request object for the current request or subrequest Then checks for module functions that have hooked in, and renders menu etc.
public
mainAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
the current request
Return values
ResponseInterface —the response with the content
checkExtObj()
Creates an instance of the class found in $this->extClassConf['name'] in $this->extObj if any (this should hold three keys, "name", "path" and "title" if a "Function menu module" tries to connect...) This value in extClassConf might be set by an extension (in an ext_tables/ext_localconf file) which thus "connects" to a module.
protected
checkExtObj(ServerRequestInterface $request) : mixed
The array $this->extClassConf is set in handleExternalFunctionValue() based on the value of MOD_SETTINGS[function] If an instance is created it is initiated with $this passed as value and $this->extClassConf as second argument. Further the $this->MOD_SETTING is cleaned up again after calling the init function.
Parameters
- $request : ServerRequestInterface
extObjContent()
Calls the 'main' function inside the "Function menu module" if present
protected
extObjContent(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
generateMenu()
Generate the ModuleMenu
protected
generateMenu() : mixed
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetButtons()
Create the panel of buttons for submitting the form or otherwise perform operations.
protected
getButtons(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
-
the current request
getExternalItemConfig()
Returns configuration values from the global variable $TBE_MODULES_EXT for the module given.
protected
getExternalItemConfig(string $modName, string $menuKey[, string $value = '' ]) : mixed
For example if the module is named "web_info" and the "function" key ($menuKey) of MOD_SETTINGS is "stat" ($value) then you will have the values of $TBE_MODULES_EXT['webinfo']['MOD_MENU']['function']['stat'] returned.
Parameters
- $modName : string
-
Module name
- $menuKey : string
-
Menu key, eg. "function" for the function menu. See $this->MOD_MENU
- $value : string = ''
-
Optionally the value-key to fetch from the array that would otherwise have been returned if this value was not set. Look source...
Return values
mixed —The value from the TBE_MODULES_EXT array.
getFluidTemplateObject()
returns a new standalone view, shorthand function
protected
getFluidTemplateObject() : StandaloneView
Return values
StandaloneViewgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicehandleExternalFunctionValue()
Loads $this->extClassConf with the configuration for the CURRENT function of the menu.
protected
handleExternalFunctionValue([string $MM_key = 'function' ][, string $MS_value = null ]) : mixed
Parameters
- $MM_key : string = 'function'
-
The key to MOD_MENU for which to fetch configuration. 'function' is default since it is first and foremost used to get information per "extension object" (I think that is what its called)
- $MS_value : string = null
-
The value-key to fetch from the config array. If NULL (default) MOD_SETTINGS[$MM_key] will be used. This is useful if you want to force another function than the one defined in MOD_SETTINGS[function]. Call this in init() function of your Script Class: handleExternalFunctionValue('function', $forcedSubModKey)
init()
Initializes the backend module by setting internal variables, initializing the menu.
protected
init(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
main()
Initialize module header etc and call extObjContent function
protected
main(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
-
the current request
menuConfig()
Initializes the internal MOD_MENU array setting and unsetting items based on various conditions. It also merges in external menu items from the global array TBE_MODULES_EXT (see mergeExternalItems()) Then MOD_SETTINGS array is cleaned up (see \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData()) so it contains only valid values. It's also updated with any SET[] values submitted.
protected
menuConfig(ServerRequestInterface $request) : mixed
Also loads the modTSconfig internal variable.
Parameters
- $request : ServerRequestInterface
mergeExternalItems()
Merges menu items from global array $TBE_MODULES_EXT
protected
mergeExternalItems(string $modName, string $menuKey, array<string|int, mixed> $menuArr) : array<string|int, mixed>
Parameters
- $modName : string
-
Module name for which to find value
- $menuKey : string
-
Menu key, eg. 'function' for the function menu.
- $menuArr : array<string|int, mixed>
-
The part of a MOD_MENU array to work on.
Return values
array<string|int, mixed> —Modified array part.