ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
17 
21  function __construct($a_parent_obj, $a_parent_cmd, $a_cskill_id, $a_usage)
22  {
23  global $ilCtrl, $lng, $ilAccess, $lng;
24 
25  $id_parts = explode(":", $a_cskill_id);
26  $this->skill_id = $id_parts[0];
27  $this->tref_id = $id_parts[1];
28 
29  $data = array();
30  foreach ($a_usage as $k => $v)
31  {
32  $data[] = array("type" => $k, "usages" => $v);
33  }
34 
35  parent::__construct($a_parent_obj, $a_parent_cmd);
36  $this->setData($data);
37  $this->setTitle(ilSkillTreeNode::_lookupTitle($this->skill_id, $this->tref_id));
38 
39  include_once("./Services/Skill/classes/class.ilSkillTree.php");
40  $tree = new ilSkillTree();
41  $path = $tree->getSkillTreePathAsString($this->skill_id, $this->tref_id);
42  $this->setDescription($path);
43 
44  $this->addColumn($this->lng->txt("skmg_type"), "", "50%");
45  $this->addColumn($this->lng->txt("skmg_number"), "", "50%");
46 
47  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
48  $this->setRowTemplate("tpl.skill_usage_row.html", "Services/Skill");
49  $this->setEnableNumInfo(false);
50 
51 // $this->addMultiCommand("", $lng->txt(""));
52 // $this->addCommandButton("", $lng->txt(""));
53  }
54 
55 
59  protected function fillRow($a_set)
60  {
61  global $lng;
62 //var_dump($a_set);
63  $this->tpl->setVariable("TYPE_INFO", ilSkillUsage::getTypeInfoString($a_set["type"]));
64  $this->tpl->setVariable("NUMBER", count($a_set["usages"]));
65  $this->tpl->setVariable("OBJ_TYPE", ilSkillUsage::getObjTypeString($a_set["type"]));
66  }
67 
68 }
69 ?>