ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilEditClipboard.php
Go to the documentation of this file.
1<?php
2
28{
29 public static function getContentObjectType(): string
30 {
31 global $DIC;
32 $user = $DIC->user();
33 $lm_type = $user->getPref("lm_clipboard_type");
34 if ($lm_type != "") {
35 return $lm_type;
36 } else {
37 return "";
38 }
39 }
40
41 public static function setAction(string $a_action): void
42 {
43 global $DIC;
44 $user = $DIC->user();
45 $user->writePref("lm_clipboard_action", $a_action);
46 }
47
48 public static function getAction(): string
49 {
50 global $DIC;
51 $user = $DIC->user();
52 return (string) $user->getPref("lm_clipboard_action");
53 }
54
55 public static function getContentObjectId(): int
56 {
57 global $DIC;
58 $user = $DIC->user();
59 $lm_id = $user->getPref("lm_clipboard_id");
60 if ($lm_id != "") {
61 return (int) $lm_id;
62 }
63 return 0;
64 }
65
66 public static function storeContentObject(
67 string $a_type,
68 int $a_id,
69 string $a_action = "cut"
70 ): void {
71 global $DIC;
72 $user = $DIC->user();
73 $user->writePref("lm_clipboard_id", $a_id);
74 $user->writePref("lm_clipboard_type", $a_type);
75 self::setAction($a_action);
76 }
77
78 public static function clear(): void
79 {
80 global $DIC;
81 $user = $DIC->user();
82 $user->clipboardDeleteObjectsOfType("pg");
83 $user->clipboardDeleteObjectsOfType("st");
84 $user->writePref("lm_clipboard_id", "");
85 $user->writePref("lm_clipboard_type", "");
86 $user->writePref("lm_clipboard_action", "");
87 }
88}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static storeContentObject(string $a_type, int $a_id, string $a_action="cut")
static setAction(string $a_action)
global $DIC
Definition: shib_login.php:26