5 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
6 include_once(
"./Services/Link/classes/class.ilLink.php");
22 function __construct($a_skill_id, $a_parent_obj, $a_parent_cmd, $a_tref_id = 0)
26 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
27 $this->skill_id = $a_skill_id;
29 $this->tref_id = $a_tref_id;
34 $this->
setTitle($lng->txt(
"skmg_skill_levels"));
35 if ($this->tref_id == 0)
37 $this->
setDescription($lng->txt(
"skmg_from_lower_to_higher_levels"));
40 if ($this->tref_id == 0)
43 $this->
addColumn($this->lng->txt(
"skmg_nr"));
45 $this->
addColumn($this->lng->txt(
"title"));
46 $this->
addColumn($this->lng->txt(
"description"));
49 $this->
addColumn($this->lng->txt(
"resources"));
50 $this->
addColumn($this->lng->txt(
"actions"));
56 $this->
setRowTemplate(
"tpl.skill_level_row.html",
"Services/Skill");
59 if ($this->tref_id == 0)
62 if (count($this->
getData()) > 0)
91 $levels = $this->skill->getLevelData();
95 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
97 foreach($resources->getResources() as $level_id => $item)
99 $res[$level_id] = array_keys($item);
102 foreach($levels as $idx => $item)
104 $levels[$idx][
"ressources"] =
$res[$item[
"id"]];
117 if ($this->tref_id == 0)
119 $this->tpl->setCurrentBlock(
"cb");
120 $this->tpl->setVariable(
"CB_ID", $a_set[
"id"]);
121 $this->tpl->parseCurrentBlock();
123 $this->tpl->setCurrentBlock(
"nr");
124 $this->tpl->setVariable(
"ORD_ID", $a_set[
"id"]);
125 $this->tpl->setVariable(
"VAL_NR", ((
int) $a_set[
"nr"]) * 10);
126 $this->tpl->parseCurrentBlock();
130 $this->tpl->setCurrentBlock(
"cmd");
131 $this->tpl->setVariable(
"TXT_CMD", $lng->txt(
"edit"));
132 $ilCtrl->setParameter($this->parent_obj,
"level_id", $a_set[
"id"]);
133 if ($this->tref_id == 0)
135 $this->tpl->setVariable(
"HREF_CMD",
136 $ilCtrl->getLinkTarget($this->parent_obj,
"editLevel"));
140 $this->tpl->setVariable(
"HREF_CMD",
141 $ilCtrl->getLinkTarget($this->parent_obj,
"showLevelResources"));
143 $this->tpl->parseCurrentBlock();
145 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
146 $this->tpl->setVariable(
"TXT_DESCRIPTION", $a_set[
"description"]);
167 if(is_array($a_set[
"ressources"]))
169 $this->tpl->setCurrentBlock(
"ressource_bl");
170 foreach($a_set[
"ressources"] as $rref_id)
176 $this->tpl->parseCurrentBlock();