2 declare(strict_types = 1);
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
41 $this->backendUserConfiguration = GeneralUtility::makeInstance(BackendUserConfiguration::class);
53 $action = $request->getParsedBody()[
'action'] ?? $request->getQueryParams()[
'action'] ??
'';
54 $key = $request->getParsedBody()[
'key'] ?? $request->getQueryParams()[
'key'] ??
'';
55 $value = $request->getParsedBody()[
'value'] ?? $request->getQueryParams()[
'value'] ??
'';
71 public function process($action, $key =
'', $value =
'')
73 trigger_error(
'UserSettingsController->process() will be replaced by protected method processRequest() in TYPO3 v10.0. Do not call from other extensions.', E_USER_DEPRECATED);
85 protected function processRequest(
string $action,
string $key =
'', $value =
'')
89 $content = $this->backendUserConfiguration->get($key);
92 $content = $this->backendUserConfiguration->getAll();
95 $this->backendUserConfiguration->set($key, $value);
96 $content = $this->backendUserConfiguration->getAll();
99 $this->backendUserConfiguration->addToList($key, $value);
100 $content = $this->backendUserConfiguration->getAll();
102 case 'removeFromList':
103 $this->backendUserConfiguration->removeFromList($key, $value);
104 $content = $this->backendUserConfiguration->getAll();
107 $this->backendUserConfiguration->unsetOption($key);
108 $content = $this->backendUserConfiguration->getAll();
111 $this->backendUserConfiguration->clear();
112 $content = [
'result' =>
true];
115 $content = [
'result' =>
false];