[TASK] Comment legacy files to be removed with 6.2
[Packages/TYPO3.CMS.git] / typo3 / sysext / taskcenter / Classes / TaskStatus.php
1 <?php
2 namespace TYPO3\CMS\Taskcenter;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010-2011 Georg Ringer <typo3@ringerge.org>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * Status of tasks
28 *
29 * @author Georg Ringer <typo3@ringerge.org>
30 */
31 class TaskStatus {
32
33 /**
34 * Saves the section toggle state of tasks in the backend user's uc
35 *
36 * @param array $params Array of parameters from the AJAX interface, currently unused
37 * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Object of type TYPO3AJAX
38 * @return void
39 */
40 public function saveCollapseState(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj) {
41 // Remove 'el_' in the beginning which is needed for the saveSortingState()
42 $item = substr(htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('item')), 3);
43 $state = (bool) \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('state');
44 $GLOBALS['BE_USER']->uc['taskcenter']['states'][$item] = $state;
45 $GLOBALS['BE_USER']->writeUC();
46 }
47
48 /**
49 * Saves the sorting order of tasks in the backend user's uc
50 *
51 * @param array $params Array of parameters from the AJAX interface, currently unused
52 * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Object of type TYPO3AJAX
53 * @return void
54 */
55 public function saveSortingState(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj) {
56 $sort = array();
57 $items = explode('&', \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('data'));
58 foreach ($items as $item) {
59 $sort[] = substr($item, 12);
60 }
61 $GLOBALS['BE_USER']->uc['taskcenter']['sorting'] = serialize($sort);
62 $GLOBALS['BE_USER']->writeUC();
63 }
64
65 }
66
67
68 ?>