[TASK] Move user simulation in module "user settings" 46/32646/8
authorFelix Kopp <felix-source@phorax.com>
Mon, 15 Sep 2014 22:33:13 +0000 (00:33 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 17 Sep 2014 06:54:31 +0000 (08:54 +0200)
Move the user select settings a dominant setting that is positioned
above the select field tab selection.

Resolves: #61447
Releases: master
Change-Id: Icdf8dd82c7174e5fa3c4d7a8f190d066cf37a4bd
Reviewed-on: http://review.typo3.org/32646
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/setup/ext_tables.php

index b0e9bba..d49488c 100644 (file)
@@ -105,6 +105,16 @@ class SetupModuleController {
         */
        protected $formProtection;
 
+       /**
+        * @var string
+        */
+       protected $simulateSelector = '';
+
+       /**
+        * @var string
+        */
+       protected $simUser = '';
+
        /******************************
         *
         * Saving data
@@ -364,8 +374,13 @@ class SetupModuleController {
                        }
                        $this->content .= $flashMessage->render();
                }
+
+               // Render user switch
+               $this->content .= $this->renderSimulateUserSelectAndLabel();
+
                // Render the menu items
                $menuItems = $this->renderUserSetup();
+
                $this->content .= $this->doc->getDynTabMenu($menuItems, 'user-setup', FALSE, FALSE, 1, FALSE, 1, $this->dividers2tabs);
                $formToken = $this->formProtection->generateToken('BE user setup', 'edit');
                $this->content .= $this->doc->section('', '<input type="hidden" name="simUser" value="' . $this->simUser . '" />
@@ -419,6 +434,7 @@ class SetupModuleController {
         * Render module
         *
         ******************************/
+
        /**
         * renders the data for all tabs in the user setup and returns
         * everything that is needed with tabs and dyntab menu
@@ -671,12 +687,21 @@ class SetupModuleController {
        }
 
        /**
-        * Returns a select with simulate users
+        * Render simulate user select and label
         *
-        * @return string Complete select as HTML string
+        * @return string
         */
-       public function renderSimulateUserSelect($params, $pObj) {
-               return $pObj->simulateSelector;
+       protected function renderSimulateUserSelectAndLabel() {
+               if ($this->simulateSelector === '') {
+                       return '';
+               }
+
+               return '<p>' .
+                       '<label for="field_simulate" style="margin-right: 20px;">' .
+                       $GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xlf:simulate') .
+                       '</label>' .
+                       $this->simulateSelector .
+                       '</p>';
        }
 
        /**
index 6f95e53..64afbd7 100644 (file)
@@ -94,12 +94,6 @@ if (TYPO3_MODE === 'BE') {
                                'label' => 'LLL:EXT:setup/mod/locallang.xlf:recursiveDelete',
                                'csh' => 'recursiveDelete'
                        ),
-                       'simulate' => array(
-                               'type' => 'select',
-                               'itemsProcFunc' => 'TYPO3\\CMS\\Setup\\Controller\\SetupModuleController->renderSimulateUserSelect',
-                               'label' => 'LLL:EXT:setup/mod/locallang.xlf:simulate',
-                               'csh' => 'simuser'
-                       ),
                        'resetConfiguration' => array(
                                'type' => 'button',
                                'label' => 'LLL:EXT:setup/mod/locallang.xlf:resetConfiguration',
@@ -145,6 +139,6 @@ if (TYPO3_MODE === 'BE') {
                'showitem' => '--div--;LLL:EXT:setup/mod/locallang.xlf:personal_data,realName,email,emailMeAtLogin,password,password2,lang,
                                --div--;LLL:EXT:setup/mod/locallang.xlf:opening,startModule,thumbnailsByDefault,titleLen,
                                --div--;LLL:EXT:setup/mod/locallang.xlf:editFunctionsTab,edit_RTE,edit_docModuleUpload,showHiddenFilesAndFolders,resizeTextareas,resizeTextareas_Flexible,resizeTextareas_MaxHeight,copyLevels,recursiveDelete,resetConfiguration,clearSessionVars,
-                               --div--;LLL:EXT:setup/mod/locallang.xlf:adminFunctions,simulate,debugInWindow'
+                               --div--;LLL:EXT:setup/mod/locallang.xlf:adminFunctions,debugInWindow'
        );
 }
\ No newline at end of file