44 static public function configurePlugin($extensionName, $pluginName, array $controllerActions, array $nonCacheableControllerActions = array(), $pluginType = self::PLUGIN_TYPE_PLUGIN) {
45 if (empty($pluginName)) {
46 throw new \InvalidArgumentException(
'The plugin name must not be empty', 1239891987);
48 if (empty($extensionName)) {
49 throw new \InvalidArgumentException(
'The extension name was invalid (must not be empty and must match /[A-Za-z][_A-Za-z0-9]/)', 1239891989);
53 $delimiterPosition = strrpos($extensionName,
'.');
54 if ($delimiterPosition !== FALSE) {
55 $vendorName = str_replace(
'.',
'\\', substr($extensionName, 0, $delimiterPosition));
56 $extensionName = substr($extensionName, $delimiterPosition + 1);
58 $extensionName = str_replace(
' ',
'', ucwords(str_replace(
'_',
' ', $extensionName)));
60 $pluginSignature = strtolower($extensionName .
'_' . $pluginName);
61 if (!is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName])) {
62 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName] = array();
64 foreach ($controllerActions as $controllerName => $actionsList) {
65 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'controllers'][$controllerName] = array(
'actions' => \
TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(
',', $actionsList));
66 if (!empty($nonCacheableControllerActions[$controllerName])) {
71 switch ($pluginType) {
72 case self::PLUGIN_TYPE_PLUGIN:
74 tt_content.list.20.' . $pluginSignature .
' = USER 75 tt_content.list.20.' . $pluginSignature .
' { 76 userFunc = TYPO3\\CMS\\Extbase\\Core\\Bootstrap->run 77 extensionName = ' . $extensionName .
' 78 pluginName = ' . $pluginName . (NULL !== $vendorName ? (
"\n\t" .
'vendorName = ' . $vendorName) :
'') .
' 81 case self::PLUGIN_TYPE_CONTENT_ELEMENT:
83 tt_content.' . $pluginSignature .
' = COA 84 tt_content.' . $pluginSignature .
' { 88 userFunc = TYPO3\\CMS\\Extbase\\Core\\Bootstrap->run 89 extensionName = ' . $extensionName .
' 90 pluginName = ' . $pluginName . (NULL !== $vendorName ? (
"\n\t\t" .
'vendorName = ' . $vendorName) :
'') .
' 95 throw new \InvalidArgumentException(
'The pluginType "' . $pluginType .
'" is not suported', 1289858856);
97 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'pluginType'] = $pluginType;
99 # Setting ' . $extensionName .
' plugin TypoScript 114 static public function registerPlugin($extensionName, $pluginName, $pluginTitle, $pluginIconPathAndFilename = NULL) {
115 if (empty($pluginName)) {
116 throw new \InvalidArgumentException(
'The plugin name must not be empty', 1239891988);
118 if (empty($extensionName)) {
119 throw new \InvalidArgumentException(
'The extension name was invalid (must not be empty and must match /[A-Za-z][_A-Za-z0-9]/)', 1239891991);
121 $delimiterPosition = strrpos($extensionName,
'.');
122 if ($delimiterPosition !== FALSE) {
123 $extensionName = substr($extensionName, $delimiterPosition + 1);
125 $extensionName = str_replace(
' ',
'', ucwords(str_replace(
'_',
' ', $extensionName)));
126 $pluginSignature = strtolower($extensionName) .
'_' . strtolower($pluginName);
133 $pluginType = isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'pluginType'])
134 ?
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'pluginType']
138 array($pluginTitle, $pluginSignature, $pluginIconPathAndFilename),
153 $moduleConfiguration =
$GLOBALS[
'TBE_MODULES'][
'_configuration'][$moduleSignature];
154 $iconPathAndFilename = $moduleConfiguration[
'icon'];
155 if (substr($iconPathAndFilename, 0, 4) ===
'EXT:') {
156 list($extensionKey, $relativePath) = explode(
'/', substr($iconPathAndFilename, 4), 2);
160 $moduleLabels = array(
161 'tabs_images' => array(
162 'tab' => $iconPathAndFilename
165 'tablabel' =>
$GLOBALS[
'LANG']->sL($moduleConfiguration[
'labels'] .
':mlang_labels_tablabel'),
166 'tabdescr' =>
$GLOBALS[
'LANG']->sL($moduleConfiguration[
'labels'] .
':mlang_labels_tabdescr')
169 'tab' =>
$GLOBALS[
'LANG']->sL($moduleConfiguration[
'labels'] .
':mlang_tabs_tab')
172 $GLOBALS[
'LANG']->addModuleLabels($moduleLabels, $moduleSignature .
'_');
173 return $moduleConfiguration;
189 static public function registerModule($extensionName, $mainModuleName =
'', $subModuleName =
'', $position =
'', array $controllerActions = array(), array $moduleConfiguration = array()) {
190 if (empty($extensionName)) {
191 throw new \InvalidArgumentException(
'The extension name must not be empty', 1239891990);
195 if (FALSE !== $delimiterPosition = strrpos($extensionName,
'.')) {
196 $vendorName = str_replace(
'.',
'\\', substr($extensionName, 0, $delimiterPosition));
197 $extensionName = substr($extensionName, $delimiterPosition + 1);
200 $extensionName = str_replace(
' ',
'', ucwords(str_replace(
'_',
' ', $extensionName)));
201 $defaultModuleConfiguration = array(
203 'icon' =>
'EXT:extbase/ext_icon.gif',
205 'extRelPath' => \
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($extensionKey) .
'Classes/' 207 if (strlen($mainModuleName) > 0 && !array_key_exists($mainModuleName,
$GLOBALS[
'TBE_MODULES'])) {
210 $mainModuleName = strlen($mainModuleName) > 0 ? $mainModuleName :
'web';
213 if ($mainModuleName ===
'web') {
214 $defaultModuleConfiguration[
'navigationComponentId'] =
'typo3-pagetree';
217 $moduleConfiguration = $defaultModuleConfiguration;
218 $moduleSignature = $mainModuleName;
219 if (strlen($subModuleName) > 0) {
221 $moduleSignature .=
'_' . $subModuleName;
223 $moduleConfiguration[
'name'] = $moduleSignature;
224 if (NULL !== $vendorName) {
225 $moduleConfiguration[
'vendorName'] = $vendorName;
227 $moduleConfiguration[
'extensionName'] = $extensionName;
228 $moduleConfiguration[
'configureModuleFunction'] = array(
'TYPO3\\CMS\\Extbase\\Utility\\ExtensionUtility',
'configureModule');
229 $GLOBALS[
'TBE_MODULES'][
'_configuration'][$moduleSignature] = $moduleConfiguration;
230 if (!is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'modules'][$moduleSignature])) {
231 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'modules'][$moduleSignature] = array();
233 foreach ($controllerActions as $controllerName => $actions) {
234 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'modules'][$moduleSignature][
'controllers'][$controllerName] = array(
235 'actions' => \
TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(
',', $actions)
249 if (!is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'typeConverters'])) {
250 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'typeConverters'] = array();
252 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'typeConverters'][] = $typeConverterClassName;
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
const PLUGIN_TYPE_CONTENT_ELEMENT
static extPath($key, $script='')
if(!defined('TYPO3_MODE')) $pluginContent
static addTypoScript($key, $type, $content, $afterStaticUid=0)
static registerPlugin($extensionName, $pluginName, $pluginTitle, $pluginIconPathAndFilename=NULL)
static registerTypeConverter($typeConverterClassName)
static camelCaseToLowerCaseUnderscored($string)
static addPlugin($itemArray, $type='list_type', $extensionKey=NULL)
static configureModule($moduleSignature, $modulePath)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static registerModule($extensionName, $mainModuleName='', $subModuleName='', $position='', array $controllerActions=array(), array $moduleConfiguration=array())
static underscoredToUpperCamelCase($string)
static addModule($main, $sub='', $position='', $path='', $moduleConfiguration=array())
static configurePlugin($extensionName, $pluginName, array $controllerActions, array $nonCacheableControllerActions=array(), $pluginType=self::PLUGIN_TYPE_PLUGIN)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]