ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ImageMapEditSessionRepository.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
30 public const KEY_BASE = "il_map_";
31
32 public function __construct()
33 {
34 }
35
36 protected function get(string $key): mixed
37 {
38 if (\ilSession::has(self::KEY_BASE . $key)) {
39 return \ilSession::get(self::KEY_BASE . $key);
40 }
41 return null;
42 }
43
47 protected function set(string $key, $val): void
48 {
49 \ilSession::set(self::KEY_BASE . $key, $val);
50 }
51
52 public function setTargetScript(string $script): void
53 {
54 $this->set("edit_target_script", $script);
55 }
56
57 public function getTargetScript(): string
58 {
59 return (string) $this->get("edit_target_script");
60 }
61
62 public function setRefId(int $ref_id): void
63 {
64 $this->set("edit_ref_id", $ref_id);
65 }
66
67 public function getRefId(): int
68 {
69 return (int) $this->get("edit_ref_id");
70 }
71
72 public function setObjId(int $obj_id): void
73 {
74 $this->set("edit_obj_id", $obj_id);
75 }
76
77 public function getObjId(): int
78 {
79 return (int) $this->get("edit_obj_id");
80 }
81
82 public function setHierId(string $hier_id): void
83 {
84 $this->set("edit_hier_id", $hier_id);
85 }
86
87 public function getHierId(): string
88 {
89 return (string) $this->get("edit_hier_id");
90 }
91
92 public function setPCId(string $pc_id): void
93 {
94 $this->set("edit_pc_id", $pc_id);
95 }
96
97 public function getPCId(): string
98 {
99 return (string) $this->get("edit_pc_id");
100 }
101
102 public function setAreaType(string $type): void
103 {
104 $this->set("edit_area_type", $type);
105 }
106
107 public function getAreaType(): string
108 {
109 return (string) $this->get("edit_area_type");
110 }
111
112 public function setAreaNr(int $nr): void
113 {
114 $this->set("area_nr", $nr);
115 }
116
117 public function getAreaNr(): int
118 {
119 return (int) $this->get("area_nr");
120 }
121
122 public function setCoords(string $coords): void
123 {
124 $this->set("edit_coords", $coords);
125 }
126
127 public function getCoords(): string
128 {
129 return (string) $this->get("edit_coords");
130 }
131
132 public function setMode(string $mode): void
133 {
134 $this->set("edit_mode", $mode);
135 }
136
137 public function getMode(): string
138 {
139 return (string) $this->get("edit_mode");
140 }
141
142 public function setLinkType(string $type): void
143 {
144 $this->set("il_ltype", $type);
145 }
146
147 public function getLinkType(): string
148 {
149 return (string) $this->get("il_ltype");
150 }
151
152 public function setExternalLink(string $href): void
153 {
154 $this->set("el_href", $href);
155 }
156
157 public function getExternalLink(): string
158 {
159 return (string) $this->get("el_href");
160 }
161
162 public function setInternalLink(
163 string $type,
164 string $target,
165 string $target_frame,
166 string $anchor
167 ): void {
168 $this->set("il_type", $type);
169 $this->set("il_target", $target);
170 $this->set("il_targetframe", $target_frame);
171 $this->set("il_anchor", $anchor);
172 }
173
177 public function getInternalLink(): array
178 {
179 return [
180 "type" => (string) $this->get("il_type"),
181 "target" => (string) $this->get("il_target"),
182 "target_frame" => (string) $this->get("il_targetframe"),
183 "anchor" => (string) $this->get("il_anchor")
184 ];
185 }
186
187 public function clear(): void
188 {
189 \ilSession::clear(self::KEY_BASE . "area_nr");
190 \ilSession::clear(self::KEY_BASE . "edit_coords");
191 \ilSession::clear(self::KEY_BASE . "edit_mode");
192 \ilSession::clear(self::KEY_BASE . "el_href");
193 \ilSession::clear(self::KEY_BASE . "il_type");
194 \ilSession::clear(self::KEY_BASE . "il_ltype");
195 \ilSession::clear(self::KEY_BASE . "il_target");
196 \ilSession::clear(self::KEY_BASE . "il_targetframe");
197 \ilSession::clear(self::KEY_BASE . "il_anchor");
198 \ilSession::clear(self::KEY_BASE . "edit_area_type");
199 }
200}
setInternalLink(string $type, string $target, string $target_frame, string $anchor)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
static has($a_var)
$ref_id
Definition: ltiauth.php:66
get(string $class_name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...