ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSkillSelfEvalSkillTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
19  protected $ctrl;
20 
24  protected $access;
25 
26 
30  public function __construct($a_parent_obj, $a_parent_cmd, $a_sn_id, $a_se = null)
31  {
32  global $DIC;
33 
34  $this->ctrl = $DIC->ctrl();
35  $this->lng = $DIC->language();
36  $this->access = $DIC->access();
37  $ilCtrl = $DIC->ctrl();
38  $lng = $DIC->language();
39  $ilAccess = $DIC->access();
40  $lng = $DIC->language();
41 
42  $this->sn_id = $a_sn_id;
43  if ($a_se != null) {
44  $this->se = $a_se;
45  $this->levels = $this->se->getLevels();
46  }
47 
48  // build title
49  include_once("./Services/Skill/classes/class.ilSkillTree.php");
50  $stree = new ilSkillTree();
51  $path = $stree->getPathFull($this->sn_id);
52  $title = $sep = "";
53  foreach ($path as $p) {
54  if ($p["type"] != "skrt") {
55  $title.= $sep . $p["title"];
56  $sep = " > ";
57  }
58  }
59 
60  parent::__construct($a_parent_obj, $a_parent_cmd);
61  $this->setData($this->getLevels());
62  $this->setTitle($title);
63  $this->setLimit(9999);
64 
65  $this->addColumn($this->lng->txt("skmg_your_self_evaluation"));
66  $this->addColumn($this->lng->txt("skmg_skill_level"));
67 
68  $this->setEnableHeader(true);
69  // $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
70  $this->setRowTemplate("tpl.self_eval_row.html", "Services/Skill");
71  $this->disable("footer");
72  $this->setEnableTitle(true);
73 
74  // $this->addMultiCommand("", $lng->txt(""));
75 // $this->addCommandButton("", $lng->txt(""));
76  }
77 
84  public function getLevels()
85  {
86  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
87  $this->skill = new ilBasicSkill($this->sn_id);
88  $levels = array(array("id" => 0));
89  foreach ($this->skill->getLevelData() as $k => $v) {
90  $levels[] = $v;
91  }
92 
93  return $levels;
94  }
95 
99  protected function fillRow($a_set)
100  {
101  $lng = $this->lng;
102 
103  //var_dump($a_set);
104  if ($a_set["id"] == 0) {
105  $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
106  $this->tpl->setVariable("SKILL_ID", $this->sn_id);
107  $this->tpl->setVariable("TXT_SKILL", $lng->txt("skmg_no_skills"));
108  } else {
109  $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
110  $this->tpl->setVariable("SKILL_ID", $this->sn_id);
111  $this->tpl->setVariable("TXT_SKILL", $a_set["title"] . ": " . $a_set["description"]);
112  }
113 
114  if ($this->se != null) {
115  if ($this->levels[$this->sn_id] == $a_set["id"]) {
116  $this->tpl->setVariable("CHECKED", " checked='checked' ");
117  }
118  } else {
119  if ($a_set["id"] == 0) {
120  $this->tpl->setVariable("CHECKED", " checked='checked' ");
121  }
122  }
123  }
124 }
global $DIC
Definition: saml.php:7
Skill tree.
__construct($a_parent_obj, $a_parent_cmd, $a_sn_id, $a_se=null)
Constructor.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
Self evaluation table for single skill.
disable($a_module_name)
diesables particular modules of table
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.
setEnableHeader($a_enableheader)
Set Enable Header.
setEnableTitle($a_enabletitle)
Set Enable Title.
Basic Skill.
setLimit($a_limit=0, $a_default_limit=0)