[TASK] Cleanup sys_action 53/17953/5
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 2 Feb 2013 16:22:18 +0000 (17:22 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 3 Feb 2013 16:46:04 +0000 (17:46 +0100)
Change-Id: I873239c054069de8b9231f8efa8df9f292fed559
Resolves: #45097
Releases: 6.1
Reviewed-on: https://review.typo3.org/17953
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/sys_action/Classes/ActionList.php
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/sys_action/Classes/ActionToolbarMenu.php
typo3/sysext/sys_action/ext_autoload.php
typo3/sysext/sys_action/ext_tables.php
typo3/sysext/sys_action/locallang.xlf
typo3/sysext/sys_action/locallang_csh_sysaction.xlf
typo3/sysext/sys_action/locallang_tca.xlf
typo3/sysext/sys_action/tca.php

index 47b9006..1c9a4b3 100644 (file)
@@ -26,6 +26,7 @@ namespace TYPO3\CMS\SysAction;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Class for the list rendering of Web>Task Center module
  *
@@ -36,18 +37,17 @@ class ActionList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList {
        /**
         * Creates the URL to this script, including all relevant GPvars
         * Fixed GPvars are id, table, imagemode, returnUrl, search_field, search_levels and showLimit
-        * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $exclList variable.
+        * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $excludeList variable.
         *
-        * @param string $altId Alternative id value. Enter blank string for the current id ($this->id)
+        * @param string $alternativeId Alternative id value. Enter blank string for the current id ($this->id)
         * @param string $table Table name to display. Enter "-1" for the current table.
-        * @param string $exclList Comma separated list of fields NOT to include ("sortField" or "sortRev")
+        * @param string $excludeList Comma separated list of fields NOT to include ("sortField" or "sortRev")
         * @return string
-        * @todo Define visibility
         */
-       public function listURL($altId = '', $table = -1, $exclList = '') {
+       public function listURL($alternativeId = '', $table = -1, $excludeList = '') {
                $urlParameters = array();
-               if (strcmp($altId, '')) {
-                       $urlParameters['id'] = $altId;
+               if (strcmp($alternativeId, '')) {
+                       $urlParameters['id'] = $alternativeId;
                } else {
                        $urlParameters['id'] = $this->id;
                }
@@ -74,10 +74,10 @@ class ActionList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList {
                if ($this->firstElementNumber) {
                        $urlParameters['pointer'] = $this->firstElementNumber;
                }
-               if ((!$exclList || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($exclList, 'sortField')) && $this->sortField) {
+               if ((!$excludeList || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($excludeList, 'sortField')) && $this->sortField) {
                        $urlParameters['sortField'] = $this->sortField;
                }
-               if ((!$exclList || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($exclList, 'sortRev')) && $this->sortRev) {
+               if ((!$excludeList || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($excludeList, 'sortRev')) && $this->sortRev) {
                        $urlParameters['sortRev'] = $this->sortRev;
                }
                if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET')) {
@@ -91,5 +91,4 @@ class ActionList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList {
 
 }
 
-
 ?>
\ No newline at end of file
index be4e9e4..887e39f 100644 (file)
@@ -24,6 +24,7 @@ namespace TYPO3\CMS\SysAction;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * This class provides a task for the taskcenter
  *
@@ -32,9 +33,13 @@ namespace TYPO3\CMS\SysAction;
  */
 class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface {
 
+       /**
+        * @var \TYPO3\CMS\Taskcenter\Controller\TaskModuleController
+        */
        protected $taskObject;
 
        /**
+        * @var \TYPO3\CMS\Backend\Form\FormEngine
         * @todo Define visibility
         */
        public $t3lib_TCEforms;
@@ -87,24 +92,29 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface {
                                $content .= $this->taskObject->description($record['title'], $record['description']);
                                // Output depends on the type
                                switch ($record['type']) {
-                               case 1:
-                                       $content .= $this->viewNewBackendUser($record);
-                                       break;
-                               case 2:
-                                       $content .= $this->viewSqlQuery($record);
-                                       break;
-                               case 3:
-                                       $content .= $this->viewRecordList($record);
-                                       break;
-                               case 4:
-                                       $content .= $this->viewEditRecord($record);
-                                       break;
-                               case 5:
-                                       $content .= $this->viewNewRecord($record);
-                                       break;
-                               default:
-                                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('action_noType', TRUE), $GLOBALS['LANG']->getLL('action_error'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
-                                       $content .= '<br />' . $flashMessage->render();
+                                       case 1:
+                                               $content .= $this->viewNewBackendUser($record);
+                                               break;
+                                       case 2:
+                                               $content .= $this->viewSqlQuery($record);
+                                               break;
+                                       case 3:
+                                               $content .= $this->viewRecordList($record);
+                                               break;
+                                       case 4:
+                                               $content .= $this->viewEditRecord($record);
+                                               break;
+                                       case 5:
+                                               $content .= $this->viewNewRecord($record);
+                                               break;
+                                       default:
+                                               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+                                                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
+                                                       $GLOBALS['LANG']->getLL('action_noType', TRUE),
+                                                       $GLOBALS['LANG']->getLL('action_error'),
+                                                       \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
+                                               );
+                                               $content .= '<br />' . $flashMessage->render();
                                }
                        }
                }
index 64e831f..ceef1f2 100644 (file)
@@ -1,6 +1,29 @@
 <?php
 namespace TYPO3\CMS\SysAction;
 
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Steffen Kamper <info@sk-typo3.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
 /**
  * Adds action links to the backend's toolbar
  *
@@ -18,7 +41,7 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
        /**
         * @var string
         */
-       protected $EXTKEY = 'sys_action';
+       protected $extensionKey = 'sys_action';
 
        /**
         * Constructor
@@ -28,7 +51,7 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
        }
 
        /**
-        * sets the backend reference
+        * Sets the backend reference
         *
         * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference Backend object reference
         * @return void
@@ -56,8 +79,7 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
                                $actionMenu[] = '<li><a href="' . htmlspecialchars($linkConf[1]) . '" target="content">' . $linkConf[2] . htmlspecialchars($linkConf[0]) . '</a></li>';
                        }
                        $actionMenu[] = '</ul>';
-                       return implode('
-', $actionMenu);
+                       return implode(LF, $actionMenu);
                } else {
                        return '';
                }
@@ -79,14 +101,23 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
                        if ($GLOBALS['BE_USER']->groupList) {
                                $groupList = $GLOBALS['BE_USER']->groupList;
                        }
-                       $queryResource = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('sys_action.*', 'sys_action', 'sys_action_asgr_mm', 'be_groups', ' AND be_groups.uid IN (' . $groupList . ') AND sys_action.pid = 0 AND sys_action.hidden = 0', 'sys_action.uid', 'sys_action.sorting');
+                       $queryResource = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
+                               'sys_action.*',
+                               'sys_action',
+                               'sys_action_asgr_mm',
+                               'be_groups',
+                               ' AND be_groups.uid IN (' . $groupList . ') AND sys_action.pid = 0 AND sys_action.hidden = 0',
+                               'sys_action.uid',
+                               'sys_action.sorting'
+                       );
                }
+
                if ($queryResource) {
                        while ($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($queryResource)) {
                                $actions[] = array(
                                        $actionRow['title'],
                                        'mod.php?M=user_task&SET[mode]=tasks&SET[function]=sys_action.TYPO3\\CMS\\SysAction\\ActionTask&show=' . $actionRow['uid'],
-                                       \t3lib_iconworks::getSpriteIconForRecord('sys_action', $actionRow)
+                                       \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_action', $actionRow)
                                );
                        }
                        $GLOBALS['TYPO3_DB']->sql_free_result($queryResource);
@@ -109,7 +140,9 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
         * @return void
         */
        protected function addJavascriptToBackend() {
-               $this->backendReference->addJavascriptFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->EXTKEY) . 'toolbarmenu/tx_sysactions.js');
+               $this->backendReference->addJavascriptFile(
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extensionKey) . 'toolbarmenu/tx_sysactions.js'
+               );
        }
 
        /**
@@ -118,7 +151,10 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
         * @return void
         */
        protected function addCssToBackend() {
-               $this->backendReference->addCssFile('sysaction', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->EXTKEY) . 'toolbarmenu/tx_sysactions.css');
+               $this->backendReference->addCssFile(
+                       'sysaction',
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extensionKey) . 'toolbarmenu/tx_sysactions.css'
+               );
        }
 
        /**
@@ -133,5 +169,4 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
 
 }
 
-
 ?>
\ No newline at end of file
index 78a08dc..60d142c 100644 (file)
@@ -1,8 +1,5 @@
 <?php
-/*
- * Register necessary class names with autoloader
- *
- */
+// Register necessary class names with autoloader
 $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('sys_action');
 return array(
        'tx_sysaction_list' => $extensionPath . 'task/class.tx_sysaction_list.php',
index f3b58c3..db8ca52 100755 (executable)
@@ -2,15 +2,15 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-if (TYPO3_MODE == 'BE') {
-       $TCA['sys_action'] = array(
+if (TYPO3_MODE === 'BE') {
+       $GLOBALS['TCA']['sys_action'] = array(
                'ctrl' => array(
                        'label' => 'title',
                        'tstamp' => 'tstamp',
                        'default_sortby' => 'ORDER BY title',
                        'sortby' => 'sorting',
                        'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
-                       'title' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action',
+                       'title' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action',
                        'crdate' => 'crdate',
                        'cruser_id' => 'cruser_id',
                        'adminOnly' => 1,
@@ -28,10 +28,10 @@ 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.xml');
+       \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.xml:sys_action',
-               'description' => 'LLL:EXT:sys_action/locallang_csh_sysaction.xml:.description',
+               'title' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action',
+               'description' => 'LLL:EXT:sys_action/locallang_csh_sysaction.xlf:.description',
                'icon' => 'EXT:sys_action/x-sys_action.png'
        );
 }
index a1e9a39..3cc82c9 100644 (file)
                        </trans-unit>
                </body>
        </file>
-</xliff>
+</xliff>
\ No newline at end of file
index 35d900a..937587f 100644 (file)
@@ -64,4 +64,4 @@ If the template user is a member of a group which is not defined among the "Grou
                        </trans-unit>
                </body>
        </file>
-</xliff>
+</xliff>
\ No newline at end of file
index a49758c..0c1e5c0 100644 (file)
@@ -53,4 +53,4 @@
                        </trans-unit>
                </body>
        </file>
-</xliff>
+</xliff>
\ No newline at end of file
index f4c503f..ca89141 100755 (executable)
@@ -1,7 +1,10 @@
 <?php
-// sys_action
-$TCA['sys_action'] = array(
-       'ctrl' => $TCA['sys_action']['ctrl'],
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
+
+$GLOBALS['TCA']['sys_action'] = array(
+       'ctrl' => $GLOBALS['TCA']['sys_action']['ctrl'],
        'interface' => array(
                'showRecordFieldList' => 'hidden,title,type,description,assign_to_groups'
        ),
@@ -24,7 +27,7 @@ $TCA['sys_action'] = array(
                        )
                ),
                'hidden' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.hidden',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.hidden',
                        'config' => array(
                                'type' => 'check'
                        )
@@ -35,16 +38,16 @@ $TCA['sys_action'] = array(
                                'type' => 'select',
                                'items' => array(
                                        array('', '0'),
-                                       array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.1', '1'),
-                                       array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.2', '2'),
-                                       array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.3', '3'),
-                                       array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.4', '4'),
-                                       array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.5', '5')
+                                       array('LLL:EXT:sys_action/locallang_tca.xlf:sys_action.type.1', '1'),
+                                       array('LLL:EXT:sys_action/locallang_tca.xlf:sys_action.type.2', '2'),
+                                       array('LLL:EXT:sys_action/locallang_tca.xlf:sys_action.type.3', '3'),
+                                       array('LLL:EXT:sys_action/locallang_tca.xlf:sys_action.type.4', '4'),
+                                       array('LLL:EXT:sys_action/locallang_tca.xlf:sys_action.type.5', '5')
                                )
                        )
                ),
                'assign_to_groups' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.assign_to_groups',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.assign_to_groups',
                        'config' => array(
                                'type' => 'select',
                                'foreign_table' => 'be_groups',
@@ -57,7 +60,7 @@ $TCA['sys_action'] = array(
                        )
                ),
                't1_userprefix' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_userprefix',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t1_userprefix',
                        'config' => array(
                                'type' => 'input',
                                'size' => '25',
@@ -66,7 +69,7 @@ $TCA['sys_action'] = array(
                        )
                ),
                't1_allowed_groups' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_allowed_groups',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t1_allowed_groups',
                        'config' => array(
                                'type' => 'select',
                                'foreign_table' => 'be_groups',
@@ -77,13 +80,13 @@ $TCA['sys_action'] = array(
                        )
                ),
                't1_create_user_dir' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_create_user_dir',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t1_create_user_dir',
                        'config' => array(
                                'type' => 'check'
                        )
                ),
                't1_copy_of_user' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_copy_of_user',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t1_copy_of_user',
                        'config' => array(
                                'type' => 'group',
                                'internal_type' => 'db',
@@ -100,7 +103,7 @@ $TCA['sys_action'] = array(
                        )
                ),
                't3_listPid' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t3_listPid',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t3_listPid',
                        'config' => array(
                                'type' => 'group',
                                'internal_type' => 'db',
@@ -117,7 +120,7 @@ $TCA['sys_action'] = array(
                        )
                ),
                't3_tables' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t3_tables',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t3_tables',
                        'config' => array(
                                'type' => 'select',
                                'special' => 'tables',
@@ -127,7 +130,7 @@ $TCA['sys_action'] = array(
                        )
                ),
                't4_recordsToEdit' => array(
-                       'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t4_recordsToEdit',
+                       'label' => 'LLL:EXT:sys_action/locallang_tca.xlf:sys_action.t4_recordsToEdit',
                        'config' => array(
                                'type' => 'group',
                                'internal_type' => 'db',