ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSkillLevelTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 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_skill_id, $a_parent_obj, $a_parent_cmd)
22  {
23  global $ilCtrl, $lng, $ilAccess, $lng;
24 
25  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
26  $this->skill_id = $a_skill_id;
27  $this->skill = new ilBasicSkill($a_skill_id);
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30  $this->setLimit(9999);
31  $this->setData($this->getSkillLevelData());
32  $this->setTitle($lng->txt("skmg_skill_levels"));
33  $this->setDescription($lng->txt("skmg_from_lower_to_higher_levels"));
34 
35  $this->addColumn("", "", "1", true);
36  $this->addColumn($this->lng->txt("skmg_nr"));
37  $this->addColumn($this->lng->txt("title"));
38  $this->addColumn($this->lng->txt("description"));
39 // $this->addColumn($this->lng->txt("skmg_trigger"));
40 // $this->addColumn($this->lng->txt("skmg_certificate"));
41  $this->addColumn($this->lng->txt("actions"));
42  $this->setDefaultOrderField("nr");
43  $this->setDefaultOrderDirection("asc");
44 
45  $this->setEnableHeader(true);
46  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
47  $this->setRowTemplate("tpl.skill_level_row.html", "Services/Skill");
48  $this->setEnableTitle(true);
49 
50  $this->addMultiCommand("confirmLevelDeletion", $lng->txt("delete"));
51  if (count($this->getData()) > 0)
52  {
53  $this->addCommandButton("updateLevelOrder", $lng->txt("skmg_update_order"));
54  }
55  }
56 
62  function numericOrdering($a_field)
63  {
64  if ($a_field == "nr")
65  {
66  return true;
67  }
68  return false;
69  }
70 
77  function getSkillLevelData()
78  {
79  $levels = $this->skill->getLevelData();
80  return $levels;
81  }
82 
86  protected function fillRow($a_set)
87  {
88  global $lng, $ilCtrl;
89 
90  $this->tpl->setCurrentBlock("cmd");
91  $this->tpl->setVariable("TXT_CMD", $lng->txt("edit"));
92  $ilCtrl->setParameter($this->parent_obj, "level_id", $a_set["id"]);
93  $this->tpl->setVariable("HREF_CMD",
94  $ilCtrl->getLinkTarget($this->parent_obj, "editLevel"));
95  $this->tpl->parseCurrentBlock();
96 
97  $this->tpl->setVariable("ID", $a_set["id"]);
98  $this->tpl->setVariable("VAL_NR", ((int) $a_set["nr"]) * 10);
99  $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
100  $this->tpl->setVariable("TXT_DESCRIPTION", $a_set["description"]);
101 /* $this->tpl->setVariable("TXT_CERTIFICATE",
102  ilBasicSkill::_lookupCertificate($this->skill->getId(),
103  $a_set["id"])
104  ? $lng->txt("yes")
105  : $lng->txt("no"));*/
106 
107 /* $trigger = ilBasicSkill::lookupLevelTrigger((int) $a_set["id"]);
108  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
109  ilObject::_isInTrash($trigger["ref_id"]))
110  {
111  $trigger = array();
112  }
113 
114  // trigger
115  if ($trigger["obj_id"] > 0)
116  {
117  $this->tpl->setVariable("TXT_TRIGGER",
118  ilObject::_lookupTitle($trigger["obj_id"]));
119  }*/
120  }
121 
122 }
123 ?>