コードを読んだ後、\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin
実際には思ったより簡単です。
次のコードをext_localconf.php
powermailextendedに追加します。
if (!function_exists('configure_plugin_add_action')) {
/**
* Add a action to a existing frontend plugin
*
* @param string $extensionName The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
* @param string $pluginName must be a unique id for your plugin in UpperCamelCase (the string length of the extension key added to the length of the plugin name should be less than 32!)
* @param string $controllerName Name of the Controller
* @param string $newAction Name of the action
* @param bool $cachable Can this action be cached?
*
* @see \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin
*/
function configure_plugin_add_action($extensionName, $pluginName, $controllerName, $newAction, $cachable = true) {
$delimiterPosition = strrpos($extensionName, '.');
if ($delimiterPosition !== false) {
$extensionName = substr($extensionName, $delimiterPosition + 1);
}
$extensionName = str_replace(' ', '', ucwords(str_replace('_', ' ', $extensionName)));
$newAction = trim($newAction);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerName]['actions'][] = $newAction;
if (!$cachable) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerName]['nonCacheableActions'][] = $newAction;
}
}
}
次のように使用できます ( にもありますext_localconf.php
):
configure_plugin_add_action('In2code.powermail', 'Pi1', 'Form', 'debug', false);
これは Typo3 7-9 で動作するはずです ( configurePlugin
-Function は実際には変更されていないため)。