‪TYPO3CMS  9.5
TaskStatusController.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
20 
26 {
33  public function ‪saveCollapseState(ServerRequestInterface $request): ResponseInterface
34  {
35  // Remove 'el_' in the beginning which is needed for the saveSortingState()
36  $item = $request->getParsedBody()['item'] ?? $request->getQueryParams()['item'];
37  $item = htmlspecialchars($item);
38  $state = (bool)($request->getParsedBody()['state'] ?? $request->getQueryParams()['state']);
39 
40  $this->‪getBackendUserAuthentication()->uc['taskcenter']['states'][$item] = $state;
42 
43  return new ‪JsonResponse(null);
44  }
45 
52  public function ‪saveSortingState(ServerRequestInterface $request): ResponseInterface
53  {
54  $sort = [];
55  $data = $request->getParsedBody()['data'] ?? $request->getQueryParams()['data'];
56 
57  $items = explode('&', $data);
58  foreach ($items as $item) {
59  $sort[] = substr($item, 12);
60  }
61  $this->‪getBackendUserAuthentication()->uc['taskcenter']['sorting'] = serialize($sort);
63 
64  return new ‪JsonResponse(null);
65  }
66 
72  protected function ‪getBackendUserAuthentication()
73  {
74  return ‪$GLOBALS['BE_USER'];
75  }
76 }
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\writeUC
‪writeUC($variable='')
Definition: AbstractUserAuthentication.php:1172
‪TYPO3\CMS\Taskcenter\Controller\TaskStatusController\saveCollapseState
‪ResponseInterface saveCollapseState(ServerRequestInterface $request)
Definition: TaskStatusController.php:33
‪TYPO3\CMS\Taskcenter\Controller
Definition: TaskModuleController.php:2
‪TYPO3\CMS\Taskcenter\Controller\TaskStatusController\getBackendUserAuthentication
‪TYPO3 CMS Core Authentication BackendUserAuthentication getBackendUserAuthentication()
Definition: TaskStatusController.php:72
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:25
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Taskcenter\Controller\TaskStatusController\saveSortingState
‪ResponseInterface saveSortingState(ServerRequestInterface $request)
Definition: TaskStatusController.php:52
‪TYPO3\CMS\Taskcenter\Controller\TaskStatusController
Definition: TaskStatusController.php:26