TYPO3 CMS  TYPO3_7-6
TaskStatus.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Taskcenter;
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 
19 
24 {
32  public function saveCollapseState(ServerRequestInterface $request, ResponseInterface $response)
33  {
34  // Remove 'el_' in the beginning which is needed for the saveSortingState()
35  $item = isset($request->getParsedBody()['item']) ? $request->getParsedBody()['item'] : $request->getQueryParams()['item'];
36  $item = substr(htmlspecialchars($item), 3);
37  $state = (bool)(isset($request->getParsedBody()['state']) ? $request->getParsedBody()['state'] : $request->getQueryParams()['state']);
38 
39  $this->getBackendUserAuthentication()->uc['taskcenter']['states'][$item] = $state;
40  $this->getBackendUserAuthentication()->writeUC();
41 
42  return $response;
43  }
44 
52  public function saveSortingState(ServerRequestInterface $request, ResponseInterface $response)
53  {
54  $sort = [];
55  $data = isset($request->getParsedBody()['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);
62  $this->getBackendUserAuthentication()->writeUC();
63 
64  return $response;
65  }
66 
72  protected function getBackendUserAuthentication()
73  {
74  return $GLOBALS['BE_USER'];
75  }
76 }
saveCollapseState(ServerRequestInterface $request, ResponseInterface $response)
Definition: TaskStatus.php:32
saveSortingState(ServerRequestInterface $request, ResponseInterface $response)
Definition: TaskStatus.php:52
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']