Index: t3lib/config_default.php =================================================================== --- t3lib/config_default.php (revision 9235) +++ t3lib/config_default.php (revision ) @@ -394,7 +394,8 @@ ) ), 'ExtDirect' => array( // array of key value pairs (provider -> location:className) that holds the classes for the ExtDirect functionality - 'TYPO3.CSH.ExtDirect' => 't3lib/extjs/dataprovider/class.extdirect_dataprovider_contexthelp.php:extDirect_DataProvider_ContextHelp' + 'TYPO3.CSH.ExtDirect' => 't3lib/extjs/dataprovider/class.extdirect_dataprovider_contexthelp.php:extDirect_DataProvider_ContextHelp', + 'TYPO3.BeUserSetting.ExtDirect' => 't3lib/extjs/dataprovider/class.extdirect_dataprovider_beuseruc.php:extDirect_DataProvider_BeUserUc', ), ), 'EXTCONF' => array( // Here you may add manually set configuration options for your extensions. Eg. $TYPO3_CONF_VARS['EXTCONF']['my_extension_key']['my_option'] = 'my_value'; Index: t3lib/extjs/dataprovider/class.extdirect_dataprovider_beuseruc.php =================================================================== --- t3lib/extjs/dataprovider/class.extdirect_dataprovider_beuseruc.php (revision ) +++ t3lib/extjs/dataprovider/class.extdirect_dataprovider_beuseruc.php (revision ) @@ -0,0 +1,86 @@ + + * 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. + * A copy is found in the textfile GPL.txt and important notices to the license + * from the author is found in LICENSE.txt distributed with these scripts. + * + * + * 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! + ***************************************************************/ + +/** + * ExtDirect DataProvider for BE User Settings + */ +class extDirect_DataProvider_BeUserUc { + + /** + * Resets the user settings to the default + * + * @return void + */ + public function resetUserSettings() { + $GLOBALS['BE_USER']->resetUC(); + } + + /** + * Gets a single user setting by key + * + * @param string $key + * @return + */ + public function getUserSetting($key) { + return $GLOBALS['BE_USER']->uc[$key]; + } + + /** + * Gets complete user settings + * + * @return array + */ + public function getUserSettings() { + return $GLOBALS['BE_USER']->uc; + } + + /** + * Sets user settings by key/value pair + * + * @param string $key + * @param mixed $value + * @return void + */ + public function setSingleSetting($key, $value) { + $GLOBALS['BE_USER']->uc[$key] = $value; + $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc); + } + + /** + * Sets user settings by array + * + * @param array $array + * @return void + */ + public function setSettingsFromArray(array $array) { + $GLOBALS['BE_USER']->uc = array_merge($GLOBALS['BE_USER']->uc, $array); + $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc); + } + +} + +?> \ No newline at end of file Index: typo3/backend.php =================================================================== --- typo3/backend.php (revision 9232) +++ typo3/backend.php (revision ) @@ -140,6 +140,7 @@ 'viewport' => 'js/extjs/viewport.js', 'iframepanel' => 'js/extjs/iframepanel.js', 'viewportConfiguration' => 'js/extjs/viewportConfiguration.js', + 'beUserSettings' => 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.BeUserSetting', ); if ($this->debug) {