Project

General

Profile

Actions

Task #5097

closed

Function menu cannot be handled as with scbase for BE modules

Added by Xavier Perseguers over 14 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

See thread "Conceptual problem with BE modules" in typo3.projects.typo3v4mvc for details.

I'm currently working on function menu which is a standard feature of all scbase modules.

I was investigating how old-school modules are able to remember which function menu was active when we use another module and then go back to it. Instead of using default controller/action (which we have in our case), the module reuses last use function menu.

There is a few points. AFAIK we are missing the menuConfig() method of scbase modules that allows the module to prepare what will be the available functions before the "action" is being invoked (in case of scbase modules, the action is the method "main").

Proposed patch allows backend modules to register function menu "officially", just as scbase modules were able to do. This allows Extbase-based BE modules to better integrate into TYPO3's backend.

Patch is a draft and should be refined:

- I don't like the instantiation of the default controller to be able to call method "initializeModuleMenu()"
- I did not find a way to pass an dispatcher-generated argument to the extObj action of the resulting controller whenever a non-Extbase extension object (or module function) as been hooked into our module's function menu (see EXT:mvc_extjs_samples for examples)

The patch is clean from other pending patches but patched lines are likely to be a bit different by you. This is normal even if not perfect.

Once in, a backend controller may register function menu like this:

public function initializeModuleMenu($moduleName) {
    $this->moduleMenu['function'] = array(
        'BlankModule->first' => 'My first action',
        'BlankModule->second' => 'My second action',
        'BlankModule->third' => 'My third action',
    );

        // Merge externally-added function menu entries
    $scbase = t3lib_div::makeInstance('t3lib_SCbase');
    $this->moduleMenu['function'] = $scbase->mergeExternalItems($moduleName, 'function', $this->moduleMenu['function']);
}

(example taken from locally-modified BlankModule controller of EXT:mvc_extjs_samples)

The actual generation of the menu (combobox, ...) is up to the controller action to be done (typically using Tx_Fluid_ViewHelpers_Be_Menus_ActionMenuViewHelper) or as done in EXT:mvc_extjs with the extended ActionController.


Files

menu_config.diff (2.32 KB) menu_config.diff Xavier Perseguers, 2009-10-25 11:44
Actions

Also available in: Atom PDF