TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractFunctionModule Class Reference
Inheritance diagram for AbstractFunctionModule:
PageInformationController TranslationStatusController InfoPageTyposcriptConfigController LinkValidatorReport TemplateAnalyzerModuleFunctionController TypoScriptTemplateConstantEditorModuleFunctionController TypoScriptTemplateInformationModuleFunctionController TypoScriptTemplateObjectBrowserModuleFunctionController CreatePagesWizardModuleFunctionController SortPagesWizardModuleFunction

Public Member Functions

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

Public Attributes

 $pObj
 
 $extObj = null
 
 $thisPath = ''
 
 $localLangFile = 'locallang.xlf'
 
 $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 ( )

Same as ::checkExtObj()

Returns
void
See also
::checkExtObj()

Definition at line 231 of file AbstractFunctionModule.php.

References GeneralUtility\_GP(), BackendUtility\getModuleData(), and GeneralUtility\makeInstance().

extObjContent ( )

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

Returns
void

Definition at line 246 of file AbstractFunctionModule.php.

getBackendUserAuthentication ( )
protected
getBackPath ( )
protected
Returns
string
Deprecated:
since TYPO3 v8, will be removed in TYPO3 v9

Definition at line 292 of file AbstractFunctionModule.php.

References GeneralUtility\logDeprecatedFunction().

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 GeneralUtility\logDeprecatedFunction().

getDocumentTemplate ( )
protected
Returns
DocumentTemplate

Definition at line 283 of file AbstractFunctionModule.php.

References $GLOBALS.

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

Returns
void
See also
$function_key, ::init()

Definition at line 193 of file AbstractFunctionModule.php.

References GeneralUtility\_GP(), and BackendUtility\getModuleData().

incLocalLang ( )

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

Returns
void

Definition at line 208 of file AbstractFunctionModule.php.

References $GLOBALS, AbstractFunctionModule\getLanguageService(), and ArrayUtility\mergeRecursiveWithOverrule().

Referenced by AbstractFunctionModule\init().

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
RuntimeException
See also
::checkExtObj()

Definition at line 171 of file AbstractFunctionModule.php.

References AbstractFunctionModule\$pObj, and AbstractFunctionModule\incLocalLang().

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

Definition at line 146 of file AbstractFunctionModule.php.

$extObj = null

Definition at line 122 of file AbstractFunctionModule.php.

$function_key = ''

Definition at line 156 of file AbstractFunctionModule.php.

$localLangFile = 'locallang.xlf'

Definition at line 138 of file AbstractFunctionModule.php.

$pageRenderer = null
protected

Definition at line 161 of file AbstractFunctionModule.php.

Referenced by AbstractFunctionModule\getPageRenderer().

$pObj

Definition at line 117 of file AbstractFunctionModule.php.

Referenced by AbstractFunctionModule\init().

$thisPath = ''

Definition at line 130 of file AbstractFunctionModule.php.