ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSkillProfileLevelsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
20  protected $ctrl;
21 
25  protected $access;
26 
30  public function __construct($a_parent_obj, $a_parent_cmd, $a_profile, $a_write_permission = false)
31  {
32  global $DIC;
33 
34  $this->ctrl = $DIC->ctrl();
35  $this->lng = $DIC->language();
36  $this->access = $DIC->access();
37  $ilCtrl = $DIC->ctrl();
38  $lng = $DIC->language();
39  $ilAccess = $DIC->access();
40  $lng = $DIC->language();
41 
42  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
43  include_once("./Services/Skill/classes/class.ilSkillTree.php");
44  $this->tree = new ilSkillTree();
45 
46  $this->profile = $a_profile;
47  parent::__construct($a_parent_obj, $a_parent_cmd);
48 
49  $this->setData($this->profile->getSkillLevels());
50  $this->setTitle($lng->txt("skmg_skill_levels"));
51 
52  $this->addColumn("", "", "1", true);
53  $this->addColumn($this->lng->txt("skmg_skill"));
54  $this->addColumn($this->lng->txt("skmg_level"));
55 
56  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
57  $this->setRowTemplate("tpl.skill_profile_level_row.html", "Services/Skill");
58 
59  if ($a_write_permission) {
60  $this->addMultiCommand("confirmLevelAssignmentRemoval", $lng->txt("skmg_remove_levels"));
61  }
62  //$this->addCommandButton("", $lng->txt(""));
63  }
64 
68  protected function fillRow($a_set)
69  {
70  $path = $this->tree->getSkillTreePath(
71  $a_set["base_skill_id"],
72  $a_set["tref_id"]
73  );
74  $path_items = array();
75  foreach ($path as $p) {
76  if ($p["type"] != "skrt") {
77  $path_items[] = $p["title"];
78  }
79  }
80  $this->tpl->setVariable(
81  "SKILL_TITLE",
82  implode($path_items, " > ")
83  );
84 
85  $this->tpl->setVariable("LEVEL_TITLE", ilBasicSkill::lookupLevelTitle($a_set["level_id"]));
86 
87  $this->tpl->setVariable(
88  "ID",
89  ((int) $a_set["base_skill_id"]) . ":" . ((int) $a_set["tref_id"]) . ":" . ((int) $a_set["level_id"])
90  );
91  }
92 }
TableGUI class for skill profile levels.
$path
Definition: aliased.php:25
global $DIC
Definition: saml.php:7
static lookupLevelTitle($a_id)
Lookup level title.
Skill tree.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
__construct($a_parent_obj, $a_parent_cmd, $a_profile, $a_write_permission=false)
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.