ReStructured Text InfrastructureTYPO3 CMS - What's Newwiki.typo3.orgTYPO3 CMS Documentation

Bug #59369

Document possibility to have modules as navigation frame

Added by Helmut Hummel about 1 year ago. Updated about 1 year ago.

Status:Needs Feedback Start date:2014-06-05
Priority:Should have Due date:
Assigned To:Francois Suter % Done:

0%

Category:-
Target version:6.2

Description

While implementing CSRF protection for backend modules,
it was forgotten to implement a solution for navigation components
that also could be modules.

Add this possibility now by introducing yet another
configuration option for modules.

'navigationFrameModule' name of the module that is loaded in the navigation frame
'navigationFrameModuleParameters' additional parameters (if needed and specified)


Related issues

related to Core - Bug #58138: CSRF with registerModule and navFrameScript Resolved 2014-04-23

History

#1 Updated by Francois Suter about 1 year ago

  • Project changed from Documentation to Core APIs
  • Status changed from New to Needs Feedback
  • Assigned To set to Francois Suter
  • Target version set to 6.2

Hi Helmut,

I tried to figure out what this is all about, but even looking at the source code it remains quite opaque to me. When would such parameters be used? What is the person who opened the original bug report trying to achieve?

That being said, this obviously relates to developing BE modules and I'm afraid that we don't have anything on the topic in the whole documentation, so I'm not sure where to put this information.

#2 Updated by Helmut Hummel about 1 year ago

sorry for not being precise enough.

This is very similar to the TCA changes for wizards, where previously you specified a 'script' to the wizard, while you now specify a module name.

When registering a backend module you could specify a "navFrameScript" (either in old style $MCONF or in the addModule API call in ext_tables.php)

By doing so, the module will have an navigation iframe in addition to a content iframe and in the navigation iframe the URL specified for "navFrameScript" will be loaded.

The file list module still does it like this:

$MCONF['navFrameScript'] = '../../alt_file_navframe.php';

However, if you do not want to have an entry script for your navigation, but use a mod.php dispatched module action, until this change you had no way to register a navigation component. This is because mod.php dispatched modules need a CSRF token, which cannot be generated at registration time of the module (ext_tables.php loaded) as not no BE_USER is initialized to which the token can be bound to.

This:


    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
        'TYPO3.CMS.' . $_EXTKEY,
        'help',
        'about',
        'top',
        array('About' => 'index'),
        array(
            'access' => 'user,group',
            'icon' => 'EXT:about/ext_icon.gif',
            'labels' => 'LLL:EXT:lang/locallang_mod_help_about.xlf',
            'navFrameScript' => BackendUtility::getModuleUrl('my_Mod')
        )
    );

does not work!

So I created a new way to register a navigation component:


    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
        'TYPO3.CMS.' . $_EXTKEY,
        'help',
        'about',
        'top',
        array('About' => 'index'),
        array(
            'access' => 'user,group',
            'icon' => 'EXT:about/ext_icon.gif',
            'labels' => 'LLL:EXT:lang/locallang_mod_help_about.xlf',
            'navigationFrameModule' => 'my_Mod',
        )
    );

you just specify the module id and during rendering of the module menu, the URL for the navigation is generated.

I cannot answer the question where to put this information though, if we do not have documented the module registration API anywhere...

Hope this clears some things up

#3 Updated by Francois Suter about 1 year ago

Thanks for all the details. At least the information is here and is not lost complete.

I guess Core API is the right manual, but there's no chapter about this currently. I guess it could be added here:

http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/MainClasses/UsefulFunctions/Index.html#typo3-cms-core-utility-extensionmanagementutility

Also available in: Atom PDF