ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilEditClipboard.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2021 ILIAS open source, GPLv3, see LICENSE */
4 
14 {
15  public static function getContentObjectType()
16  {
17  global $DIC;
18  $user = $DIC->user();
19  $lm_type = $user->getPref("lm_clipboard_type");
20  if ($lm_type != "") {
21  return $lm_type;
22  } else {
23  return false;
24  }
25  }
26 
27  public static function setAction($a_action)
28  {
29  global $DIC;
30  $user = $DIC->user();
31  $user->writePref("lm_clipboard_action", $a_action);
32  }
33 
34  public static function getAction()
35  {
36  global $DIC;
37  $user = $DIC->user();
38  $lm_action = $user->getPref("lm_clipboard_action");
39  if ($lm_action != "") {
40  return $lm_action;
41  } else {
42  return false;
43  }
44  }
45 
46  public static function getContentObjectId()
47  {
48  global $DIC;
49  $user = $DIC->user();
50  $lm_id = $user->getPref("lm_clipboard_id");
51  if ($lm_id != "") {
52  return $lm_id;
53  }
54  return "";
55  }
56 
57  public static function storeContentObject($a_type, $a_id, $a_action = "cut")
58  {
59  global $DIC;
60  $user = $DIC->user();
61  $user->writePref("lm_clipboard_id", $a_id);
62  $user->writePref("lm_clipboard_type", $a_type);
63  self::setAction($a_action);
64  }
65 
66  public static function clear()
67  {
68  global $DIC;
69  $user = $DIC->user();
70  $user->clipboardDeleteObjectsOfType("pg");
71  $user->clipboardDeleteObjectsOfType("st");
72  $user->writePref("lm_clipboard_id", "");
73  $user->writePref("lm_clipboard_type", "");
74  $user->writePref("lm_clipboard_action", "");
75  }
76 }
static storeContentObject($a_type, $a_id, $a_action="cut")
global $DIC
Definition: goto.php:24
Class ilEditClipboard.
static setAction($a_action)