[!!!][TASK] Move usage of BackendUserSettingsDataProvider 11/39311/5
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 6 May 2015 17:44:16 +0000 (19:44 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Sat, 9 May 2015 15:07:56 +0000 (17:07 +0200)
Move usage of BackendUserSettingsDataProvider to the new Storage.js

Resolves: #66868
Releases: master
Change-Id: Ibc6d57368ca8ebc8b4e5e026cbaaa5d80d428d1c
Reviewed-on: http://review.typo3.org/39311
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
13 files changed:
typo3/sysext/backend/Classes/Controller/UserSettingsController.php
typo3/sysext/backend/Classes/Form/Element/TreeElement.php
typo3/sysext/backend/Classes/InterfaceState/ExtDirect/DataProvider.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeCommands.php
typo3/sysext/backend/Classes/User/ExtDirect/BackendUserSettingsDataProvider.php [deleted file]
typo3/sysext/backend/Resources/Public/JavaScript/Storage.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/app.js
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-66868-MoveUsageOfBackendUserSettingsDataProvider.rst [new file with mode: 0644]
typo3/sysext/t3editor/res/jslib/t3editor.js

index b911322..6438e94 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -32,22 +33,42 @@ class UserSettingsController {
        public function processAjaxRequest($parameters, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler) {
                // do the regular / main logic, depending on the action parameter
                $action = GeneralUtility::_GP('action');
+               $key = GeneralUtility::_GP('key');
+               $value = GeneralUtility::_GP('value');
+
+               $content = $this->process($action, $key, $value);
+
+               $ajaxRequestHandler->setContentFormat('json');
+               $ajaxRequestHandler->setContent($content);
+       }
+
+       /**
+        * Process data
+        *
+        * @param string $action
+        * @param string $key
+        * @param string $value
+        * @return mixed
+        */
+       public function process($action, $key = '', $value = '') {
                switch ($action) {
                        case 'get':
-                               $key = GeneralUtility::_GP('key');
                                $content = $this->get($key);
                                break;
                        case 'getAll':
                                $content = $this->getAll();
                                break;
                        case 'set':
-                               $key = GeneralUtility::_GP('key');
-                               $value = GeneralUtility::_GP('value');
                                $this->set($key, $value);
                                $content = $this->getAll();
                                break;
+                       case 'addToList':
+                               $this->addToList($key, $value);
+                               $content = $this->getAll();
+                       case 'removeFromList':
+                               $this->removeFromList($key, $value);
+                               $content = $this->getAll();
                        case 'unset':
-                               $key = GeneralUtility::_GP('key');
                                $this->unsetOption($key);
                                $content = $this->getAll();
                                break;
@@ -59,8 +80,7 @@ class UserSettingsController {
                                $content = array('result' => FALSE);
                }
 
-               $ajaxRequestHandler->setContentFormat('json');
-               $ajaxRequestHandler->setContent($content);
+               return $content;
        }
 
        /**
@@ -70,7 +90,7 @@ class UserSettingsController {
         * @return mixed Value associated
         */
        protected function get($key) {
-               return (strpos($key, '.') !== FALSE) ? $this->getFromDottedNotation($key) : $GLOBALS['BE_USER']->uc[$key];
+               return (strpos($key, '.') !== FALSE) ? $this->getFromDottedNotation($key) : $this->getBackendUser()->uc[$key];
        }
 
        /**
@@ -79,7 +99,7 @@ class UserSettingsController {
         * @return mixed all values, usually a multi-dimensional array
         */
        protected function getAll() {
-               return $GLOBALS['BE_USER']->uc;
+               return $this->getBackendUser()->uc;
        }
 
        /**
@@ -90,12 +110,50 @@ class UserSettingsController {
         * @return void
         */
        protected function set($key, $value) {
+               $beUser = $this->getBackendUser();
                if (strpos($key, '.') !== FALSE) {
                        $this->setFromDottedNotation($key, $value);
                } else {
-                       $GLOBALS['BE_USER']->uc[$key] = $value;
+                       $beUser->uc[$key] = $value;
+               }
+               $beUser->writeUC($beUser->uc);
+       }
+
+       /**
+        * Adds an value to an Comma-separated list
+        * stored $key  of user settings
+        *
+        * @param string $key
+        * @param mixed $value
+        * @return void
+        */
+       protected function addToList($key, $value) {
+               $list = $this->get($key);
+               if (!isset($list)) {
+                       $list = $value;
+               } else {
+                       if (!GeneralUtility::inList($list, $value)) {
+                               $list .= ',' . $value;
+                       }
+               }
+               $this->set($key, $list);
+       }
+
+       /**
+        * Removes an value from an Comma-separated list
+        * stored $key of user settings
+        *
+        * @param string $key
+        * @param mixed $value
+        * @return void
+        */
+       protected function removeFromList($key, $value) {
+               $list = $this->get($key);
+               if (GeneralUtility::inList($list, $value)) {
+                       $list = GeneralUtility::trimExplode(',', $list, TRUE);
+                       $list = ArrayUtility::removeArrayEntryByValue($list, $value);
+                       $this->set($key, implode(',', $list));
                }
-               $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
        }
 
        /**
@@ -104,7 +162,7 @@ class UserSettingsController {
         * @return void
         */
        protected function clear() {
-               $GLOBALS['BE_USER']->resetUC();
+               $this->getBackendUser()->resetUC();
        }
 
        /**
@@ -114,9 +172,10 @@ class UserSettingsController {
         * @return void
         */
        protected function unsetOption($key) {
-               if (isset($GLOBALS['BE_USER']->uc[$key])) {
-                       unset($GLOBALS['BE_USER']->uc[$key]);
-                       $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
+               $beUser = $this->getBackendUser();
+               if (isset($beUser->uc[$key])) {
+                       unset($beUser->uc[$key]);
+                       $beUser->writeUC($beUser->uc);
                }
        }
 
@@ -128,7 +187,7 @@ class UserSettingsController {
         */
        protected function getFromDottedNotation($key) {
                $subkeys = GeneralUtility::trimExplode('.', $key);
-               $array = &$GLOBALS['BE_USER']->uc;
+               $array = &$this->getBackendUser()->uc;
                foreach ($subkeys as $subkey) {
                        $array = &$array[$subkey];
                }
@@ -145,7 +204,7 @@ class UserSettingsController {
        protected function setFromDottedNotation($key, $value) {
                $subkeys = GeneralUtility::trimExplode('.', $key, TRUE);
                $lastKey = $subkeys[count($subkeys) - 1];
-               $array = &$GLOBALS['BE_USER']->uc;
+               $array = &$this->getBackendUser()->uc;
                foreach ($subkeys as $subkey) {
                        if ($subkey === $lastKey) {
                                $array[$subkey] = $value;
@@ -154,4 +213,13 @@ class UserSettingsController {
                        }
                }
        }
+
+       /**
+        * Returns the current BE user.
+        *
+        * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
+        */
+       protected function getBackendUser() {
+               return $GLOBALS['BE_USER'];
+       }
 }
index 9eb2220..a724a68 100644 (file)
@@ -159,12 +159,12 @@ class TreeElement extends AbstractFormElement {
                                        checkchange: TYPO3.Components.Tree.TcaCheckChangeHandler,
                                        collapsenode: function(node) {
                                                if (node.id !== "root") {
-                                                       top.TYPO3.BackendUserSettings.ExtDirect.removeFromList("tcaTrees." + this.ucId, node.attributes.uid);
+                                                       top.TYPO3.Storage.Persistent.removeFromList("tcaTrees." + this.ucId, node.attributes.uid);
                                                }
                                        },
                                        expandnode: function(node) {
                                                if (node.id !== "root") {
-                                                       top.TYPO3.BackendUserSettings.ExtDirect.addToList("tcaTrees." + this.ucId, node.attributes.uid);
+                                                       top.TYPO3.Storage.Persistent.addToList("tcaTrees." + this.ucId, node.attributes.uid);
                                                }
                                        },
                                        beforerender: function(treeCmp) {
index e0f52b8..71b8aa4 100644 (file)
@@ -22,17 +22,17 @@ namespace TYPO3\CMS\Backend\InterfaceState\ExtDirect;
 class DataProvider {
 
        /**
-        * @var \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider
+        * @var \TYPO3\CMS\Backend\Controller\UserSettingsController
         */
-       protected $userSettings;
+       protected $userSettingsController;
 
        /**
         * Constructor
         */
        public function __construct() {
                // All data is saved in BE_USER->uc
-               $this->userSettings = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
-                       \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider::class
+               $this->userSettingsController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+                       \TYPO3\CMS\Backend\Controller\UserSettingsController::class
                );
        }
 
@@ -44,7 +44,7 @@ class DataProvider {
         */
        public function getState($parameter) {
                $key = $parameter->params->key;
-               $data = $this->userSettings->get($key);
+               $data = $this->userSettingsController->process('get', $key);
                return array(
                        'success' => TRUE,
                        'data' => $data
@@ -61,7 +61,7 @@ class DataProvider {
                $key = $parameter->params->key;
                $data = json_decode($parameter->params->data);
                foreach ($data as $setting) {
-                       $this->userSettings->set($key . '.' . $setting->name, $setting->value);
+                       $this->userSettingsController->process('set', $key . '.' . $setting->name, $setting->value);
                }
                return array(
                        'success' => TRUE,
index d2af784..ad2d860 100644 (file)
@@ -1911,9 +1911,9 @@ function jumpToUrl(URL) {
                $hasSave = $saveStatePointer ? TRUE : FALSE;
                $collapsedStyle = ($collapsedClass = '');
                if ($hasSave) {
-                       /** @var $settings \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider */
-                       $settings = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider::class);
-                       $value = $settings->get($saveStatePointer . '.' . $id);
+                       /** @var $userSettingsController \TYPO3\CMS\Backend\Controller\UserSettingsController */
+                       $userSettingsController = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\UserSettingsController::class);
+                       $value = $userSettingsController->process('get', $saveStatePointer . '.' . $id);
                        if ($value) {
                                $collapsedStyle = ' style="display: none"';
                                $collapsedClass = ' collapsed';
@@ -1948,7 +1948,7 @@ function jumpToUrl(URL) {
                                        }
                                        if (saveKey) {
                                                try {
-                                                       top.TYPO3.BackendUserSettings.ExtDirect.set(saveKey + "." + tag.id, state, function(response) {});
+                                                       top.TYPO3.Storage.Persistent.set(saveKey + "." + tag.id, state);
                                                } catch(e) {}
                                        }
                                });
index 2261f35..78cc896 100644 (file)
@@ -343,9 +343,9 @@ class ExtdirectTreeCommands {
                }
                $mountPoints[] = (int)$GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint'];
                $mountPoints = array_unique($mountPoints);
-               /** @var $userSettings \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider */
-               $userSettings = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider::class);
-               $state = $userSettings->get('BackendComponents.States.' . $stateId);
+               /** @var $userSettingsController \TYPO3\CMS\Backend\Controller\UserSettingsController */
+               $userSettingsController = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\UserSettingsController::class);
+               $state = $userSettingsController->process('get', 'BackendComponents.States.' . $stateId);
                $state->stateHash = (object) $state->stateHash;
                $rootline = BackendUtility::BEgetRootLine($nodeId, '', $GLOBALS['BE_USER']->workspace != 0);
                $rootlineIds = array();
diff --git a/typo3/sysext/backend/Classes/User/ExtDirect/BackendUserSettingsDataProvider.php b/typo3/sysext/backend/Classes/User/ExtDirect/BackendUserSettingsDataProvider.php
deleted file mode 100644 (file)
index e139009..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-<?php
-namespace TYPO3\CMS\Backend\User\ExtDirect;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ArrayUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * ExtDirect DataProvider for BE User Settings
- *
- * @author Steffen Kamper <steffen@typo3.org>
- */
-class BackendUserSettingsDataProvider {
-
-       /**
-        * Get user settings
-        *
-        * Returns all user settings, if $key is not specified, otherwise it returns the value for $key
-        *
-        * @param string $key Identifier, allows also dotted notation for subarrays
-        * @return mixed Value associated
-        */
-       public function get($key = '') {
-               if (strpos($key, '.') !== FALSE) {
-                       $return = $this->getFromDottedNotation($key);
-               } else {
-                       $return = $key === '' ? $GLOBALS['BE_USER']->uc : $GLOBALS['BE_USER']->uc[$key];
-               }
-               return $return;
-       }
-
-       /**
-        * Sets user settings by key/value pair
-        *
-        * @param string $key
-        * @param mixed $value
-        * @return void
-        */
-       public function set($key, $value) {
-               if (strpos($key, '.') !== FALSE) {
-                       $this->setFromDottedNotation($key, $value);
-               } else {
-                       $GLOBALS['BE_USER']->uc[$key] = $value;
-               }
-               $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
-       }
-
-       /**
-        * Sets user settings by array and merges them with current settings
-        *
-        * @param array $array
-        * @return void
-        */
-       public function setFromArray(array $array) {
-               $GLOBALS['BE_USER']->uc = array_merge($GLOBALS['BE_USER']->uc, $array);
-               $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
-       }
-
-       /**
-        * Resets the user settings to the default
-        *
-        * @return void
-        */
-       public function reset() {
-               $GLOBALS['BE_USER']->resetUC();
-       }
-
-       /**
-        * Unsets a key in user settings
-        *
-        * @param string $key
-        * @return void
-        */
-       public function unsetKey($key) {
-               if (isset($GLOBALS['BE_USER']->uc[$key])) {
-                       unset($GLOBALS['BE_USER']->uc[$key]);
-                       $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
-               }
-       }
-
-       /**
-        * Adds an value to an Comma-separated list
-        * stored $key  of user settings
-        *
-        * @param string $key
-        * @param mixed $value
-        * @return void
-        */
-       public function addToList($key, $value) {
-               $list = $this->get($key);
-               if (!isset($list)) {
-                       $list = $value;
-               } else {
-                       if (!GeneralUtility::inList($list, $value)) {
-                               $list .= ',' . $value;
-                       }
-               }
-               $this->set($key, $list);
-       }
-
-       /**
-        * Removes an value from an Comma-separated list
-        * stored $key of user settings
-        *
-        * @param string $key
-        * @param mixed $value
-        * @return void
-        */
-       public function removeFromList($key, $value) {
-               $list = $this->get($key);
-               if (GeneralUtility::inList($list, $value)) {
-                       $list = GeneralUtility::trimExplode(',', $list, TRUE);
-                       $list = ArrayUtility::removeArrayEntryByValue($list, $value);
-                       $this->set($key, implode(',', $list));
-               }
-       }
-
-       /**
-        * Computes the subarray from dotted notation
-        *
-        * @param $key Dotted notation of subkeys like moduleData.module1.general.checked
-        * @return mixed $array value of the settings
-        */
-       protected function getFromDottedNotation($key) {
-               $subkeys = GeneralUtility::trimExplode('.', $key);
-               $array = &$GLOBALS['BE_USER']->uc;
-               foreach ($subkeys as $subkey) {
-                       $array = &$array[$subkey];
-               }
-               return $array;
-       }
-
-       /**
-        * Sets the value of a key written in dotted notation
-        *
-        * @param string $key
-        * @param mixed $value
-        * @return void
-        */
-       protected function setFromDottedNotation($key, $value) {
-               $subkeys = GeneralUtility::trimExplode('.', $key, TRUE);
-               $lastKey = $subkeys[count($subkeys) - 1];
-               $array = &$GLOBALS['BE_USER']->uc;
-               foreach ($subkeys as $subkey) {
-                       if ($subkey === $lastKey) {
-                               $array[$subkey] = $value;
-                       } else {
-                               $array = &$array[$subkey];
-                       }
-               }
-       }
-
-       /**
-        * Gets the last part of of an Dotted Notation
-        *
-        * @param string $key
-        * @return void
-        */
-       protected function getLastKeyFromDottedNotation($key) {
-               $subkeys = GeneralUtility::trimExplode('.', $key, TRUE);
-               return $subkeys[count($subkeys) - 1];
-       }
-
-}
index 985315b..d0d6db1 100644 (file)
@@ -60,16 +60,37 @@ define('TYPO3/CMS/Backend/Storage', ['jquery'], function ($) {
                        return this._getRecursiveDataByDeepKey(this._data, key.split('.'));
                }
        };
+
        Storage.Persistent.set = function(key, value) {
                if (this._data !== false) {
                        this._data = this._setRecursiveDataByDeepKey(this._data, key.split('.'), value);
                }
                return this._storeOnServer(key, value);
        };
+
+       Storage.Persistent.addToList = function(key, value) {
+               return $.ajax(TYPO3.settings.ajaxUrls['UserSettings::process'], {data: {'action': 'addToList', key: key, value: value}}).done(function(data) {
+                       Storage.Persistent._data = data;
+               });
+       };
+
+       Storage.Persistent.removeFromList = function(key, value) {
+               return $.ajax(TYPO3.settings.ajaxUrls['UserSettings::process'], {data: {'action': 'removeFromList', key: key, value: value}}).done(function(data) {
+                       Storage.Persistent._data = data;
+               });
+       };
+
+       Storage.Persistent.unset = function(key) {
+               return $.ajax(TYPO3.settings.ajaxUrls['UserSettings::process'], {data: {'action': 'unset', key: key}}).done(function(data) {
+                       Storage.Persistent._data = data;
+               });
+       };
+
        Storage.Persistent.clear = function() {
                $.ajax(TYPO3.settings.ajaxUrls['UserSettings::process'], {data: {'action': 'clear'}});
                this._data = false;
        };
+
        /**
         * checks if a key was set before, useful to not do all the undefined checks all the time
         */
index 3640a68..e12744b 100644 (file)
@@ -204,7 +204,7 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
                                        fn: function() {
                                                var element = Ext.fly(this.id + '-indicatorBar-temporaryMountPoint-clear');
                                                element.on('click', function() {
-                                                       TYPO3.BackendUserSettings.ExtDirect.unsetKey(
+                                                       top.TYPO3.Storage.Persistent.unset(
                                                                'pageTree_temporaryMountPoint',
                                                                function() {
                                                                        TYPO3.Components.PageTree.Configuration.temporaryMountPoint = null;
index 2e484bf..de45aeb 100644 (file)
@@ -113,7 +113,6 @@ return array(
        't3lib_folderTree' => \TYPO3\CMS\Backend\Tree\View\FolderTreeView::class,
        't3lib_positionMap' => \TYPO3\CMS\Backend\Tree\View\PagePositionMap::class,
        't3lib_pageTree' => \TYPO3\CMS\Backend\Tree\View\PageTreeView::class,
-       'extDirect_DataProvider_BackendUserSettings' => \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider::class,
        't3lib_BEfunc' => \TYPO3\CMS\Backend\Utility\BackendUtility::class,
        't3lib_iconWorks' => \TYPO3\CMS\Backend\Utility\IconUtility::class,
        'tx_cms_BackendLayout' => \TYPO3\CMS\Backend\View\BackendLayoutView::class,
index ea33f41..7f26d4d 100644 (file)
@@ -579,11 +579,6 @@ class t3lib_pageTree extends \TYPO3\CMS\Backend\Tree\View\PageTreeView {}
 /**
  * @deprecated since 6.0, removed since 7.0
  */
-class extDirect_DataProvider_BackendUserSettings extends \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider {}
-
-/**
- * @deprecated since 6.0, removed since 7.0
- */
 class t3lib_BEfunc extends \TYPO3\CMS\Backend\Utility\BackendUtility {}
 
 /**
index 9cacc21..0dd0083 100644 (file)
@@ -600,10 +600,6 @@ class Bootstrap {
                                'user,group'
                        );
                        Utility\ExtensionManagementUtility::registerExtDirectComponent(
-                               'TYPO3.BackendUserSettings.ExtDirect',
-                               \TYPO3\CMS\Backend\User\ExtDirect\BackendUserSettingsDataProvider::class
-                       );
-                       Utility\ExtensionManagementUtility::registerExtDirectComponent(
                                'TYPO3.ExtDirectStateProvider.ExtDirect',
                                \TYPO3\CMS\Backend\InterfaceState\ExtDirect\DataProvider::class
                        );
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-66868-MoveUsageOfBackendUserSettingsDataProvider.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-66868-MoveUsageOfBackendUserSettingsDataProvider.rst
new file mode 100644 (file)
index 0000000..45d75c9
--- /dev/null
@@ -0,0 +1,32 @@
+================================================================
+Breaking: #66868 - Move usage of BackendUserSettingsDataProvider
+================================================================
+
+Description
+===========
+
+The ExtDirect API `BackendUserSettingsDataProvider` has been removed.
+
+
+Impact
+======
+
+Third party code using either `BackendUserSettingsDataProvider` or `top.TYPO3.BackendUserSettings.ExtDirect` will fatal.
+
+
+Affected Installations
+======================
+
+Any installation using `BackendUserSettingsDataProvider` or `top.TYPO3.BackendUserSettings.ExtDirect` is affected.
+
+
+Migration
+=========
+
+In JavaScript, use `TYPO3.Storage.Persistent` API. In PHP, use `\TYPO3\CMS\Backend\Controller\UserSettingsController`:
+
+.. code-block:: [php]
+
+       /** @var $userSettingsController \TYPO3\CMS\Backend\Controller\UserSettingsController */
+       $userSettingsController = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\UserSettingsController::class);
+       $state = $userSettingsController->process('get', 'BackendComponents.States.' . $stateId);
\ No newline at end of file
index 79b3523..644f87c 100644 (file)
@@ -272,11 +272,10 @@ T3editor.prototype = {
 T3editor.toggleEditor = function(checkbox, index) {
        if (!Prototype.Browser.MobileSafari) {
                if (index == undefined) {
-                       if (top.TYPO3.BackendUserSettings) {
-                               top.TYPO3.BackendUserSettings.ExtDirect.set(
+                       if (top.TYPO3.Storage) {
+                               top.TYPO3.Storage.Persistent.set(
                                        'disableT3Editor',
-                                       checkbox.checked,
-                                       function(response) {}
+                                       checkbox.checked
                                );
                        }
                        $$('textarea.t3editor').each(