ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
39 protected function get(string $key)
40 {
41 if (\ilSession::has(self::KEY_BASE . $key)) {
42 return \ilSession::get(self::KEY_BASE . $key);
43 }
44 return null;
45 }
46
50 protected function set(string $key, $val): void
51 {
52 \ilSession::set(self::KEY_BASE . $key, $val);
53 }
54
55 public function setTargetScript(string $script): void
56 {
57 $this->set("edit_target_script", $script);
58 }
59
60 public function getTargetScript(): string
61 {
62 return (string) $this->get("edit_target_script");
63 }
64
65 public function setRefId(int $ref_id): void
66 {
67 $this->set("edit_ref_id", $ref_id);
68 }
69
70 public function getRefId(): int
71 {
72 return (int) $this->get("edit_ref_id");
73 }
74
75 public function setObjId(int $obj_id): void
76 {
77 $this->set("edit_obj_id", $obj_id);
78 }
79
80 public function getObjId(): int
81 {
82 return (int) $this->get("edit_obj_id");
83 }
84
85 public function setHierId(string $hier_id): void
86 {
87 $this->set("edit_hier_id", $hier_id);
88 }
89
90 public function getHierId(): string
91 {
92 return (string) $this->get("edit_hier_id");
93 }
94
95 public function setPCId(string $pc_id): void
96 {
97 $this->set("edit_pc_id", $pc_id);
98 }
99
100 public function getPCId(): string
101 {
102 return (string) $this->get("edit_pc_id");
103 }
104
105 public function setAreaType(string $type): void
106 {
107 $this->set("edit_area_type", $type);
108 }
109
110 public function getAreaType(): string
111 {
112 return (string) $this->get("edit_area_type");
113 }
114
115 public function setAreaNr(int $nr): void
116 {
117 $this->set("area_nr", $nr);
118 }
119
120 public function getAreaNr(): int
121 {
122 return (int) $this->get("area_nr");
123 }
124
125 public function setCoords(string $coords): void
126 {
127 $this->set("edit_coords", $coords);
128 }
129
130 public function getCoords(): string
131 {
132 return (string) $this->get("edit_coords");
133 }
134
135 public function setMode(string $mode): void
136 {
137 $this->set("edit_mode", $mode);
138 }
139
140 public function getMode(): string
141 {
142 return (string) $this->get("edit_mode");
143 }
144
145 public function setLinkType(string $type): void
146 {
147 $this->set("il_ltype", $type);
148 }
149
150 public function getLinkType(): string
151 {
152 return (string) $this->get("il_ltype");
153 }
154
155 public function setExternalLink(string $href): void
156 {
157 $this->set("el_href", $href);
158 }
159
160 public function getExternalLink(): string
161 {
162 return (string) $this->get("el_href");
163 }
164
165 public function setInternalLink(
166 string $type,
167 string $target,
168 string $target_frame,
169 string $anchor
170 ): void {
171 $this->set("il_type", $type);
172 $this->set("il_target", $target);
173 $this->set("il_targetframe", $target_frame);
174 $this->set("il_anchor", $anchor);
175 }
176
180 public function getInternalLink(): array
181 {
182 return [
183 "type" => (string) $this->get("il_type"),
184 "target" => (string) $this->get("il_target"),
185 "target_frame" => (string) $this->get("il_targetframe"),
186 "anchor" => (string) $this->get("il_anchor")
187 ];
188 }
189
190 public function clear(): void
191 {
192 \ilSession::clear(self::KEY_BASE . "area_nr");
193 \ilSession::clear(self::KEY_BASE . "edit_coords");
194 \ilSession::clear(self::KEY_BASE . "edit_mode");
195 \ilSession::clear(self::KEY_BASE . "el_href");
196 \ilSession::clear(self::KEY_BASE . "il_type");
197 \ilSession::clear(self::KEY_BASE . "il_ltype");
198 \ilSession::clear(self::KEY_BASE . "il_target");
199 \ilSession::clear(self::KEY_BASE . "il_targetframe");
200 \ilSession::clear(self::KEY_BASE . "il_anchor");
201 \ilSession::clear(self::KEY_BASE . "edit_area_type");
202 }
203}
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...