‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Module\ModuleProvider Class Reference

Public Member Functions

 __construct (protected readonly ModuleRegistry $moduleRegistry)
 
 isModuleRegistered (string $identifier)
 
 getModule (string $identifier, ?BackendUserAuthentication $user=null, bool $respectWorkspaceRestrictions=true)
 
ModuleInterface[] getModules (?BackendUserAuthentication $user=null, bool $respectWorkspaceRestrictions=true, bool $grouped=true)
 
 getModuleForMenu (string $identifier, BackendUserAuthentication $user, bool $respectWorkspaceRestrictions=true)
 
MenuModule[] getModulesForModuleMenu (BackendUserAuthentication $user, bool $respectWorkspaceRestrictions=true)
 
 accessGranted (string $identifier, BackendUserAuthentication $user, bool $respectWorkspaceRestrictions=true)
 
 getFirstAccessibleModule (BackendUserAuthentication $user)
 
ModuleInterface[] getUserModules ()
 

Detailed Description

This is the central point to retrieve modules from the ModuleRegistry, while performing the necessary access checks, which ModuleRegistry does not deal with.

Definition at line 28 of file ModuleProvider.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Module\ModuleProvider::__construct ( protected readonly ModuleRegistry  $moduleRegistry)

Definition at line 30 of file ModuleProvider.php.

Member Function Documentation

◆ accessGranted()

◆ getFirstAccessibleModule()

TYPO3\CMS\Backend\Module\ModuleProvider::getFirstAccessibleModule ( BackendUserAuthentication  $user)

Returns the first module, accessible for the given user. This will only return submodules or standalone modules.

not part of TYPO3's API. Only for use in TYPO3 Core.

Definition at line 249 of file ModuleProvider.php.

References TYPO3\CMS\Backend\Module\ModuleProvider\accessGranted(), TYPO3\CMS\Backend\function, TYPO3\CMS\Backend\Module\ModuleInterface\getIdentifier(), TYPO3\CMS\Backend\Module\ModuleInterface\hasParentModule(), and TYPO3\CMS\Backend\Module\ModuleInterface\isStandalone().

◆ getModule()

TYPO3\CMS\Backend\Module\ModuleProvider::getModule ( string  $identifier,
?BackendUserAuthentication  $user = null,
bool  $respectWorkspaceRestrictions = true 
)

Returns a Module for the given identifier. In case a user is given, also access checks are performed.

Definition at line 44 of file ModuleProvider.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Backend\Module\ModuleProvider\accessGranted(), and TYPO3\CMS\Backend\Module\ModuleInterface\removeSubModule().

Referenced by TYPO3\CMS\Backend\Module\ModuleProvider\getModuleForMenu().

◆ getModuleForMenu()

TYPO3\CMS\Backend\Module\ModuleProvider::getModuleForMenu ( string  $identifier,
BackendUserAuthentication  $user,
bool  $respectWorkspaceRestrictions = true 
)

Return the requested (main) module if exist and allowed, prepared for menu generation or similar structured output (nested). Takes TSConfig into account. Does not respect "appearance[renderInModuleMenu]".

Definition at line 106 of file ModuleProvider.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Backend\Module\ModuleProvider\getModule(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getTSConfig(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\HelpToolbarItem\__construct().

◆ getModules()

ModuleInterface [] TYPO3\CMS\Backend\Module\ModuleProvider::getModules ( ?BackendUserAuthentication  $user = null,
bool  $respectWorkspaceRestrictions = true,
bool  $grouped = true 
)

◆ getModulesForModuleMenu()

MenuModule [] TYPO3\CMS\Backend\Module\ModuleProvider::getModulesForModuleMenu ( BackendUserAuthentication  $user,
bool  $respectWorkspaceRestrictions = true 
)

Returns all allowed modules for the current user, prepared for module menu generation or similar structured output (nested). Takes TSConfig and "appearance[renderInModuleMenu]" into account.

Returns
MenuModule[]

Definition at line 145 of file ModuleProvider.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Backend\Module\ModuleProvider\getModules(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getTSConfig(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ getUserModules()

ModuleInterface [] TYPO3\CMS\Backend\Module\ModuleProvider::getUserModules ( )

Get all modules with access=user, to be selected in the user/group records

Returns
ModuleInterface[]

not part of TYPO3's API. Only for use in TYPO3 Core.

Definition at line 265 of file ModuleProvider.php.

References TYPO3\CMS\Backend\Module\ModuleInterface\getAccess().

◆ isModuleRegistered()

TYPO3\CMS\Backend\Module\ModuleProvider::isModuleRegistered ( string  $identifier)

Simple wrapper for the registry, which just checks if a module is registered. Does NOT perform any access checks.

Definition at line 36 of file ModuleProvider.php.

References TYPO3\CMS\Webhooks\Message\$identifier.