ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 {
14  protected $int_link_filter = array("File");
15  protected $prevent_rte_usage = false;
16  protected $use_attached_content = false;
17  protected $pc_defs = array();
18  protected $pc_enabled = array();
19  protected $enabledinternallinks = false;
20  protected $enable_keywords = false;
21  protected $enable_anchors = false;
22  protected $enablewikilinks = false;
23  protected $page_toc = false;
24  protected $activation = false;
25  protected $scheduled_activation = false;
26  protected $preventhtmlunmasking = false;
27  protected $enabledselfassessment = false;
28  protected $enabledselfassessment_scorm = false;
29  protected $int_link_def_type = "";
30  protected $int_link_def_id = 0;
31  protected $multi_lang_support = false;
32  protected $single_page_mode = false; // currently only used by multi-lang support
33  // single page means: only one page per parent_id
34  protected $disable_default_qfeedback = false;
35  protected $question_html = array();
36  protected $use_stored_tries = false;
37  protected $enable_user_links = false;
38 
42  protected $enable_permission_checks = false;
43 
50  final public function __construct()
51  {
52  // load pc_defs
53  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
54  $this->pc_defs = ilCOPagePCDef::getPCDefinitions();
55  foreach ($this->pc_defs as $def)
56  {
57  $this->setEnablePCType($def["name"], (bool) $def["def_enabled"]);
58  }
59 
60  $this->init();
61  }
62 
69  function init()
70  {
71  }
72 
73 
79  function setEnablePCType($a_pc_type, $a_val)
80  {
81  $this->pc_enabled[$a_pc_type] = $a_val;
82  }
83 
89  function getEnablePCType($a_pc_type)
90  {
91  return $this->pc_enabled[$a_pc_type];
92  }
93 
99  function setEnableKeywords($a_val)
100  {
101  $this->enable_keywords = $a_val;
102  }
103 
109  function getEnableKeywords()
110  {
111  return $this->enable_keywords;
112  }
113 
119  function setEnableAnchors($a_val)
120  {
121  $this->enable_anchors = $a_val;
122  }
123 
129  function getEnableAnchors()
130  {
131  return $this->enable_anchors;
132  }
133 
139  function setEnableInternalLinks($a_enabledinternallinks)
140  {
141  $this->enabledinternallinks = $a_enabledinternallinks;
142  }
143 
150  {
152  }
153 
159  function setEnableUserLinks($a_val)
160  {
161  $this->enable_user_links = $a_val;
162  }
163 
170  {
172  }
173 
179  function setEnableWikiLinks($a_enablewikilinks)
180  {
181  $this->enablewikilinks = $a_enablewikilinks;
182  }
183 
190  {
191  return $this->enablewikilinks;
192  }
193 
199  function addIntLinkFilter($a_val)
200  {
201  global $lng;
202 
203  $this->setLocalizationLanguage($lng->getLangKey());
204  if (is_array($a_val))
205  {
206  $this->int_link_filter =
207  array_merge($a_val, $this->int_link_filter);
208  }
209  else
210  {
211  $this->int_link_filter[] = $a_val;
212  }
213  }
214 
220  function removeIntLinkFilter($a_val)
221  {
222  foreach ($this->int_link_filter as $k => $v)
223  {
224  if ($v == $a_val)
225  {
226  unset($this->int_link_filter[$k]);
227  }
228  }
229  }
230 
231 
237  function getIntLinkFilters()
238  {
239  return $this->int_link_filter;
240  }
241 
247  function setIntLinkFilterWhiteList($a_white_list)
248  {
249  $this->link_filter_white_list = $a_white_list;
250  }
251 
258  {
259  return $this->link_filter_white_list;
260  }
261 
267  function setPreventRteUsage($a_val)
268  {
269  $this->prevent_rte_usage = $a_val;
270  }
271 
278  {
280  }
281 
287  function setLocalizationLanguage($a_val)
288  {
289  $this->localization_lang = $a_val;
290  }
291 
298  {
299  return $this->localization_lang;
300  }
301 
307  function setUseAttachedContent($a_val)
308  {
309  $this->use_attached_content = $a_val;
310  }
311 
318  {
320  }
321 
327  function setIntLinkHelpDefaultType($a_val)
328  {
329  $this->int_link_def_type = $a_val;
330  }
331 
338  {
340  }
341 
347  function setIntLinkHelpDefaultId($a_val)
348  {
349  $this->int_link_def_id = $a_val;
350  }
351 
358  {
359  return $this->int_link_def_id;
360  }
361 
367  function setEnableActivation($a_val)
368  {
369  $this->activation = $a_val;
370  }
371 
378  {
379  return $this->activation;
380  }
381 
388  {
389  $this->scheduled_activation = $a_val;
390  }
391 
398  {
400  }
401 
407  function setEnablePageToc($a_val)
408  {
409  $this->page_toc = $a_val;
410  }
411 
417  function getEnablePageToc()
418  {
419  return $this->page_toc;
420  }
421 
427  function setPreventHTMLUnmasking($a_preventhtmlunmasking)
428  {
429  $this->preventhtmlunmasking = $a_preventhtmlunmasking;
430  }
431 
438  {
440  }
441 
447  function setEnableSelfAssessment($a_enabledselfassessment, $a_scorm = true)
448  {
449  $this->setEnablePCType("Question", (bool) $a_enabledselfassessment);
450  $this->enabledselfassessment = $a_enabledselfassessment;
451  $this->enabledselfassessment_scorm = $a_scorm;
452  }
453 
454 
461  {
463  }
464 
471  {
473  }
474 
481  {
482  $this->disable_default_qfeedback = $a_val;
483  }
484 
491  {
493  }
494 
500  function setMultiLangSupport($a_val)
501  {
502  $this->multi_lang_support = $a_val;
503  }
504 
511  {
513  }
514 
520  function setSinglePageMode($a_val)
521  {
522  $this->single_page_mode = $a_val;
523  }
524 
530  function getSinglePageMode()
531  {
533  }
534 
536  {
537  $this->question_html = $question_html;
538  }
539 
540  function getQuestionHTML()
541  {
542  return $this->question_html;
543  }
544 
550  function setUseStoredQuestionTries($a_val)
551  {
552  $this->use_stored_tries = $a_val;
553  }
554 
561  {
563  }
564 
570  function setEnablePermissionChecks($a_val)
571  {
572  $this->enable_permission_checks = $a_val;
573  }
574 
581  {
583  }
584 }
585 ?>
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.
setIntLinkHelpDefaultType($a_val)
Set internal link default type.
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.
setIntLinkHelpDefaultId($a_val)
Set internal link default id.
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.
setEnableUserLinks($a_val)
Set enable user links.
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).
global $lng
Definition: privfeed.php:17
addIntLinkFilter($a_val)
Add internal links filter.
getEnableUserLinks()
Get enable user links.
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.
setPreventRteUsage($a_val)
Set prevent rte usage.
setEnablePermissionChecks($a_val)
Set enable permission checks.
getEnableInternalLinks()
Get Enable internal links.