ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilEditClipboard.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2009 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
24
37{
38 public static function getContentObjectType()
39 {
40 global $DIC;
41 $user = $DIC->user();
42 $lm_type = $user->getPref("lm_clipboard_type");
43 if ($lm_type != "") {
44 return $lm_type;
45 } else {
46 return false;
47 }
48 }
49
50 public static function setAction($a_action)
51 {
52 global $DIC;
53 $user = $DIC->user();
54 $user->writePref("lm_clipboard_action", $a_action);
55 }
56
57 public static function getAction()
58 {
59 global $DIC;
60 $user = $DIC->user();
61 $lm_action = $user->getPref("lm_clipboard_action");
62 if ($lm_action != "") {
63 return $lm_action;
64 } else {
65 return false;
66 }
67 }
68
69 public static function getContentObjectId()
70 {
71 global $DIC;
72 $user = $DIC->user();
73 $lm_id = $user->getPref("lm_clipboard_id");
74 if ($lm_id != "") {
75 return $lm_id;
76 }
77 return "";
78 }
79
80 public static function storeContentObject($a_type, $a_id, $a_action = "cut")
81 {
82 global $DIC;
83 $user = $DIC->user();
84 $user->writePref("lm_clipboard_id", $a_id);
85 $user->writePref("lm_clipboard_type", $a_type);
86 self::setAction($a_action);
87 }
88
89 public static function clear()
90 {
91 global $DIC;
92 $user = $DIC->user();
93 $user->clipboardDeleteObjectsOfType("pg");
94 $user->clipboardDeleteObjectsOfType("st");
95 $user->writePref("lm_clipboard_id", "");
96 $user->writePref("lm_clipboard_type", "");
97 $user->writePref("lm_clipboard_action", "");
98 }
99}
An exception for terminatinating execution or to throw for unit testing.
Class ilEditClipboard.
static setAction($a_action)
static storeContentObject($a_type, $a_id, $a_action="cut")
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46