ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSelfEvaluationSimpleTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 {
15  protected $ctrl;
16 
20  protected $access;
21 
25  protected $user;
26 
27 
31  public function __construct(
32  $a_parent_obj,
33  $a_parent_cmd,
34  $a_top_skill_id,
35  $a_tref_id,
36  $a_basic_skill_id
37  ) {
38  global $DIC;
39 
40  $this->ctrl = $DIC->ctrl();
41  $this->lng = $DIC->language();
42  $this->access = $DIC->access();
43  $this->user = $DIC->user();
44 
45  $ilCtrl = $DIC->ctrl();
46  $lng = $DIC->language();
47  $ilUser = $DIC->user();
48 
49  $this->top_skill_id = $a_top_skill_id;
50  $this->tref_id = (int) $a_tref_id;
51  $this->basic_skill_id = $a_basic_skill_id;
52 
53  $this->cur_level_id = ilPersonalSkill::getSelfEvaluation(
54  $ilUser->getId(),
55  $this->top_skill_id,
56  $this->tref_id,
57  $this->basic_skill_id
58  );
59 
60  // build title
61  $stree = new ilSkillTree();
62  $path = $stree->getPathFull($this->basic_skill_id);
63  $title = $sep = "";
64  foreach ($path as $p) {
65  if ($p["type"] != "skrt") {
66  $title .= $sep . $p["title"];
67  $sep = " > ";
68  }
69  }
70 
71  parent::__construct($a_parent_obj, $a_parent_cmd);
72  $this->setData($this->getLevels());
73  $this->setTitle($title);
74  $this->setLimit(9999);
75 
76  $this->addColumn("", "", "", true);
77  $this->addColumn($this->lng->txt("skmg_skill_level"));
78  $this->addColumn($this->lng->txt("description"));
79 
80  $this->setEnableHeader(true);
81  $this->setRowTemplate("tpl.simple_self_eval.html", "Services/Skill");
82  $this->disable("footer");
83  $this->setEnableTitle(true);
84 
85  $this->addCommandButton(
86  "saveSelfEvaluation",
87  $lng->txt("save")
88  );
89  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
90  }
91 
98  public function getLevels()
99  {
100  $lng = $this->lng;
101 
102  $this->skill = ilSkillTreeNodeFactory::getInstance($this->basic_skill_id);
103  $levels[] = array("id" => 0, "description" => $lng->txt("skmg_no_skills"));
104  foreach ($this->skill->getLevelData() as $k => $v) {
105  $levels[] = $v;
106  }
107 
108  return $levels;
109  }
110 
114  protected function fillRow($a_set)
115  {
116  if ($this->cur_level_id == $a_set["id"]) {
117  $this->tpl->setVariable("CHECKED", "checked='checked'");
118  }
119 
120  $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
121  $this->tpl->setVariable("SKILL_ID", $this->basic_skill_id);
122  $this->tpl->setVariable("TXT_SKILL", $a_set["title"]);
123  $this->tpl->setVariable("TXT_SKILL_DESC", $a_set["description"]);
124  }
125 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
Skill tree.
user()
Definition: user.php:4
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Self evaluation, second simplier implementation.
global $DIC
Definition: goto.php:24
__construct( $a_parent_obj, $a_parent_cmd, $a_top_skill_id, $a_tref_id, $a_basic_skill_id)
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static getSelfEvaluation($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill)
Get self evaluation.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
__construct(Container $dic, ilPlugin $plugin)
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.
$ilUser
Definition: imgupload.php:18
setEnableTitle($a_enabletitle)
Set Enable Title.
setLimit($a_limit=0, $a_default_limit=0)