[BUGFIX] Tasks Center section menu is hardcoded 47/34947/9
authorPhilipp Gampe <philipp.gampe@typo3.org>
Tue, 2 Dec 2014 18:43:31 +0000 (19:43 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Sun, 21 Jun 2015 21:51:54 +0000 (23:51 +0200)
Since the refactoring of the tasks center in 4.5, the section menu is
hardcoded to information and tasks and cannot be changed.

This is because the menu items are collected inside the array key 'mode'
instead of 'function'.
Because 'function' is hardcoded in the logic of BaseScriptClass, copy
the four lines from BaseScriptClass instead of calling
parent:menu_config() in the TaskModuleController.

Additionally, 'Tasks' is hardcoded as a label. Replace it with a
localized value.

Note: 'function' is preserved for backward compatibility and is already
in use for the main tasks logic.

Use page.mod.user_task.menu.mode.information = 0 to blind an individual
item, e.g. information.

Some further code cleanups are included.

Resolves: #63529
Releases: master
Change-Id: Ic2666dde7e794689011d8bac4996cda4216988c8
Reviewed-on: http://review.typo3.org/34947
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
typo3/sysext/taskcenter/locallang.xlf

index 7040b26..23712f0 100644 (file)
@@ -66,7 +66,15 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
        public function menuConfig() {
                $this->MOD_MENU = array('mode' => array());
                $this->MOD_MENU['mode']['information'] = $this->getLanguageService()->sL('LLL:EXT:taskcenter/locallang.xlf:task_overview');
-               $this->MOD_MENU['mode']['tasks'] = 'Tasks';
+               $this->MOD_MENU['mode']['tasks'] =  $this->getLanguageService()->sL('LLL:EXT:taskcenter/locallang.xlf:task_tasks');
+               /* Copied from parent::menuConfig, because parent is hardcoded to menu.function,
+                * however menu.function is already used for the individual tasks.
+                * Therefore we use menu.mode here.
+                */
+               // Page/be_user TSconfig settings and blinding of menu-items
+               $this->modTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.' . $this->moduleName);
+               $this->MOD_MENU['mode'] = $this->mergeExternalItems($this->MCONF['name'], 'mode', $this->MOD_MENU['mode']);
+               $this->MOD_MENU['mode'] = BackendUtility::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['mode'], 'menu.mode');
                parent::menuConfig();
        }
 
index 2e34624..c758682 100644 (file)
@@ -15,6 +15,9 @@
                        <trans-unit id="task_overview">
                                <source>Overview</source>
                        </trans-unit>
+                       <trans-unit id="task_tasks">
+                               <source>Tasks</source>
+                       </trans-unit>
                        <trans-unit id="lReplyAddress">
                                <source>Reply address is your email</source>
                        </trans-unit>