[CLEANUP] Cleanup backend toolbar item registration 95/33895/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 7 Nov 2014 19:37:49 +0000 (20:37 +0100)
committerBenjamin Mack <benni@typo3.org>
Sat, 8 Nov 2014 15:41:41 +0000 (16:41 +0100)
* Remove side effects from class file
* Move registration script to Resources/PHP folder

Resolves: #62775
Related: #61467
Releases: master
Change-Id: I3a924825534e7b02e30c95b635375e2158f33a02
Reviewed-on: http://review.typo3.org/33895
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/sys_action/Resources/PHP/RegisterToolbarItem.php [new file with mode: 0644]
typo3/sysext/sys_action/ext_localconf.php [new file with mode: 0644]
typo3/sysext/sys_action/ext_tables.php
typo3/sysext/sys_action/toolbarmenu/registerToolbarItem.php [deleted file]

diff --git a/typo3/sysext/sys_action/Resources/PHP/RegisterToolbarItem.php b/typo3/sysext/sys_action/Resources/PHP/RegisterToolbarItem.php
new file mode 100644 (file)
index 0000000..9b8a30c
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+$GLOBALS['TYPO3backend']->addToolbarItem('sys_action', 'TYPO3\\CMS\\SysAction\\ActionToolbarMenu');
\ No newline at end of file
diff --git a/typo3/sysext/sys_action/ext_localconf.php b/typo3/sysext/sys_action/ext_localconf.php
new file mode 100644 (file)
index 0000000..dce51f3
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+if (TYPO3_MODE === 'BE') {
+       $GLOBALS['TYPO3_CONF_VARS']['typo3/backend.php']['additionalBackendItems'][] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('sys_action') . 'Resources/PHP/RegisterToolbarItem.php';
+}
\ No newline at end of file
index 6a11199..fa13ef8 100644 (file)
@@ -2,7 +2,6 @@
 defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'BE') {
-       $GLOBALS['TYPO3_CONF_VARS']['typo3/backend.php']['additionalBackendItems'][] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('sys_action') . 'toolbarmenu/registerToolbarItem.php';
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('sys_action', 'EXT:sys_action/locallang_csh_sysaction.xlf');
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['sys_action']['tx_sysaction_task'] = array(
                'title' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action',
diff --git a/typo3/sysext/sys_action/toolbarmenu/registerToolbarItem.php b/typo3/sysext/sys_action/toolbarmenu/registerToolbarItem.php
deleted file mode 100644 (file)
index 69c2073..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-if (TYPO3_MODE === 'BE') {
-       // Now register the class as toolbar item
-       $GLOBALS['TYPO3backend']->addToolbarItem('sys_action', 'TYPO3\\CMS\\SysAction\\ActionToolbarMenu');
-}