TYPO3 CMS  TYPO3_8-7
TYPO3\CMS\Backend\Module\AbstractFunctionModule Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Module\AbstractFunctionModule:
TYPO3\CMS\Frontend\Controller\PageInformationController TYPO3\CMS\Frontend\Controller\TranslationStatusController TYPO3\CMS\InfoPagetsconfig\Controller\InfoPageTyposcriptConfigController TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport TYPO3\CMS\Tstemplate\Controller\TemplateAnalyzerModuleFunctionController TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController TYPO3\CMS\WizardCrpages\Controller\CreatePagesWizardModuleFunctionController TYPO3\CMS\WizardSortpages\View\SortPagesWizardModuleFunction

Public Member Functions

 init (&$pObj, $conf)
 
 handleExternalFunctionValue ()
 
 incLocalLang ()
 
 checkExtObj ()
 
 extObjContent ()
 
 modMenu ()
 

Public Attributes

 $pObj
 
 $extObj = null
 
 $thisPath = ''
 
 $localLangFile = ''
 
 $extClassConf
 
 $function_key = ''
 

Protected Member Functions

 getLanguageService ()
 
 getBackendUserAuthentication ()
 
 getDocumentTemplate ()
 
 getBackPath ()
 
 getDatabaseConnection ()
 
 getPageRenderer ()
 

Protected Attributes

 $pageRenderer = null
 

Detailed Description

Parent class for 'Extension Objects' in backend modules.

Used for 'submodules' to other modules. Also called 'Function menu modules' in . And now its even called 'Extension Objects'. Or 'Module functions'. Wish we had just one name. Or a name at all...(?) Thank God its not so advanced when it works...

In other words this class is used for backend modules which is not true backend modules appearing in the menu but rather adds themselves as a new entry in the function menu which typically exists for a backend module (like Web>Functions, Web>Info or Tools etc...) The magic that binds this together is stored in the global variable $TBE_MODULES_EXT where extensions wanting to connect a module based on this class to an existing backend module store configuration which consists of the classname, script-path and a label (title/name).

For more information about this, please see the large example comment for the class . This will show the principle of a 'level-1' connection. The more advanced example - having two layers as it is done by the 'func_wizards' extension with the 'web_info' module - can be seen in the comment above.

EXAMPLE: One level. This can be seen in the extension 'frontend' where the info module have a function added. In 'ext_tables.php' this is done by this function call:

::insertModuleFunction( 'web_info', ::class, NULL, 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:mod_tx_cms_webinfo_page' );

EXAMPLE: Two levels. This is the advanced example. You can see it with the extension 'func_wizards' which is the first layer but then providing another layer for extensions to connect by. The key used in TBE_MODULES_EXT is normally 'function' (for the 'function menu') but the 'func_wizards' extension uses an alternative key for its configuration: 'wiz'. In the 'ext_tables.php' file of an extension ('wizard_crpages') which uses the framework provided by 'func_wizards' this looks like this:

::insertModuleFunction( 'web_func', ::class NULL, 'LLL:EXT:wizard_crpages/locallang.xlf:wiz_crMany', 'wiz' );

But for this two-level thing to work it also requires that the parent module (the real backend module) supports it. This is the case for the modules web_func and web_info since they have two times inclusion sections in their index.php scripts. For example (from web_func):

Make instance: $GLOBALS['SOBE'] = GeneralUtility::makeInstance(::class); $GLOBALS['SOBE']->init();

Anyways, the final interesting thing is to see what the framework "func_wizard" actually does:

class WebFunctionWizardsBaseController extends { var $localLangFile = "locallang.xlf"; var $function_key = "wiz"; function init(&$pObj, $conf) { OK, handles ordinary init. This includes setting up the menu array with ->modMenu parent::init($pObj,$conf); $this->handleExternalFunctionValue(); } }

Notice that the handleExternalFunctionValue of this class is called and that the ->function_key internal var is set!

The two level-2 sub-module "wizard_crpages" and "wizard_sortpages" are totally normal "submodules".

See also

Definition at line 108 of file AbstractFunctionModule.php.

Member Function Documentation

◆ checkExtObj()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::checkExtObj ( )

◆ extObjContent()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::extObjContent ( )

Calls the main function inside ANOTHER sub-submodule which might exist.

Definition at line 246 of file AbstractFunctionModule.php.

◆ getBackendUserAuthentication()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::getBackendUserAuthentication ( )
protected

◆ getBackPath()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::getBackPath ( )
protected
Returns
string
Deprecated:
since TYPO3 v8, will be removed in TYPO3 v9

Definition at line 292 of file AbstractFunctionModule.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ getDatabaseConnection()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::getDatabaseConnection ( )
protected
Returns
DatabaseConnection
Deprecated:
since TYPO3 v8, will be removed in TYPO3 v9, use the Doctrine DBAL layer via the ConnectionPool class

Definition at line 302 of file AbstractFunctionModule.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ getDocumentTemplate()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::getDocumentTemplate ( )
protected
Returns
DocumentTemplate

Definition at line 283 of file AbstractFunctionModule.php.

References $GLOBALS.

◆ getLanguageService()

◆ getPageRenderer()

◆ handleExternalFunctionValue()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::handleExternalFunctionValue ( )

If $this->function_key is set (which means there are two levels of object connectivity) then $this->extClassConf is loaded with the TBE_MODULES_EXT configuration for that sub-sub-module

See also
$function_key, ::init()

Definition at line 196 of file AbstractFunctionModule.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), and TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData().

◆ incLocalLang()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::incLocalLang ( )

Including any locallang file configured and merging its content over the current global LOCAL_LANG array (which is EXPECTED to exist!!!)

Deprecated:
since TYPO3 v8, will be removed in TYPO3 v9

Definition at line 210 of file AbstractFunctionModule.php.

References $GLOBALS, TYPO3\CMS\Backend\Module\AbstractFunctionModule\getLanguageService(), TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction(), and TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

◆ init()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::init ( $pObj,
  $conf 
)

Initialize the object

Parameters
BaseScriptClass$pObjA reference to the parent (calling) object
array$confThe configuration set for this module - from global array TBE_MODULES_EXT
Exceptions

Definition at line 173 of file AbstractFunctionModule.php.

References TYPO3\CMS\Backend\Module\AbstractFunctionModule\$pObj, and TYPO3\CMS\Backend\Module\AbstractFunctionModule\getLanguageService().

◆ modMenu()

TYPO3\CMS\Backend\Module\AbstractFunctionModule::modMenu ( )

Dummy function - but is used to set up additional menu items for this submodule.

Returns
array A MOD_MENU array which will be merged together with the one from the parent object
See also
init(), ::modMenu()

Definition at line 259 of file AbstractFunctionModule.php.

Member Data Documentation

◆ $extClassConf

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$extClassConf

Definition at line 148 of file AbstractFunctionModule.php.

◆ $extObj

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$extObj = null

Definition at line 122 of file AbstractFunctionModule.php.

◆ $function_key

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$function_key = ''

Definition at line 158 of file AbstractFunctionModule.php.

◆ $localLangFile

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$localLangFile = ''

Definition at line 140 of file AbstractFunctionModule.php.

◆ $pageRenderer

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$pageRenderer = null
protected

◆ $pObj

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$pObj

◆ $thisPath

TYPO3\CMS\Backend\Module\AbstractFunctionModule::$thisPath = ''

Definition at line 131 of file AbstractFunctionModule.php.