![]() |
TYPO3
7.6
|
Public Member Functions | |
load ($modulesArray, BackendUserAuthentication $beUser=null) | |
checkExtensionModule ($name) | |
checkMod ($name, $fullPath) | |
checkModAccess ($name, $MCONF) | |
checkModWorkspace ($name, $MCONF) | |
parseModulesArray ($arr) | |
cleanName ($str) | |
getRelativePath ($baseDir, $destDir) | |
Public Attributes | |
$modules = array() | |
$absPathArray = array() | |
$modListGroup = array() | |
$modListUser = array() | |
$BE_USER | |
$observeWorkspaces = false | |
Protected Member Functions | |
getModuleSetupInformation ($moduleName, $pathToModuleDirectory) | |
getLanguageService () | |
Protected Attributes | |
$navigationComponents = array() | |
This document provides a class that loads the modules for the TYPO3 interface.
Load Backend Interface modules
Typically instantiated like this: $this->loadModules = GeneralUtility::makeInstance(::class); $this->loadModules->load($TBE_MODULES);
Definition at line 34 of file ModuleLoader.php.
checkExtensionModule | ( | $name | ) |
If the module name ($name) is a module from an extension (has path in $this->absPathArray) then that path is returned relative to PATH_site
string | $name | Module name |
Definition at line 208 of file ModuleLoader.php.
References PathUtility\stripPathSitePrefix().
Referenced by ModuleLoader\load().
checkMod | ( | $name, | |
$fullPath | |||
) |
Here we check for the module.
Return values: 'notFound': If the module was not found in the path (no "conf.php" file) FALSE: If no access to the module (access check failed) array(): Configuration array, in case a valid module where access IS granted exists.
string | $name | Module name |
string | $fullPath | Absolute path to module |
Definition at line 228 of file ModuleLoader.php.
References $GLOBALS, $lang, $MCONF, ModuleLoader\checkModAccess(), ModuleLoader\checkModWorkspace(), GeneralUtility\deprecationLog(), elseif, ExtensionManagementUtility\extPath(), ModuleLoader\getLanguageService(), ModuleLoader\getModuleSetupInformation(), ModuleLoader\getRelativePath(), ExtensionManagementUtility\isLoaded(), and GeneralUtility\resolveBackPath().
Referenced by ModuleLoader\load().
checkModAccess | ( | $name, | |
$MCONF | |||
) |
Returns TRUE if the internal BE_USER has access to the module $name with $MCONF (based on security level set for that module)
string | $name | Module name |
array | $MCONF | MCONF array (module configuration array) from the modules conf.php file (contains settings about what access level the module has) |
Definition at line 433 of file ModuleLoader.php.
References $MCONF.
Referenced by ModuleLoader\checkMod().
checkModWorkspace | ( | $name, | |
$MCONF | |||
) |
Check if a module is allowed inside the current workspace for be user Processing happens only if $this->observeWorkspaces is TRUE
string | $name | Module name (unused) |
array | $MCONF | MCONF array (module configuration array) from the modules conf.php file (contains settings about workspace restrictions) |
Definition at line 466 of file ModuleLoader.php.
References $MCONF, elseif, and GeneralUtility\inList().
Referenced by ModuleLoader\checkMod().
cleanName | ( | $str | ) |
The $str is cleaned so that it contains alphanumerical characters only. Module names must only consist of these characters
string | $str | String to clean up |
Definition at line 521 of file ModuleLoader.php.
Referenced by ModuleLoader\parseModulesArray().
|
protected |
Definition at line 562 of file ModuleLoader.php.
References $GLOBALS.
Referenced by ModuleLoader\checkMod().
|
protected |
fetches the conf.php file of a certain module, and also merges that with some additional configuration
\string | $moduleName | the combined name of the module, can be "web", "web_info", or "tools_log" |
\string | $pathToModuleDirectory | the path where the module data is put, used for the conf.php or the modScript |
Definition at line 371 of file ModuleLoader.php.
References $GLOBALS, and $MCONF.
Referenced by ModuleLoader\checkMod().
getRelativePath | ( | $baseDir, | |
$destDir | |||
) |
Get relative path for $destDir compared to $baseDir
string | $baseDir | Base directory |
string | $destDir | Destination directory |
Definition at line 533 of file ModuleLoader.php.
References $baseDir, and GeneralUtility\resolveBackPath().
Referenced by ModuleLoader\checkMod().
load | ( | $modulesArray, | |
BackendUserAuthentication | $beUser = null |
||
) |
Init. The outcome of the load() function will be a $this->modules array populated with the backend module structure available to the BE_USER Further the global var $LANG will have labels and images for the modules loaded in an internal array.
array | $modulesArray | Should be the global var $TBE_MODULES, $BE_USER can optionally be set to an alternative Backend user object than the global var $BE_USER (which is the currently logged in user) |
BackendUserAuthentication | $beUser | Optional backend user object to use. If not set, the global BE_USER object is used. |
Definition at line 94 of file ModuleLoader.php.
References $GLOBALS, ModuleLoader\checkExtensionModule(), ModuleLoader\checkMod(), elseif, and ModuleLoader\parseModulesArray().
parseModulesArray | ( | $arr | ) |
Parses the moduleArray ($TBE_MODULES) into an internally useful structure. Returns an array where the keys are names of the module and the values may be TRUE (only module) or an array (of submodules)
array | $arr | ModuleArray ($TBE_MODULES) |
Definition at line 489 of file ModuleLoader.php.
References ModuleLoader\cleanName(), and GeneralUtility\trimExplode().
Referenced by ModuleLoader\load().
$absPathArray = array() |
Definition at line 48 of file ModuleLoader.php.
$BE_USER |
Definition at line 69 of file ModuleLoader.php.
$modListGroup = array() |
Definition at line 55 of file ModuleLoader.php.
$modListUser = array() |
Definition at line 62 of file ModuleLoader.php.
$modules = array() |
Definition at line 41 of file ModuleLoader.php.
|
protected |
Definition at line 83 of file ModuleLoader.php.
$observeWorkspaces = false |
Definition at line 76 of file ModuleLoader.php.