ILIAS  Release_4_2_x_branch Revision 61807
 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  $this->addCommandButton("updateLevelOrder", $lng->txt("skmg_update_order"));
52  }
53 
59  function numericOrdering($a_field)
60  {
61  if ($a_field == "nr")
62  {
63  return true;
64  }
65  return false;
66  }
67 
74  function getSkillLevelData()
75  {
76  $levels = $this->skill->getLevelData();
77  return $levels;
78  }
79 
83  protected function fillRow($a_set)
84  {
85  global $lng, $ilCtrl;
86 
87  $this->tpl->setCurrentBlock("cmd");
88  $this->tpl->setVariable("TXT_CMD", $lng->txt("edit"));
89  $ilCtrl->setParameter($this->parent_obj, "level_id", $a_set["id"]);
90  $this->tpl->setVariable("HREF_CMD",
91  $ilCtrl->getLinkTarget($this->parent_obj, "editLevel"));
92  $this->tpl->parseCurrentBlock();
93 
94  $this->tpl->setVariable("ID", $a_set["id"]);
95  $this->tpl->setVariable("VAL_NR", ((int) $a_set["nr"]) * 10);
96  $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
97  $this->tpl->setVariable("TXT_DESCRIPTION", $a_set["description"]);
98 /* $this->tpl->setVariable("TXT_CERTIFICATE",
99  ilBasicSkill::_lookupCertificate($this->skill->getId(),
100  $a_set["id"])
101  ? $lng->txt("yes")
102  : $lng->txt("no"));*/
103 
104 /* $trigger = ilBasicSkill::lookupLevelTrigger((int) $a_set["id"]);
105  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
106  ilObject::_isInTrash($trigger["ref_id"]))
107  {
108  $trigger = array();
109  }
110 
111  // trigger
112  if ($trigger["obj_id"] > 0)
113  {
114  $this->tpl->setVariable("TXT_TRIGGER",
115  ilObject::_lookupTitle($trigger["obj_id"]));
116  }*/
117  }
118 
119 }
120 ?>