ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilContSkillTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
30 {
34  protected $tpl;
36 
37  public function __construct(
38  $a_parent_obj,
39  string $a_parent_cmd,
40  ilContainer $cont_obj
41  ) {
42  global $DIC;
43 
44  $this->ctrl = $DIC->ctrl();
45  $this->lng = $DIC->language();
46  $this->tpl = $DIC["tpl"];
47 
48  $this->cont_skill_manager = $DIC->skills()->internalContainer()->manager()->getSkillManager(
49  $cont_obj->getId(),
50  $cont_obj->getRefId()
51  );
52 
53  parent::__construct($a_parent_obj, $a_parent_cmd);
54  $this->setData($this->getSkills());
55  $this->setTitle($this->lng->txt("cont_cont_skills"));
56 
57  $this->addColumn("", "", "1", true);
58  $this->addColumn($this->lng->txt("cont_skill"), "", "1");
59  $this->addColumn($this->lng->txt("cont_path"), "", "1");
60  $this->addColumn($this->lng->txt("cont_skill_profile"), "", "1");
61 
62  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
63  $this->setRowTemplate("tpl.cont_skill_row.html", "Services/Container/Skills");
64  $this->setSelectAllCheckbox("id");
65 
66  $this->addMultiCommand("confirmRemoveSelectedSkill", $this->lng->txt("remove"));
67  //$this->addCommandButton("", $lng->txt(""));
68  }
69 
70  public function getSkills(): array
71  {
72  $skills = $this->cont_skill_manager->getSkillsForTableGUI();
73 
74  return $skills;
75  }
76 
77  protected function fillRow(array $a_set): void
78  {
79  $tpl = $this->tpl;
80 
81  $tpl->setVariable("TITLE", $a_set["title"]);
82 
83  $path = $this->getParentObject()->getPathString($a_set["base_skill_id"], $a_set["tref_id"]);
84  $tpl->setVariable("PATH", $path);
85 
86  if (isset($a_set["profile_title"])) {
87  $tpl->setVariable("PROFILE", $a_set["profile_title"]);
88  } else {
89  $tpl->setCurrentBlock("checkbox");
90  $tpl->setVariable("ID", $a_set["base_skill_id"] . ":" . $a_set["tref_id"]);
91  $tpl->parseCurrentBlock();
92  }
93  }
94 }
setData(array $a_data)
setFormAction(string $a_form_action, bool $a_multipart=false)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
TableGUI class for competences in containers.
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
__construct( $a_parent_obj, string $a_parent_cmd, ilContainer $cont_obj)
__construct(VocabulariesInterface $vocabularies)
ContainerSkillManager $cont_skill_manager
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
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="")
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)
addMultiCommand(string $a_cmd, string $a_text)