ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPageConfig.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
12 abstract class ilPageConfig
13 {
17  protected $lng;
18 
19  protected $int_link_filter = array("File", "PortfolioPage", "PortfolioTemplatePage");
20  protected $prevent_rte_usage = false;
21  protected $use_attached_content = false;
22  protected $pc_defs = array();
23  protected $pc_enabled = array();
24  protected $enabledinternallinks = false;
25  protected $enable_keywords = false;
26  protected $enable_anchors = false;
27  protected $enablewikilinks = false;
28  protected $page_toc = false;
29  protected $activation = false;
30  protected $scheduled_activation = false;
31  protected $preventhtmlunmasking = false;
32  protected $enabledselfassessment = false;
33  protected $enabledselfassessment_scorm = false;
34  protected $int_link_def_type = "";
35  protected $int_link_def_id = 0;
36  protected $multi_lang_support = false;
37  protected $single_page_mode = false; // currently only used by multi-lang support
38  // single page means: only one page per parent_id
39  protected $disable_default_qfeedback = false;
40  protected $question_html = array();
41  protected $use_stored_tries = false;
42  protected $enable_user_links = false;
43 
44  protected $edit_lock_support = true;
45 
49  protected $enable_permission_checks = false;
50 
54  protected $adve_set;
55 
60  protected $page_obj_key = "";
61 
67  final public function __construct()
68  {
69  global $DIC;
70 
71  $this->lng = $DIC->language();
72  // load pc_defs
73  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
74  $this->pc_defs = ilCOPagePCDef::getPCDefinitions();
75  foreach ($this->pc_defs as $def) {
76  $this->setEnablePCType($def["name"], (bool) $def["def_enabled"]);
77  }
78 
79  $this->adve_set = new ilSetting("adve");
80 
81  $def = new ilCOPageObjDef();
82  foreach($def->getDefinitions() as $key => $def) {
83  if (strtolower(get_class($this)) == strtolower($def["class_name"]."Config")) {
84  $this->page_obj_key = $key;
85  }
86  }
87 
88 
89  $this->init();
90  }
91 
98  public function init()
99  {
100  }
101 
102 
108  public function setEnablePCType($a_pc_type, $a_val)
109  {
110  $this->pc_enabled[$a_pc_type] = $a_val;
111  }
112 
118  public function getEnablePCType($a_pc_type)
119  {
120  return $this->pc_enabled[$a_pc_type];
121  }
122 
128  public function setEnableKeywords($a_val)
129  {
130  $this->enable_keywords = $a_val;
131  }
132 
138  public function getEnableKeywords()
139  {
140  return $this->enable_keywords;
141  }
142 
148  public function setEnableAnchors($a_val)
149  {
150  $this->enable_anchors = $a_val;
151  }
152 
158  public function getEnableAnchors()
159  {
160  return $this->enable_anchors;
161  }
162 
168  public function setEnableInternalLinks($a_enabledinternallinks)
169  {
170  $this->enabledinternallinks = $a_enabledinternallinks;
171  }
172 
178  public function getEnableInternalLinks()
179  {
181  }
182 
188  public function getEnableUserLinks()
189  {
190  if (!$this->getEnableInternalLinks()) {
191  return false;
192  }
193  if ($this->getIntLinkFilterWhiteList() && in_array("User", $this->int_link_filter)) {
194  return true;
195  }
196  if (!$this->getIntLinkFilterWhiteList() && !in_array("User", $this->int_link_filter)) {
197  return true;
198  }
199 
200  return false;
201  }
202 
208  public function setEnableWikiLinks($a_enablewikilinks)
209  {
210  $this->enablewikilinks = $a_enablewikilinks;
211  }
212 
218  public function getEnableWikiLinks()
219  {
220  return $this->enablewikilinks;
221  }
222 
228  public function addIntLinkFilter($a_val)
229  {
230  $lng = $this->lng;
231 
232  $this->setLocalizationLanguage($lng->getLangKey());
233  if (is_array($a_val)) {
234  $this->int_link_filter =
235  array_merge($a_val, $this->int_link_filter);
236  } else {
237  $this->int_link_filter[] = $a_val;
238  }
239  }
240 
246  public function removeIntLinkFilter($a_val)
247  {
248  foreach ($this->int_link_filter as $k => $v) {
249  if ($v == $a_val) {
250  unset($this->int_link_filter[$k]);
251  }
252  }
253  }
254 
255 
261  public function getIntLinkFilters()
262  {
263  return $this->int_link_filter;
264  }
265 
271  public function setIntLinkFilterWhiteList($a_white_list)
272  {
273  $this->link_filter_white_list = $a_white_list;
274  if ($a_white_list) {
275  $this->int_link_filter = array();
276  }
277  }
278 
284  public function getIntLinkFilterWhiteList()
285  {
286  return $this->link_filter_white_list;
287  }
288 
294  public function setPreventRteUsage($a_val)
295  {
296  $this->prevent_rte_usage = $a_val;
297  }
298 
304  public function getPreventRteUsage()
305  {
307  }
308 
314  public function setLocalizationLanguage($a_val)
315  {
316  $this->localization_lang = $a_val;
317  }
318 
324  public function getLocalizationLanguage()
325  {
326  return $this->localization_lang;
327  }
328 
334  public function setUseAttachedContent($a_val)
335  {
336  $this->use_attached_content = $a_val;
337  }
338 
344  public function getUseAttachedContent()
345  {
347  }
348 
354  public function setIntLinkHelpDefaultType($a_val)
355  {
356  $this->int_link_def_type = $a_val;
357  }
358 
364  public function getIntLinkHelpDefaultType()
365  {
367  }
368 
374  public function setIntLinkHelpDefaultId($a_val, $a_is_ref = true)
375  {
376  $this->int_link_def_id = $a_val;
377  $this->int_link_def_id_is_ref = $a_is_ref;
378  }
379 
385  public function getIntLinkHelpDefaultId()
386  {
387  return $this->int_link_def_id;
388  }
389 
396  {
397  return $this->int_link_def_id_is_ref;
398  }
399 
405  public function setEnableActivation($a_val)
406  {
407  $this->activation = $a_val;
408  }
409 
415  public function getEnableActivation()
416  {
417  return $this->activation;
418  }
419 
425  public function setEnableScheduledActivation($a_val)
426  {
427  $this->scheduled_activation = $a_val;
428  }
429 
436  {
438  }
439 
445  public function setEnablePageToc($a_val)
446  {
447  $this->page_toc = $a_val;
448  }
449 
455  public function getEnablePageToc()
456  {
457  return $this->page_toc;
458  }
459 
465  public function setPreventHTMLUnmasking($a_preventhtmlunmasking)
466  {
467  $this->preventhtmlunmasking = $a_preventhtmlunmasking;
468  }
469 
475  public function getPreventHTMLUnmasking()
476  {
477  $safe = true;
478  if ($this->adve_set->get("act_html_".$this->page_obj_key)) {
479  $safe = false;
480  }
481  return $safe;
482  //return $this->preventhtmlunmasking;
483  }
484 
490  public function setEnableSelfAssessment($a_enabledselfassessment, $a_scorm = true)
491  {
492  $this->setEnablePCType("Question", (bool) $a_enabledselfassessment);
493  $this->enabledselfassessment = $a_enabledselfassessment;
494  $this->enabledselfassessment_scorm = $a_scorm;
495  }
496 
497 
503  public function getEnableSelfAssessment()
504  {
506  }
507 
514  {
516  }
517 
523  public function setDisableDefaultQuestionFeedback($a_val)
524  {
525  $this->disable_default_qfeedback = $a_val;
526  }
527 
534  {
536  }
537 
543  public function setMultiLangSupport($a_val)
544  {
545  $this->multi_lang_support = $a_val;
546  }
547 
553  public function getMultiLangSupport()
554  {
556  }
557 
563  public function setSinglePageMode($a_val)
564  {
565  $this->single_page_mode = $a_val;
566  }
567 
573  public function getSinglePageMode()
574  {
576  }
577 
579  {
580  $this->question_html = $question_html;
581  }
582 
583  public function getQuestionHTML()
584  {
585  return $this->question_html;
586  }
587 
593  public function setUseStoredQuestionTries($a_val)
594  {
595  $this->use_stored_tries = $a_val;
596  }
597 
603  public function getUseStoredQuestionTries()
604  {
606  }
607 
613  public function setEnablePermissionChecks($a_val)
614  {
615  $this->enable_permission_checks = $a_val;
616  }
617 
623  public function getEnablePermissionChecks()
624  {
626  }
627 
631  public function setEditLockSupport($a_val)
632  {
633  $this->edit_lock_support = $a_val;
634  }
635 
639  public function getEditLockSupport()
640  {
642  }
643 }
getEnableSelfAssessment()
Get Enable Self Assessment Questions.
setUseAttachedContent($a_val)
Set use attached content.
getEnablePageToc()
Get enable page toc.
setEnablePCType($a_pc_type, $a_val)
Set enable pc type.
setEnableSelfAssessment($a_enabledselfassessment, $a_scorm=true)
Set Enable Self Assessment Questions.
getLocalizationLanguage()
Get localizazion language.
setEnableWikiLinks($a_enablewikilinks)
Set Enable Wiki Links.
setEnableKeywords($a_val)
Set enable keywords handling.
global $DIC
Definition: saml.php:7
setIntLinkHelpDefaultType($a_val)
Set internal link default type.
COPage page object definition handler.
setEnableAnchors($a_val)
Set enable anchors.
getIntLinkFilterWhiteList()
Get internal links filter type list to white list.
getMultiLangSupport()
Get multi language support.
setEnableScheduledActivation($a_val)
Set enable scheduled page activation.
getIntLinkFilters()
Get internal links filter.
static getPCDefinitions()
Get PC definitions.
getEnableWikiLinks()
Get Enable Wiki Links.
setMultiLangSupport($a_val)
Set multi language support.
setSinglePageMode($a_val)
Set single page mode.
getEnableScheduledActivation()
Get enable scheduled page activation.
getUseStoredQuestionTries()
Get use stored answers/tries.
removeIntLinkFilter($a_val)
Remove int link filter.
setEnablePageToc($a_val)
Set enable page toc.
Config class for page editing.
setLocalizationLanguage($a_val)
Set localizazion language.
getEnableKeywords()
Get enable keywords handling.
setQuestionHTML($question_html)
getEnableAnchors()
Get enable anchors.
getEnablePCType($a_pc_type)
Get enable pc type.
getUseAttachedContent()
Get use attached content.
getDisableDefaultQuestionFeedback()
Get disable default question feedback.
getEnableSelfAssessmentScorm()
Is self assessment used in SCORM mode?
setEnableInternalLinks($a_enabledinternallinks)
Set Enable internal links.
getIntLinkHelpDefaultType()
Get internal link default type.
setEnableActivation($a_val)
Set enabled actication.
getEnablePermissionChecks()
Get enable permission checks.
setDisableDefaultQuestionFeedback($a_val)
Set disable default question feedback.
Create styles array
The data for the language used.
getIntLinkHelpDefaultId()
Get internal link default id.
getPreventRteUsage()
Get prevent rte usage.
getSinglePageMode()
Get single page mode.
setPreventHTMLUnmasking($a_preventhtmlunmasking)
Set Prevent HTML Unmasking (true/false).
addIntLinkFilter($a_val)
Add internal links filter.
getEnableUserLinks()
Get enable user links.
setEditLockSupport($a_val)
$def
Definition: croninfo.php:21
getIntLinkHelpDefaultIdIsRef()
Get internal link default id.
setIntLinkFilterWhiteList($a_white_list)
Set internal links filter type list to white list.
getEnableActivation()
Get enabled actication.
getPreventHTMLUnmasking()
Get Prevent HTML Unmasking (true/false).
__construct()
Constructor.
setUseStoredQuestionTries($a_val)
Set use stored answers/tries.
$key
Definition: croninfo.php:18
setPreventRteUsage($a_val)
Set prevent rte usage.
setEnablePermissionChecks($a_val)
Set enable permission checks.
setIntLinkHelpDefaultId($a_val, $a_is_ref=true)
Set internal link default id.
getEnableInternalLinks()
Get Enable internal links.