ILIAS  release_8 Revision v8.24
class.ilContSkillTableGUI.php
Go to the documentation of this file.
1<?php
2
26{
30 protected $tpl;
35
36 public function __construct(
37 $a_parent_obj,
38 string $a_parent_cmd,
39 ilContainerSkills $a_cont_skills,
40 ilContainerGlobalProfiles $a_cont_glb_profiles,
41 ilContainerLocalProfiles $a_cont_lcl_profiles
42 ) {
43 global $DIC;
44
45 $this->ctrl = $DIC->ctrl();
46 $this->lng = $DIC->language();
47 $this->tpl = $DIC["tpl"];
48
49 $this->container_skills = $a_cont_skills;
50 $this->container_global_profiles = $a_cont_glb_profiles;
51 $this->container_local_profiles = $a_cont_lcl_profiles;
52
53 $this->container_skill_collector = new ilContSkillCollector(
54 $this->container_skills,
55 $this->container_global_profiles,
56 $this->container_local_profiles
57 );
58
59 parent::__construct($a_parent_obj, $a_parent_cmd);
60 $this->setData($this->getSkills());
61 $this->setTitle($this->lng->txt("cont_cont_skills"));
62
63 $this->addColumn("", "", "1", true);
64 $this->addColumn($this->lng->txt("cont_skill"), "", "1");
65 $this->addColumn($this->lng->txt("cont_path"), "", "1");
66 $this->addColumn($this->lng->txt("cont_skill_profile"), "", "1");
67
68 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
69 $this->setRowTemplate("tpl.cont_skill_row.html", "Services/Container/Skills");
70 $this->setSelectAllCheckbox("id");
71
72 $this->addMultiCommand("confirmRemoveSelectedSkill", $this->lng->txt("remove"));
73 //$this->addCommandButton("", $lng->txt(""));
74 }
75
76 public function getSkills(): array
77 {
78 $skills = $this->container_skill_collector->getSkillsForTableGUI();
79
80 return $skills;
81 }
82
83 protected function fillRow(array $a_set): void
84 {
86
87 $tpl->setVariable("TITLE", $a_set["title"]);
88
89 $path = $this->getParentObject()->getPathString($a_set["base_skill_id"], $a_set["tref_id"]);
90 $tpl->setVariable("PATH", $path);
91
92 if (isset($a_set["profile"])) {
93 $tpl->setVariable("PROFILE", $a_set["profile"]);
94 } else {
95 $tpl->setCurrentBlock("checkbox");
96 $tpl->setVariable("ID", $a_set["base_skill_id"] . ":" . $a_set["tref_id"]);
97 $tpl->parseCurrentBlock();
98 }
99 }
100}
Collector of skills for a container.
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, ilContainerSkills $a_cont_skills, ilContainerGlobalProfiles $a_cont_glb_profiles, ilContainerLocalProfiles $a_cont_lcl_profiles)
fillRow(array $a_set)
Standard Version of Fill Row.
ilContainerGlobalProfiles $container_global_profiles
ilContainerLocalProfiles $container_local_profiles
ilContSkillCollector $container_skill_collector
ilContainerSkills $container_skills
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...
Skills of a container.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addMultiCommand(string $a_cmd, string $a_text)
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)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
global $DIC
Definition: feed.php:28
$path
Definition: ltiservices.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc