[TYPO3-dev] TYPO3 BE extensions: sub and main modules and registerModule()

Michael Schams typo3.lists at 2014.trash.schams.net
Sat Jul 26 06:58:08 CEST 2014


On 22/07/14 18:34, Xavier Perseguers wrote:

>> The point is, that both extensions ("My Extension One" and "My Extension
>> Two") are independent from each other. You can install either one of
>> them or both - and they should both appear under "MY MAIN MODULE".
[...]
> (did not test) most probably you could check if the main module is
> already globally defined ($GLOBALS['...) and thus detect if the main
> module should be created or could be reused as this.

I tried your suggestion, too - but it does not work either :-(
Let's say you have two extensions:

- MyExtensionOne (EXT:my_extension_one)
- MyExtensionTwo (EXT:my_extension_two)

Then I use "Foo" as the 2nd argument of method registerModule() to 
create the main module in the first extension. As a result, I get an 
array $GLOBALS['TBE_MODULES']['MyExtensionOneFoo'].

Now I could check in the second extension, if a key like 
"MyExtension*Foo" already exists in the array and based on that, decide 
to create a new main module or not.

But in the case it exists, I can't attach the second extension to the 
existing main module, because when I use "Foo" as the 2nd argument of 
method registerModule() in MyExtensionTwo, the name gets expanded and 
ends up as "MyExtensionTwoFoo" - and the consequence is, that there is 
no main module with this name, so the BE shows an orphaned sub-module. 
Does this make sense?

Any other ideas would be much appreciated :-)


Cheers
Michael



More information about the TYPO3-dev mailing list