TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
UserSettingsController Class Reference

Public Member Functions

 processAjaxRequest (ServerRequestInterface $request, ResponseInterface $response)
 
 process ($action, $key= '', $value= '')
 

Protected Member Functions

 get ($key)
 
 getAll ()
 
 set ($key, $value)
 
 addToList ($key, $value)
 
 removeFromList ($key, $value)
 
 clear ()
 
 unsetOption ($key)
 
 getFromDottedNotation ($key)
 
 setFromDottedNotation ($key, $value)
 
 getBackendUser ()
 

Detailed Description

A wrapper class to call BE_USER->uc used for AJAX and TYPO3.Storage JS object

Definition at line 27 of file UserSettingsController.php.

Member Function Documentation

addToList (   $key,
  $value 
)
protected

Adds an value to an Comma-separated list stored $key of user settings

Parameters
string$key
mixed$value
Returns
void

Definition at line 140 of file UserSettingsController.php.

References GeneralUtility\inList(), and UserSettingsController\set().

Referenced by UserSettingsController\process().

clear ( )
protected

Resets the user settings to the default

Returns
void

Definition at line 176 of file UserSettingsController.php.

References UserSettingsController\getBackendUser().

Referenced by UserSettingsController\process().

get (   $key)
protected

Returns a specific user setting

Parameters
string$keyIdentifier, allows also dotted notation for subarrays
Returns
mixed Value associated

Definition at line 99 of file UserSettingsController.php.

References UserSettingsController\getBackendUser(), and UserSettingsController\getFromDottedNotation().

getAll ( )
protected

Get all user settings

Returns
mixed all values, usually a multi-dimensional array

Definition at line 109 of file UserSettingsController.php.

References UserSettingsController\getBackendUser().

Referenced by UserSettingsController\process().

getFromDottedNotation (   $key)
protected

Computes the subarray from dotted notation

Parameters
$keystring Dotted notation of subkeys like moduleData.module1.general.checked
Returns
mixed value of the settings

Definition at line 202 of file UserSettingsController.php.

References UserSettingsController\getBackendUser(), and GeneralUtility\trimExplode().

Referenced by UserSettingsController\get().

process (   $action,
  $key = '',
  $value = '' 
)
processAjaxRequest ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Processes all AJAX calls and returns a JSON for the data

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 36 of file UserSettingsController.php.

References UserSettingsController\process().

removeFromList (   $key,
  $value 
)
protected

Removes an value from an Comma-separated list stored $key of user settings

Parameters
string$key
mixed$value
Returns
void

Definition at line 161 of file UserSettingsController.php.

References GeneralUtility\inList(), ArrayUtility\removeArrayEntryByValue(), UserSettingsController\set(), and GeneralUtility\trimExplode().

Referenced by UserSettingsController\process().

set (   $key,
  $value 
)
protected

Sets user settings by key/value pair

Parameters
string$key
mixed$value
Returns
void

Definition at line 121 of file UserSettingsController.php.

References UserSettingsController\getBackendUser(), and UserSettingsController\setFromDottedNotation().

Referenced by UserSettingsController\addToList(), UserSettingsController\process(), and UserSettingsController\removeFromList().

setFromDottedNotation (   $key,
  $value 
)
protected

Sets the value of a key written in dotted notation

Parameters
string$key
mixed$value
Returns
void

Definition at line 224 of file UserSettingsController.php.

References UserSettingsController\getBackendUser(), and GeneralUtility\trimExplode().

Referenced by UserSettingsController\set().

unsetOption (   $key)
protected

Unsets a key in user settings

Parameters
string$key
Returns
void

Definition at line 187 of file UserSettingsController.php.

References UserSettingsController\getBackendUser().

Referenced by UserSettingsController\process().