ILIAS  release_8 Revision v8.24
class.ilPageConfig.php
Go to the documentation of this file.
1<?php
2
24abstract class ilPageConfig
25{
26 // section protection
27 public const SEC_PROTECT_NONE = 0; // page does not support section protection
28 public const SEC_PROTECT_EDITABLE = 1; // current use can edit protected sections
29 public const SEC_PROTECT_PROTECTED = 2; // current use cannot edit protected sections
30
31 protected bool $int_link_def_id_is_ref = false;
32 protected ilLanguage $lng;
33 protected array $int_link_filter = array("File", "PortfolioPage", "PortfolioTemplatePage");
34 protected bool $prevent_rte_usage = false;
35 protected bool $use_attached_content = false;
36 protected array $pc_defs = array();
37 protected array $pc_enabled = array();
38 protected bool $enabledinternallinks = false;
39 protected bool $enable_keywords = false;
40 protected bool $enable_anchors = false;
41 protected bool $enablewikilinks = false;
42 protected bool $page_toc = false;
43 protected bool $activation = false;
44 protected bool $scheduled_activation = false;
45 protected bool $preventhtmlunmasking = false;
46 protected bool $enabledselfassessment = false;
47 protected bool $enabledselfassessment_scorm = false;
48 protected string $int_link_def_type = "";
49 protected int $int_link_def_id = 0;
50 protected bool $multi_lang_support = false;
51 protected bool $single_page_mode = false; // currently only used by multi-lang support
52 // single page means: only one page per parent_id
53 protected bool $disable_default_qfeedback = false;
54 protected array $question_html = array();
55 protected bool $use_stored_tries = false;
56 protected bool $enable_user_links = false;
57 protected bool $edit_lock_support = true;
58 protected bool $use_page_container = true;
59 protected bool $enable_permission_checks = false;
60 protected \ilSetting $adve_set;
65 protected string $page_obj_key = "";
66 protected bool $link_filter_white_list = false;
67 protected string $localization_lang = "";
69 protected string $section_protection_info = "";
70
71 final public function __construct()
72 {
73 global $DIC;
74
75 $this->lng = $DIC->language();
76 // load pc_defs
77 $this->pc_defs = ilCOPagePCDef::getPCDefinitions();
78 foreach ($this->pc_defs as $def) {
79 $this->setEnablePCType($def["name"], (bool) $def["def_enabled"]);
80 }
81
82 $this->adve_set = new ilSetting("adve");
83 $def = new ilCOPageObjDef();
84 foreach ($def->getDefinitions() as $key => $def) {
85 if (strtolower(get_class($this)) == strtolower($def["class_name"] . "Config")) {
86 $this->page_obj_key = $key;
87 }
88 }
89 $this->init();
90 }
91
92 public function init(): void
93 {
94 }
95
96 public function setEnablePCType(string $a_pc_type, bool $a_val): void
97 {
98 $this->pc_enabled[$a_pc_type] = $a_val;
99 }
100
101 public function getEnablePCType(string $a_pc_type): bool
102 {
103 return $this->pc_enabled[$a_pc_type];
104 }
105
106 public function getEnabledTopPCTypes(): array
107 {
108 $types = [];
109 foreach ($this->pc_defs as $def) {
110 if ($def["top_item"] && $this->getEnablePCType($def["name"])) {
111 $types[] = $def;
112 }
113 }
114 return $types;
115 }
116
117 public function setEnableKeywords(bool $a_val): void
118 {
119 $this->enable_keywords = $a_val;
120 }
121
122 public function getEnableKeywords(): bool
123 {
125 }
126
127 public function setEnableAnchors(bool $a_val): void
128 {
129 $this->enable_anchors = $a_val;
130 }
131
132 public function getEnableAnchors(): bool
133 {
135 }
136
137 public function setEnableInternalLinks(bool $a_enabledinternallinks): void
138 {
139 $this->enabledinternallinks = $a_enabledinternallinks;
140 }
141
142 public function getEnableInternalLinks(): bool
143 {
145 }
146
147 public function getEnableUserLinks(): bool
148 {
149 if (!$this->getEnableInternalLinks()) {
150 return false;
151 }
152 if ($this->getIntLinkFilterWhiteList() && in_array("User", $this->int_link_filter)) {
153 return true;
154 }
155 if (!$this->getIntLinkFilterWhiteList() && !in_array("User", $this->int_link_filter)) {
156 return true;
157 }
158
159 return false;
160 }
161
162 public function setEnableWikiLinks(bool $a_enablewikilinks): void
163 {
164 $this->enablewikilinks = $a_enablewikilinks;
165 }
166
167 public function getEnableWikiLinks(): bool
168 {
170 }
171
176 public function addIntLinkFilter(string $a_val): void
177 {
179
180 $this->setLocalizationLanguage($lng->getLangKey());
181 $this->int_link_filter[] = $a_val;
182 }
183
184 public function removeIntLinkFilter(string $a_val): void
185 {
186 foreach ($this->int_link_filter as $k => $v) {
187 if ($v == $a_val) {
188 unset($this->int_link_filter[$k]);
189 }
190 }
191 }
192
193 public function getIntLinkFilters(): array
194 {
196 }
197
201 public function setIntLinkFilterWhiteList(bool $a_white_list): void
202 {
203 $this->link_filter_white_list = $a_white_list;
204 if ($a_white_list) {
205 $this->int_link_filter = array();
206 }
207 }
208
209 public function getIntLinkFilterWhiteList(): bool
210 {
212 }
213
214 public function setPreventRteUsage(bool $a_val): void
215 {
216 $this->prevent_rte_usage = $a_val;
217 }
218
219 public function getPreventRteUsage(): bool
220 {
222 }
223
227 public function setLocalizationLanguage(string $a_val): void
228 {
229 $this->localization_lang = $a_val;
230 }
231
232 public function getLocalizationLanguage(): string
233 {
235 }
236
237 public function setUseAttachedContent(bool $a_val): void
238 {
239 $this->use_attached_content = $a_val;
240 }
241
242 public function getUseAttachedContent(): bool
243 {
245 }
246
247 public function setIntLinkHelpDefaultType(string $a_val): void
248 {
249 $this->int_link_def_type = $a_val;
250 }
251
252 public function getIntLinkHelpDefaultType(): string
253 {
255 }
256
261 public function setIntLinkHelpDefaultId(
262 int $a_val,
263 bool $a_is_ref = true
264 ): void {
265 $this->int_link_def_id = $a_val;
266 $this->int_link_def_id_is_ref = $a_is_ref;
267 }
268
269 public function getIntLinkHelpDefaultId(): int
270 {
271 return $this->int_link_def_id;
272 }
273
274 public function getIntLinkHelpDefaultIdIsRef(): bool
275 {
276 return $this->int_link_def_id_is_ref;
277 }
278
282 public function setEnableActivation(bool $a_val): void
283 {
284 $this->activation = $a_val;
285 }
286
287 public function getEnableActivation(): bool
288 {
289 return $this->activation;
290 }
291
292 public function setEnableScheduledActivation(bool $a_val): void
293 {
294 $this->scheduled_activation = $a_val;
295 }
296
297 public function getEnableScheduledActivation(): bool
298 {
299 return $this->scheduled_activation;
300 }
301
302 public function setEnablePageToc(bool $a_val): void
303 {
304 $this->page_toc = $a_val;
305 }
306
307 public function getEnablePageToc(): bool
308 {
309 return $this->page_toc;
310 }
311
312 public function setPreventHTMLUnmasking(
313 bool $a_preventhtmlunmasking
314 ): void {
315 $this->preventhtmlunmasking = $a_preventhtmlunmasking;
316 }
317
318 public function getPreventHTMLUnmasking(): bool
319 {
320 return true;
321 }
322
323 public function setEnableSelfAssessment(
324 bool $a_enabledselfassessment,
325 bool $a_scorm = true
326 ): void {
327 $this->setEnablePCType("Question", $a_enabledselfassessment);
328 $this->enabledselfassessment = $a_enabledselfassessment;
329 $this->enabledselfassessment_scorm = $a_scorm;
330 }
331
332 public function getEnableSelfAssessment(): bool
333 {
334 return $this->enabledselfassessment;
335 }
336
340 public function getEnableSelfAssessmentScorm(): bool
341 {
342 return $this->enabledselfassessment_scorm;
343 }
344
348 public function setDisableDefaultQuestionFeedback(bool $a_val): void
349 {
350 $this->disable_default_qfeedback = $a_val;
351 }
352
353 public function getDisableDefaultQuestionFeedback(): bool
354 {
355 return $this->disable_default_qfeedback;
356 }
357
358 public function setMultiLangSupport(bool $a_val): void
359 {
360 $this->multi_lang_support = $a_val;
361 }
362
363 public function getMultiLangSupport(): bool
364 {
365 return $this->multi_lang_support;
366 }
367
372 public function setSinglePageMode(bool $a_val): void
373 {
374 $this->single_page_mode = $a_val;
375 }
376
377 public function getSinglePageMode(): bool
378 {
379 return $this->single_page_mode;
380 }
381
382 public function setQuestionHTML(array $question_html): void
383 {
384 $this->question_html = $question_html;
385 }
386
387 public function getQuestionHTML(): array
388 {
389 return $this->question_html;
390 }
391
396 public function setUseStoredQuestionTries(bool $a_val): void
397 {
398 $this->use_stored_tries = $a_val;
399 }
400
401 public function getUseStoredQuestionTries(): bool
402 {
403 return $this->use_stored_tries;
404 }
405
406 public function setEnablePermissionChecks(bool $a_val): void
407 {
408 $this->enable_permission_checks = $a_val;
409 }
410
411 public function getEnablePermissionChecks(): bool
412 {
413 return $this->enable_permission_checks;
414 }
415
419 public function setEditLockSupport(bool $a_val): void
420 {
421 $this->edit_lock_support = $a_val;
422 }
423
424 public function getEditLockSupport(): bool
425 {
426 return $this->edit_lock_support;
427 }
428
432 public function setUsePageContainer(bool $a_val): void
433 {
434 $this->use_page_container = $a_val;
435 }
436
437 public function getUsePageContainer(): bool
438 {
439 return $this->use_page_container;
440 }
441
442 public function setSectionProtection(int $a_val): void
443 {
444 $this->section_protection = $a_val;
445 }
446
447 public function getSectionProtection(): int
448 {
449 return $this->section_protection;
450 }
451
452 public function setSectionProtectionInfo(string $a_val): void
453 {
454 $this->section_protection_info = $a_val;
455 }
456
457 public function getSectionProtectionInfo(): string
458 {
459 return $this->section_protection_info;
460 }
461}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language handling
getLangKey()
Return lang key.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEditLockSupport(bool $a_val)
setUseAttachedContent(bool $a_val)
setIntLinkHelpDefaultId(int $a_val, bool $a_is_ref=true)
Set internal link default id.
removeIntLinkFilter(string $a_val)
setEnableActivation(bool $a_val)
Set enabled page activation.
bool $enable_permission_checks
setDisableDefaultQuestionFeedback(bool $a_val)
Set disable default question feedback.
setIntLinkHelpDefaultType(string $a_val)
setLocalizationLanguage(string $a_val)
setPreventRteUsage(bool $a_val)
setEnableScheduledActivation(bool $a_val)
setEnablePCType(string $a_pc_type, bool $a_val)
setEnableSelfAssessment(bool $a_enabledselfassessment, bool $a_scorm=true)
setSectionProtection(int $a_val)
string $section_protection_info
getEnableSelfAssessmentScorm()
Is self assessment used in SCORM mode?
getEnablePCType(string $a_pc_type)
addIntLinkFilter(string $a_val)
Add internal links filter.
setSinglePageMode(bool $a_val)
Set single page mode.
setMultiLangSupport(bool $a_val)
bool $disable_default_qfeedback
setEnableAnchors(bool $a_val)
setIntLinkFilterWhiteList(bool $a_white_list)
Set internal links filter type list to white list.
bool $enabledselfassessment_scorm
setUseStoredQuestionTries(bool $a_val)
Set use stored answers/tries.
setEnableWikiLinks(bool $a_enablewikilinks)
setSectionProtectionInfo(string $a_val)
setQuestionHTML(array $question_html)
setEnablePermissionChecks(bool $a_val)
setEnableKeywords(bool $a_val)
setEnablePageToc(bool $a_val)
setPreventHTMLUnmasking(bool $a_preventhtmlunmasking)
setEnableInternalLinks(bool $a_enabledinternallinks)
setUsePageContainer(bool $a_val)
Set if page container css class should be used.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193