ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSkillUsageTableGUI.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
22
26 public function __construct($a_parent_obj, $a_parent_cmd, $a_cskill_id, $a_usage)
27 {
28 global $DIC;
29
30 $this->ctrl = $DIC->ctrl();
31 $this->lng = $DIC->language();
32 $this->access = $DIC->access();
33 $ilCtrl = $DIC->ctrl();
34 $lng = $DIC->language();
35 $ilAccess = $DIC->access();
36 $lng = $DIC->language();
37
38 $id_parts = explode(":", $a_cskill_id);
39 $this->skill_id = $id_parts[0];
40 $this->tref_id = $id_parts[1];
41
42 $data = array();
43 foreach ($a_usage as $k => $v) {
44 $data[] = array("type" => $k, "usages" => $v);
45 }
46
47 parent::__construct($a_parent_obj, $a_parent_cmd);
48 $this->setData($data);
49 $this->setTitle(ilSkillTreeNode::_lookupTitle($this->skill_id, $this->tref_id));
50
51 $tree = new ilSkillTree();
52 $path = $tree->getSkillTreePathAsString($this->skill_id, $this->tref_id);
53 $this->setDescription($path);
54
55 $this->addColumn($this->lng->txt("skmg_type"), "", "50%");
56 $this->addColumn($this->lng->txt("skmg_number"), "", "50%");
57
58 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
59 $this->setRowTemplate("tpl.skill_usage_row.html", "Services/Skill");
60 $this->setEnableNumInfo(false);
61
62 // $this->addMultiCommand("", $lng->txt(""));
63// $this->addCommandButton("", $lng->txt(""));
64 }
65
66
70 protected function fillRow($a_set)
71 {
73 //var_dump($a_set);
74 $this->tpl->setVariable("TYPE_INFO", ilSkillUsage::getTypeInfoString($a_set["type"]));
75 $this->tpl->setVariable("NUMBER", count($a_set["usages"]));
76 $this->tpl->setVariable("OBJ_TYPE", ilSkillUsage::getObjTypeString($a_set["type"]));
77 }
78}
An exception for terminatinating execution or to throw for unit testing.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
TableGUI class for skill usages.
fillRow($a_set)
Fill table row.
__construct($a_parent_obj, $a_parent_cmd, $a_cskill_id, $a_usage)
Constructor.
static getTypeInfoString($a_type)
Get type info string.
static getObjTypeString($a_type)
Get type info string.
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableNumInfo($a_val)
Set enable num info.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setDescription($a_val)
Set description.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc