ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSkillProfileLevelsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 {
15  protected $ctrl;
16 
20  protected $access;
21 
25  public function __construct($a_parent_obj, $a_parent_cmd, $a_profile, $a_write_permission = false)
26  {
27  global $DIC;
28 
29  $this->ctrl = $DIC->ctrl();
30  $this->lng = $DIC->language();
31  $this->access = $DIC->access();
32  $ilCtrl = $DIC->ctrl();
33  $lng = $DIC->language();
34 
35  $this->tree = new ilSkillTree();
36 
37  $this->profile = $a_profile;
38  parent::__construct($a_parent_obj, $a_parent_cmd);
39 
40  $this->setData($this->profile->getSkillLevels());
41  $this->setTitle($lng->txt("skmg_target_levels"));
42 
43  $this->addColumn("", "", "1", true);
44  $this->addColumn($this->lng->txt("skmg_order"), "", "1px");
45  $this->addColumn($this->lng->txt("skmg_skill"));
46  $this->addColumn($this->lng->txt("skmg_level"));
47 
48  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
49  $this->setRowTemplate("tpl.skill_profile_level_row.html", "Services/Skill");
50 
51  if ($a_write_permission) {
52  $this->addMultiCommand("confirmLevelAssignmentRemoval", $lng->txt("skmg_remove_levels"));
53  }
54  if (count($this->profile->getSkillLevels()) > 0) {
55  $this->addCommandButton("saveLevelOrder", $lng->txt("skmg_save_order"));
56  }
57  }
58 
62  protected function fillRow($a_set)
63  {
64  $path = $this->tree->getSkillTreePath(
65  $a_set["base_skill_id"],
66  $a_set["tref_id"]
67  );
68  $path_items = array();
69  foreach ($path as $p) {
70  if ($p["type"] != "skrt") {
71  $path_items[] = $p["title"];
72  }
73  }
74  $this->tpl->setVariable(
75  "SKILL_TITLE",
76  implode(" > ", $path_items)
77  );
78 
79  $this->tpl->setVariable("LEVEL_TITLE", ilBasicSkill::lookupLevelTitle($a_set["level_id"]));
80 
81  $this->tpl->setVariable(
82  "ID",
83  ((int) $a_set["base_skill_id"]) . ":" . ((int) $a_set["tref_id"]) . ":" . ((int) $a_set["level_id"]) .
84  ":" . ((int) $a_set["order_nr"])
85  );
86 
87  $this->tpl->setVariable("SKILL_ID", (int) $a_set["base_skill_id"]);
88  $this->tpl->setVariable("TREF_ID", (int) $a_set["tref_id"]);
89  $this->tpl->setVariable("ORDER_NR", (int) $a_set["order_nr"]);
90  }
91 }
TableGUI class for skill profile levels.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
Skill tree.
static lookupLevelTitle(int $a_id)
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
global $DIC
Definition: goto.php:24
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.
__construct(Container $dic, ilPlugin $plugin)
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.