ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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);
51  ilObjUser::_addDesktopItem($ilUser->getId(), $item, $type);
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);
74  ilObjUser::_dropDesktopItem($ilUser->getId(), $item, $type);
75  }
76  }
77  }
78  return true;
79  }
80 }
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static addToDesktop()
Add desktop item public.
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user&#39;s personal desktop
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
static removeFromDesktop()
Remove item from personal desktop public.
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user&#39;s personal desktop
Handles add/remove to/from desktop requests.
$_POST["username"]