ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDesktopItemGUI.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
34{
39 public static function addToDesktop()
40 {
41 global $DIC;
42
43 $ilUser = $DIC->user();
44
45 if ($_GET["item_ref_id"] and $_GET["type"]) {
46 ilObjUser::_addDesktopItem($ilUser->getId(), (int) $_GET['item_ref_id'], $_GET['type']);
47 } else {
48 if ($_POST["items"]) {
49 foreach ($_POST["items"] as $item) {
50 $type = ilObject::_lookupType($item, true);
52 }
53 }
54 }
55 return true;
56 }
57
62 public static function removeFromDesktop()
63 {
64 global $DIC;
65
66 $ilUser = $DIC->user();
67
68 if ($_GET["item_ref_id"] and $_GET["type"]) {
69 ilObjUser::_dropDesktopItem($ilUser->getId(), (int) $_GET['item_ref_id'], $_GET['type']);
70 } else {
71 if ($_POST["items"]) {
72 foreach ($_POST["items"] as $item) {
73 $type = ilObject::_lookupType($item, true);
75 }
76 }
77 }
78 return true;
79 }
80}
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
Handles add/remove to/from desktop requests.
static addToDesktop()
Add desktop item @access public.
static removeFromDesktop()
Remove item from personal desktop @access public.
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static _lookupType($a_id, $a_reference=false)
lookup object type
$type
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18