ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTestSkillLevelThresholdImportFails.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
15  protected $settings;
16 
20  protected $parentObjId;
21 
26  public function __construct($parentObjId)
27  {
28  $this->parentObjId = $parentObjId;
29  }
30 
34  protected function getSettings()
35  {
36  if( $this->settings === null )
37  {
38  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionAssignedSkillList.php';
39 
40  $this->settings = new ilSetting('assimportfails');
41  }
42 
43  return $this->settings;
44  }
45 
49  protected function getParentObjId()
50  {
51  return $this->parentObjId;
52  }
53 
57  protected function buildSettingsKey()
58  {
59  return 'failed_imp_slt_parentobj_'.$this->getParentObjId();
60  }
61 
65  public function getFailedImports()
66  {
67  $value = $this->getSettings()->get($this->buildSettingsKey(), null);
68 
69  if( $value !== null )
70  {
71  return unserialize($value);
72  }
73 
74  return null;
75  }
76 
81  {
82  $this->getSettings()->set($this->buildSettingsKey(), serialize($skillList));
83  }
84 
87  public function deleteRegisteredImportFails()
88  {
89  $this->getSettings()->delete($this->buildSettingsKey());
90  }
91 
95  public function failedImportsRegistered()
96  {
97  return $this->getFailedImports() !== null;
98  }
99 
105  {
106  require_once 'Services/Skill/classes/class.ilBasicSkill.php';
107 
108  $msg = $lng->txt('tst_failed_imp_skl_thresholds');
109 
110  $msg .= '<ul>';
111  foreach($this->getFailedImports() as $skillKey)
112  {
113  list($skillBaseId, $skillTrefId) = explode(':', $skillKey);
114  $skillTitle = ilBasicSkill::_lookupTitle($skillBaseId, $skillTrefId);
115 
116  $msg .= '<li>'.$skillTitle.'</li>';
117  }
118  $msg .= '</ul>';
119 
120  return $msg;
121  }
122 }
ILIAS Setting Class.
registerFailedImports(ilAssQuestionAssignedSkillList $skillList)
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
__construct($parentObjId)
ilTestSkillLevelThresholdImportFails constructor.
settings()
Definition: settings.php:2
global $lng
Definition: privfeed.php:17
language handling
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...