ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSkillUsageTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/Table/classes/class.ilTable2GUI.php");
6
16{
20 protected $ctrl;
21
25 protected $access;
26
27
31 public function __construct($a_parent_obj, $a_parent_cmd, $a_cskill_id, $a_usage)
32 {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $this->access = $DIC->access();
38 $ilCtrl = $DIC->ctrl();
39 $lng = $DIC->language();
40 $ilAccess = $DIC->access();
41 $lng = $DIC->language();
42
43 $id_parts = explode(":", $a_cskill_id);
44 $this->skill_id = $id_parts[0];
45 $this->tref_id = $id_parts[1];
46
47 $data = array();
48 foreach ($a_usage as $k => $v) {
49 $data[] = array("type" => $k, "usages" => $v);
50 }
51
52 parent::__construct($a_parent_obj, $a_parent_cmd);
53 $this->setData($data);
54 $this->setTitle(ilSkillTreeNode::_lookupTitle($this->skill_id, $this->tref_id));
55
56 include_once("./Services/Skill/classes/class.ilSkillTree.php");
57 $tree = new ilSkillTree();
58 $path = $tree->getSkillTreePathAsString($this->skill_id, $this->tref_id);
59 $this->setDescription($path);
60
61 $this->addColumn($this->lng->txt("skmg_type"), "", "50%");
62 $this->addColumn($this->lng->txt("skmg_number"), "", "50%");
63
64 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
65 $this->setRowTemplate("tpl.skill_usage_row.html", "Services/Skill");
66 $this->setEnableNumInfo(false);
67
68 // $this->addMultiCommand("", $lng->txt(""));
69// $this->addCommandButton("", $lng->txt(""));
70 }
71
72
76 protected function fillRow($a_set)
77 {
79 //var_dump($a_set);
80 $this->tpl->setVariable("TYPE_INFO", ilSkillUsage::getTypeInfoString($a_set["type"]));
81 $this->tpl->setVariable("NUMBER", count($a_set["usages"]));
82 $this->tpl->setVariable("OBJ_TYPE", ilSkillUsage::getObjTypeString($a_set["type"]));
83 }
84}
$path
Definition: aliased.php:25
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 $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7