ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilContSkillTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/Table/classes/class.ilTable2GUI.php");
6
15{
19 protected $ctrl;
20
24 protected $lng;
25
29 protected $tpl;
30
35
40
45
50
54 public function __construct(
55 $a_parent_obj,
56 $a_parent_cmd,
57 ilContainerSkills $a_cont_skills,
58 ilContainerGlobalProfiles $a_cont_glb_profiles,
59 ilContainerLocalProfiles $a_cont_lcl_profiles
60 ) {
61 global $DIC;
62
63 $this->ctrl = $DIC->ctrl();
64 $this->lng = $DIC->language();
65 $this->tpl = $DIC["tpl"];
66
67 $this->skill_tree = new ilSkillTree();
68
69 $this->container_skills = $a_cont_skills;
70 $this->container_global_profiles = $a_cont_glb_profiles;
71 $this->container_local_profiles = $a_cont_lcl_profiles;
72
73 $this->container_skill_collector = new ilContSkillCollector(
74 $this->container_skills,
75 $this->container_global_profiles,
76 $this->container_local_profiles
77 );
78
79 parent::__construct($a_parent_obj, $a_parent_cmd);
80 $this->setData($this->getSkills());
81 $this->setTitle($this->lng->txt("cont_cont_skills"));
82
83 $this->addColumn("", "", "1", true);
84 $this->addColumn($this->lng->txt("cont_skill"), "", "1");
85 $this->addColumn($this->lng->txt("cont_path"), "", "1");
86 $this->addColumn($this->lng->txt("cont_skill_profile"), "", "1");
87
88 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
89 $this->setRowTemplate("tpl.cont_skill_row.html", "Services/Container/Skills");
90 $this->setSelectAllCheckbox("id");
91
92 $this->addMultiCommand("confirmRemoveSelectedSkill", $this->lng->txt("remove"));
93 //$this->addCommandButton("", $lng->txt(""));
94 }
95
102 public function getSkills()
103 {
104 $skills = $this->container_skill_collector->getSkillsForTableGUI();
105
106 return $skills;
107 }
108
109
113 protected function fillRow($a_set)
114 {
116 $skill_tree = $this->skill_tree;
117
118 $tpl->setVariable("TITLE", $a_set["title"]);
119
120 $path = $this->getParentObject()->getPathString($a_set["base_skill_id"], $a_set["tref_id"]);
121 $tpl->setVariable("PATH", $path);
122
123 if ($a_set["profile"] != null) {
124 $tpl->setVariable("PROFILE", $a_set["profile"]);
125 } else {
126 $tpl->setCurrentBlock("checkbox");
127 $tpl->setVariable("ID", $a_set["base_skill_id"] . ":" . $a_set["tref_id"]);
128 $tpl->parseCurrentBlock();
129 }
130 }
131}
An exception for terminatinating execution or to throw for unit testing.
Collector of skills for a container.
TableGUI class for competences in containers.
__construct( $a_parent_obj, $a_parent_cmd, ilContainerSkills $a_cont_skills, ilContainerGlobalProfiles $a_cont_glb_profiles, ilContainerLocalProfiles $a_cont_lcl_profiles)
Constructor.
fillRow($a_set)
Fill table row.
Global competence profiles of a container.
Local competence profiles of a container.
Skills of a container.
Class ilTable2GUI.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc