Index: Classes/MVC/Controller/ActionController.php =================================================================== --- Classes/MVC/Controller/ActionController.php (revision 1499) +++ Classes/MVC/Controller/ActionController.php (working copy) @@ -81,6 +81,16 @@ protected $errorMethodName = 'errorAction'; /** + * The module menu items array. Each key represents a key for which values can range between the items in the array of that key. + * @var array + * @see initializeModuleMenu() + * @api + */ + protected $moduleMenu = array( + 'function' => array() + ); + + /** * Injects the reflection service * * @param Tx_Extbase_Reflection_Service $reflectionService @@ -319,6 +329,29 @@ } /** + * Initializes the module function menu before invoking an action method. + * + * Override this method if your extension provides a function menu. + * + * @param string $moduleName + * @return void + * @api + */ + public function initializeModuleMenu($moduleName) { + } + + /** + * Returns the module menu. + * + * @return array + * @see initializeModuleMenu() + * @api + */ + public function getModuleMenu() { + return $this->moduleMenu; + } + + /** * Initializes the controller before invoking an action method. * * Override this method to solve tasks which all actions have in Index: Classes/Dispatcher.php =================================================================== --- Classes/Dispatcher.php (revision 1499) +++ Classes/Dispatcher.php (working copy) @@ -432,11 +439,11 @@ 'actionName' => '', ); - $set = t3lib_div::_GP('SET'); - if (!$set) { - // Early return - return $controllerAction; - } + $config = $GLOBALS['TBE_MODULES'][$module]; + $controller = t3lib_div::makeInstance('Tx_' . $config['extensionName'] . '_Controller_' . $defaultController . 'Controller'); + $controller->initializeModuleMenu($module); + $moduleMenu = $controller->getModuleMenu(); + $set = t3lib_BEfunc::getModuleData($moduleMenu, t3lib_div::_GP('SET'), $module); $moduleFunction = $set['function']; $matches = array(); @@ -449,6 +456,7 @@ if (isset($functions[$moduleFunction])) { $controllerAction['controllerName'] = $defaultController; $controllerAction['actionName'] = 'extObj'; + // TODO: !VERY IMPORTANT! find a way to pass $moduleFunction as argument to the extObjAction } }