TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Utility\ExtensionUtility Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Utility\ExtensionUtility:
Tx_Extbase_Utility_Extension

Static Public Member Functions

static configurePlugin ($extensionName, $pluginName, array $controllerActions, array $nonCacheableControllerActions=array(), $pluginType=self::PLUGIN_TYPE_PLUGIN)
 
static registerPlugin ($extensionName, $pluginName, $pluginTitle, $pluginIconPathAndFilename=NULL)
 
static configureModule ($moduleSignature, $modulePath)
 
static registerModule ($extensionName, $mainModuleName='', $subModuleName='', $position='', array $controllerActions=array(), array $moduleConfiguration=array())
 
static registerTypeConverter ($typeConverterClassName)
 

Public Attributes

const PLUGIN_TYPE_PLUGIN = 'list_type'
 
const PLUGIN_TYPE_CONTENT_ELEMENT = 'CType'
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Utilities to manage plugins and modules of an extension. Also useful to auto-generate the autoloader registry file ext_autoload.php.

Definition at line 20 of file ExtensionUtility.php.

Member Function Documentation

◆ configureModule()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::configureModule (   $moduleSignature,
  $modulePath 
)
static

This method is called from ::checkMod and it replaces old conf.php.

Parameters
string$moduleSignatureThe module name
string$modulePathAbsolute path to module (not used by Extbase currently)
Returns
array Configuration of the module

Definition at line 152 of file ExtensionUtility.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath().

◆ configurePlugin()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin (   $extensionName,
  $pluginName,
array  $controllerActions,
array  $nonCacheableControllerActions = array(),
  $pluginType = self::PLUGIN_TYPE_PLUGIN 
)
static

Add auto-generated TypoScript to configure the Extbase Dispatcher.

When adding a frontend plugin you will have to add both an entry to the TCA definition of tt_content table AND to the TypoScript template which must initiate the rendering. Including the plugin code after "defaultContentRendering" adds the necessary TypoScript for calling the appropriate controller and action of your plugin. This means, it will also work for the extension "css_styled_content" FOR USE IN ext_localconf.php FILES Usage: 2

Parameters
string$extensionNameThe extension name (in UpperCamelCase) or the extension key (in lower_underscore)
string$pluginNamemust 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!)
array$controllerActionsis an array of allowed combinations of controller and action stored in an array (controller name as key and a comma separated list of action names as value, the first controller and its first action is chosen as default)
array$nonCacheableControllerActionsis an optional array of controller name and action names which should not be cached (array as defined in $controllerActions)
string$pluginTypeeither ::PLUGIN_TYPE_PLUGIN (default) or ::PLUGIN_TYPE_CONTENT_ELEMENT
Exceptions

Definition at line 44 of file ExtensionUtility.php.

References $GLOBALS, $pluginContent, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addTypoScript(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginCreatesCorrectDefaultTypoScriptSetup(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginRespectsDefaultActionAsANonCacheableAction(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginRespectsNonDefaultActionAsANonCacheableAction(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginThrowsExceptionIfExtensionNameIsEmpty(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginThrowsExceptionIfPluginNameIsEmpty(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForASingleControllerAction(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMinimalisticSetup(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMultipleControllerActionsWithCacheableActionAsDefault(), and TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMultipleControllerActionsWithNonCacheableActionAsDefault().

◆ registerModule()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule (   $extensionName,
  $mainModuleName = '',
  $subModuleName = '',
  $position = '',
array  $controllerActions = array(),
array  $moduleConfiguration = array() 
)
static

Registers an Extbase module (main or sub) to the backend interface. FOR USE IN ext_tables.php FILES

Parameters
string$extensionNameThe extension name (in UpperCamelCase) or the extension key (in lower_underscore)
string$mainModuleNameThe main module key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there. If $subModuleName is not set a blank $extensionName module is created
string$subModuleNameThe submodule key.
string$positionThis can be used to set the position of the $sub module within the list of existing submodules for the main module. $position has this syntax: [cmd]:[submodule-key]. cmd can be "after", "before" or "top" (or blank which is default). If "after"/"before" then submodule will be inserted after/before the existing submodule with [submodule-key] if found. If not found, the bottom of list. If "top" the module is inserted in the top of the submodule list.
array$controllerActionsis an array of allowed combinations of controller and action stored in an array (controller name as key and a comma separated list of action names as value, the first controller and its first action is chosen as default)
array$moduleConfigurationThe configuration options of the module (icon, locallang.xlf file)
Exceptions

Definition at line 189 of file ExtensionUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addModule(), TYPO3\CMS\Core\Utility\GeneralUtility\camelCaseToLowerCaseUnderscored(), TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule(), and TYPO3\CMS\Core\Utility\GeneralUtility\underscoredToUpperCamelCase().

◆ registerPlugin()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin (   $extensionName,
  $pluginName,
  $pluginTitle,
  $pluginIconPathAndFilename = NULL 
)
static

Register an Extbase PlugIn into backend's list of plugins FOR USE IN ext_tables.php FILES

Parameters
string$extensionNameThe extension name (in UpperCamelCase) or the extension key (in lower_underscore)
string$pluginNamemust 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!)
string$pluginTitleis a speaking title of the plugin that will be displayed in the drop down menu in the backend
string$pluginIconPathAndFilenameis a path to an icon file (relative to TYPO3_mainDir), that will be displayed in the drop down menu in the backend (optional)
Exceptions

Definition at line 114 of file ExtensionUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addPlugin(), and TYPO3\CMS\Core\Utility\GeneralUtility\camelCaseToLowerCaseUnderscored().

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginTriggersAddPluginWhichSetsPluginIconPathIfIconPathIsGiven(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUnderscoredExtensionNameAndIconPathNotGiven(), and TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUpperCameCasedExtensionNameAndIconPathNotGiven().

◆ registerTypeConverter()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter (   $typeConverterClassName)
static

Register a type converter by class name.

Parameters
string$typeConverterClassName
Returns
void

Definition at line 248 of file ExtensionUtility.php.

References $GLOBALS.

Member Data Documentation

◆ PLUGIN_TYPE_CONTENT_ELEMENT

const TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT = 'CType'

Definition at line 23 of file ExtensionUtility.php.

◆ PLUGIN_TYPE_PLUGIN

const TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN = 'list_type'

Definition at line 22 of file ExtensionUtility.php.