ILIAS  release_8 Revision v8.24
class.ilSelfEvaluationSimpleTableGUI.php
Go to the documentation of this file.
1<?php
2
26{
28 protected ilObjUser $user;
29 protected int $top_skill_id = 0;
30 protected int $tref_id = 0;
31 protected int $basic_skill_id = 0;
32 protected int $cur_level_id = 0;
34
35 public function __construct(
36 $a_parent_obj,
37 string $a_parent_cmd,
38 int $a_top_skill_id,
39 int $a_tref_id,
40 int $a_basic_skill_id
41 ) {
42 global $DIC;
43
44 $this->ctrl = $DIC->ctrl();
45 $this->lng = $DIC->language();
46 $this->access = $DIC->access();
47 $this->user = $DIC->user();
48
49 $ilCtrl = $DIC->ctrl();
50 $lng = $DIC->language();
51 $ilUser = $DIC->user();
52
53 $this->top_skill_id = $a_top_skill_id;
54 $this->tref_id = $a_tref_id;
55 $this->basic_skill_id = $a_basic_skill_id;
56
57 $this->cur_level_id = ilPersonalSkill::getSelfEvaluation(
58 $ilUser->getId(),
59 $this->top_skill_id,
60 $this->tref_id,
61 $this->basic_skill_id
62 );
63
64 // build title
65 $tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
66 $tree_id = $tree_repo->getTreeIdForNodeId($this->basic_skill_id);
67 $node_manager = $DIC->skills()->internal()->manager()->getTreeNodeManager($tree_id);
68 $title = $node_manager->getWrittenPath($this->basic_skill_id);
69
70 parent::__construct($a_parent_obj, $a_parent_cmd);
71 $this->setData($this->getLevels());
72 $this->setTitle($title);
73 $this->setLimit(9999);
74
75 $this->addColumn("", "", "1", true);
76 $this->addColumn($this->lng->txt("skmg_skill_level"));
77 $this->addColumn($this->lng->txt("description"));
78
79 $this->setEnableHeader(true);
80 $this->setRowTemplate("tpl.simple_self_eval.html", "Services/Skill");
81 $this->disable("footer");
82 $this->setEnableTitle(true);
83
84 $this->addCommandButton(
85 "saveSelfEvaluation",
86 $lng->txt("save")
87 );
88 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
89 }
90
91 public function getLevels(): array
92 {
94
95 $this->skill = ilSkillTreeNodeFactory::getInstance($this->basic_skill_id);
96 $levels[] = array("id" => 0, "title" => "", "description" => $lng->txt("skmg_no_skills"));
97 foreach ($this->skill->getLevelData() as $k => $v) {
98 $levels[] = $v;
99 }
100
101 return $levels;
102 }
103
104 protected function fillRow(array $a_set): void
105 {
106 if ($this->cur_level_id == $a_set["id"]) {
107 $this->tpl->setVariable("CHECKED", "checked='checked'");
108 }
109
110 $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
111 $this->tpl->setVariable("SKILL_ID", $this->basic_skill_id);
112 $this->tpl->setVariable("TXT_SKILL", $a_set["title"]);
113 $this->tpl->setVariable("TXT_SKILL_DESC", $a_set["description"]);
114 }
115}
txt(string $a_topic, string $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...
User class.
static getSelfEvaluation(int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct( $a_parent_obj, string $a_parent_cmd, int $a_top_skill_id, int $a_tref_id, int $a_basic_skill_id)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
disable(string $a_module_name)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc