Bug #23928 » 16234_beuseruc_extdirect.diff
t3lib/config_default.php (revision ) | ||
---|---|---|
)
|
||
),
|
||
'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';
|
t3lib/extjs/dataprovider/class.extdirect_dataprovider_beuseruc.php (revision ) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 Steffen Kamper <steffen@typo3.org>
|
||
* 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);
|
||
}
|
||
}
|
||
?>
|
typo3/backend.php (revision ) | ||
---|---|---|
'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) {
|