[BUGFIX] Error in "open in new window" in task module
[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 * @package TYPO3
31 * @subpackage taskcenter
32 */
33 class TaskStatus {
34
35 /**
36 * Saves the section toggle state of tasks in the backend user's uc
37 *
38 * @param array $params Array of parameters from the AJAX interface, currently unused
39 * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Object of type TYPO3AJAX
40 * @return void
41 */
42 public function saveCollapseState(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj) {
43 // Remove 'el_' in the beginning which is needed for the saveSortingState()
44 $item = substr(htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('item')), 3);
45 $state = (bool) \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('state');
46 $GLOBALS['BE_USER']->uc['taskcenter']['states'][$item] = $state;
47 $GLOBALS['BE_USER']->writeUC();
48 }
49
50 /**
51 * Saves the sorting order of tasks in the backend user's uc
52 *
53 * @param array $params Array of parameters from the AJAX interface, currently unused
54 * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Object of type TYPO3AJAX
55 * @return void
56 */
57 public function saveSortingState(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj) {
58 $sort = array();
59 $items = explode('&', \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('data'));
60 foreach ($items as $item) {
61 $sort[] = substr($item, 12);
62 }
63 $GLOBALS['BE_USER']->uc['taskcenter']['sorting'] = serialize($sort);
64 $GLOBALS['BE_USER']->writeUC();
65 }
66
67 }
68
69
70 ?>