ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPersonalSkillsGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
6 
18 {
19  protected $offline_mode;
20  protected $skill_tree;
21  static $skill_tt_cnt = 1;
22 
28  public function __construct()
29  {
30  global $ilCtrl, $lng;
31 
32  $lng->loadLanguageModule('skmg');
33 
34  $ilCtrl->saveParameter($this, "skill_id");
35  $ilCtrl->saveParameter($this, "tref_id");
36 
37  include_once("./Services/Skill/classes/class.ilSkillTree.php");
38  $this->skill_tree = new ilSkillTree();
39  }
40 
47  public function executeCommand()
48  {
49  global $ilCtrl, $tpl, $lng;
50 
51  $next_class = $ilCtrl->getNextClass($this);
52  $cmd = $ilCtrl->getCmd("listSkills");
53 
54  $tpl->setTitle($lng->txt("skills"));
55  $tpl->setTitleIcon(ilUtil::getImagePath("icon_skmg_b.gif"));
56 
57  switch($next_class)
58  {
59  default:
60  $this->$cmd();
61  break;
62  }
63  return true;
64  }
65 
69  function setTabs($a_activate)
70  {
71  global $ilTabs, $lng, $ilCtrl;
72 
73  // list skills
74  $ilTabs->addTab("list_skills",
75  $lng->txt("skmg_list_skills"),
76  $ilCtrl->getLinkTarget($this, "listSkills"));
77 
78  // assign materials
79 /* $ilTabs->addTab("assign_materials",
80  $lng->txt("skmg_assign_materials"),
81  $ilCtrl->getLinkTarget($this, "assignMaterials"));*/
82 
83  $ilTabs->activateTab($a_activate);
84  }
85 
86  function setOfflineMode($a_file_path)
87  {
88  $this->offline_mode = $a_file_path;
89  }
90 
94  function listSkills()
95  {
96  global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar, $ilUser;
97 
98  $this->setTabs("list_skills");
99 
100  include_once("./Services/Skill/classes/class.ilSkillTree.php");
101  $stree = new ilSkillTree();
102 
103  // skill selection / add new personal skill
104  $ilToolbar->addFormButton($lng->txt("skmg_add_skill"),
105  "listSkillsForAdd");
106  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
107 
108  $skills = ilPersonalSkill::getSelectedUserSkills($ilUser->getId());
109  $html = "";
110  foreach ($skills as $s)
111  {
112  $path = $stree->getSkillTreePath($s["skill_node_id"]);
113 
114  // check draft
115  foreach ($path as $p)
116  {
117  if ($p["draft"])
118  {
119  continue(2);
120  }
121  }
122 
123 
124  $html.= $this->getSkillHTML($s["skill_node_id"], 0, true);
125  }
126 
127  // list skills
128 // include_once("./Services/Skill/classes/class.ilPersonalSkillTableGUI.php");
129 // $sktab = new ilPersonalSkillTableGUI($this, "listSkills");
130 
131  $tpl->setContent($html);
132 
133  }
134 
140  function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit = false)
141  {
142  global $ilUser, $lng, $ilCtrl;
143 
144  $this->tooltips = array();
145 
146  if ($a_user_id == 0)
147  {
148  $user = $ilUser;
149  }
150  else
151  {
152  $user = new ilObjUser($a_user_id);
153  }
154 
155  $tpl = new ilTemplate("tpl.skill_pres.html", true, true, "Services/Skill");
156 
157  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
158 
159  include_once("./Services/Skill/classes/class.ilSkillTree.php");
160  $stree = new ilSkillTree();
161 
162  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
163  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
164 
165  // general settings for the action drop down
166  include_once("Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
167  $act_list = new ilAdvancedSelectionListGUI();
168  $act_list->setListTitle($lng->txt("actions"));
169  $act_list->setSelectionHeaderClass("small");
170 // $act_list->setLinksMode("il_ContainerItemCommand2");
171  $act_list->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
172  $act_list->setUseImages(false);
173 
174  $b_skills = ilSkillTreeNode::getSkillTreeNodes($a_top_skill_id, true);
175  foreach ($b_skills as $bs)
176  {
177  $path = $stree->getSkillTreePath($bs["id"], $bs["tref"]);
178 
179  // check draft
180  foreach ($path as $p)
181  {
182  if ($p["draft"])
183  {
184  continue(2);
185  }
186  }
187  reset($path);
188 
189  $se_level = ilPersonalSkill::getSelfEvaluation($user->getId(),
190  $a_top_skill_id, $bs["tref"], $bs["id"]);
191 
192  $skill = ilSkillTreeNodeFactory::getInstance($bs["id"]);
193  $level_data = $skill->getLevelData();
194 
195  // check, if current self eval level is in current level data
196  $valid_sel_level = false;
197  if ($se_level > 0)
198  {
199  foreach ($level_data as $k => $v)
200  {
201  if ($v["id"] == $se_level)
202  {
203  $valid_sel_level = true;
204  }
205  }
206  }
207  reset($level_data);
208  $found = false;
209  foreach ($level_data as $k => $v)
210  {
211  // level
212  $tpl->setCurrentBlock("level_td");
213  $tpl->setVariable("VAL_LEVEL", $v["title"]);
214  $tt_id = "skmg_skl_tt_".self::$skill_tt_cnt;
215  self::$skill_tt_cnt++;
216  $tpl->setVariable("TT_ID", $tt_id);
217  if ($v["description"] != "")
218  {
219  ilTooltipGUI::addTooltip($tt_id, $v["description"]);
220  }
221  $tpl->parseCurrentBlock();
222 
223  // self evaluation
224  $tpl->setCurrentBlock("self_eval_td");
225  if ($valid_sel_level && !$found)
226  {
227  $tpl->setVariable("VAL_SELF_EVAL", "x");
228  $tpl->setVariable("CLASS_SELF_EVAL", "ilSkillSelf");
229  }
230  else
231  {
232  $tpl->setVariable("VAL_SELF_EVAL", " ");
233  }
234  $tpl->parseCurrentBlock();
235  if ($v["id"] == $se_level)
236  {
237  $found = true;
238  }
239 
240  // assigned materials
241  $mat_cnt = ilPersonalSkill::countAssignedMaterial($user->getId(),
242  $bs["tref"], $v["id"]);
243  if ($mat_cnt == 0)
244  {
245  $tpl->setCurrentBlock("material_td");
246  $tpl->setVariable("VAL_MATERIAL", " ");
247  $tpl->parseCurrentBlock();
248  }
249  else
250  {
251  // links to material files
252  $tpl->setCurrentBlock("material_links");
253 
254  $mat_tt = array();
255  $cnt = 1;
256  foreach(ilPersonalSkill::getAssignedMaterial($user->getId(),
257  $bs["tref"], $v["id"]) as $item)
258  {
259  $mat_data = $this->getMaterialInfo($item["wsp_id"]);
260  $tpl->setVariable("URL_MATERIAL", $mat_data[1]);
261  $tpl->setVariable("TXT_MATERIAL", $cnt);
262 
263  // tooltip
264  $mat_tt_id = "skmg_skl_tt_mat_".self::$skill_tt_cnt;
265  self::$skill_tt_cnt++;
266  $tpl->setVariable("TOOLTIP_MATERIAL_ID", $mat_tt_id);
267 
268  if(!$this->offline_mode)
269  {
270  ilTooltipGUI::addTooltip($mat_tt_id, $mat_data[0]);
271  }
272  else
273  {
274  $this->tooltips[] = ilTooltipGUI::getTooltip($mat_tt_id, $mat_data[0]);
275  }
276 
277  $tpl->parseCurrentBlock();
278  $cnt++;
279  }
280 
281  $tpl->setCurrentBlock("material_td");
282  $tpl->setVariable("CLASS_MAT", "ilSkillMat");
283  $tpl->parseCurrentBlock();
284  }
285  }
286 
287  $title = $sep = "";
288  $found = false;
289  foreach ($path as $p)
290  {
291  if ($found)
292  {
293  $title.= $sep.$p["title"];
294  $sep = " > ";
295  }
296  if ($a_top_skill_id == $p["child"])
297  {
298  $found = true;
299  }
300  }
301 
302  $tpl->setCurrentBlock("skill");
303  $tpl->setVariable("BSKILL_TITLE", $title);
304  $tpl->setVariable("TXT_LEVEL", $lng->txt("skmg_level"));
305  $tpl->setVariable("TXT_SELF_EVAL", $lng->txt("skmg_self_evaluation"));
306  $tpl->setVariable("TXT_MATERIAL", $lng->txt("skmg_material"));
307 
308  if ($a_edit)
309  {
310  $act_list->flush();
311  $act_list->setId("act_".$a_top_skill_id."_".$bs["id"]);
312  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
313  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "tref_id", $bs["tref"]);
314  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "basic_skill_id", $bs["id"]);
315  $act_list->addItem($lng->txt('skmg_assign_materials'), "",
316  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials"));
317  $act_list->addItem($lng->txt('skmg_self_evaluation'), "",
318  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "selfEvaluation"));
319  $tpl->setVariable("ACTIONS2", $act_list->getHTML());
320  }
321 
322 
323  $tpl->parseCurrentBlock();
324  }
325 
326  $tpl->setVariable("SKILL_TITLE", ilSkillTreeNode::_lookupTitle($a_top_skill_id));
327 
328  if ($a_edit)
329  {
330  $act_list->flush();
331  $act_list->setId("act_".$a_top_skill_id);
332  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
333 // $act_list->addItem($lng->txt('skmg_assign_materials'), "",
334 // $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials"));
335  $act_list->addItem($lng->txt('skmg_remove_skill'), "",
336  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "confirmSkillRemove"));
337  $tpl->setVariable("ACTIONS1", $act_list->getHTML());
338  }
339 
340  return $tpl->get();
341  }
342 
343  function getTooltipsJs()
344  {
345  return $this->tooltips;
346  }
347 
354  function getMaterialInfo($a_wsp_id)
355  {
356  global $ilUser;
357 
358  if(!$this->ws_tree)
359  {
360  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
361  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
362  $this->ws_tree = new ilWorkspaceTree($ilUser->getId());
363  $this->ws_access = new ilWorkspaceAccessHandler($caption);
364  }
365 
366  $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
367  $caption = ilObject::_lookupTitle($obj_id);
368 
369  if(!$this->offline_mode)
370  {
371  $url = $this->ws_access->getGotoLink($a_wsp_id, $obj_id);
372  }
373  else
374  {
375  $url = $this->offline_mode."file_".$obj_id."/";
376 
377  // all possible material types for now
378  switch(ilObject::_lookupType($obj_id))
379  {
380  case "tstv":
381  include_once "Modules/Test/classes/class.ilObjTestVerification.php";
382  $obj = new ilObjTestVerification($obj_id, false);
383  $url .= $obj->getOfflineFilename();
384  break;
385 
386  case "excv":
387  include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
388  $obj = new ilObjExerciseVerification($obj_id, false);
389  $url .= $obj->getOfflineFilename();
390  break;
391 
392  case "file":
393  $file = new ilObjFile($obj_id, false);
394  $url .= $file->getFilename();
395  break;
396  }
397  }
398 
399  return array($caption, $url);
400  }
401 
405  function addSkill()
406  {
407  global $ilUser, $ilCtrl, $lng;
408 
409  ilPersonalSkill::addPersonalSkill($ilUser->getId(), (int) $_GET["obj_id"]);
410 
411  ilUtil::sendSuccess($lng->txt("msg_object_modified"));
412  $ilCtrl->redirect($this, "listSkills");
413  }
414 
415 
416 
421  {
422  global $ilCtrl, $tpl, $lng;
423 
424  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
425  if ($_GET["skill_id"] > 0)
426  {
427  $_POST["id"][] = $_GET["skill_id"];
428  }
429  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
430  {
431  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
432  $ilCtrl->redirect($this, "listSkills");
433  }
434  else
435  {
436  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
437  $cgui = new ilConfirmationGUI();
438  $cgui->setFormAction($ilCtrl->getFormAction($this));
439  $cgui->setHeaderText($lng->txt("skmg_really_remove_skills"));
440  $cgui->setCancel($lng->txt("cancel"), "listSkills");
441  $cgui->setConfirm($lng->txt("delete"), "removeSkills");
442 
443  foreach ($_POST["id"] as $i)
444  {
445  $cgui->addItem("id[]", $i, ilSkillTreeNode::_lookupTitle($i));
446  }
447 
448  $tpl->setContent($cgui->getHTML());
449  }
450  }
451 
455  function removeSkills()
456  {
457  global $ilUser, $lng, $ilCtrl;
458 
459  if (is_array($_POST["id"]))
460  {
461  foreach ($_POST["id"] as $n_id)
462  {
463  ilPersonalSkill::removeSkill($ilUser->getId(), $n_id);
464  }
465  }
466 
467  ilUtil::sendSuccess($lng->txt("msg_object_modified"));
468  $ilCtrl->redirect($this, "listSkills");
469  }
470 
471 
472  //
473  // Materials assignments
474  //
475 
482  function assignMaterials()
483  {
484  global $ilTabs, $lng, $ilCtrl, $tpl, $ilToolbar;
485 
486  $ilTabs->setBackTarget($lng->txt("back"),
487  $ilCtrl->getLinkTarget($this, "listSkills"));
488 
489  $ilCtrl->saveParameter($this, "skill_id");
490  $ilCtrl->saveParameter($this, "basic_skill_id");
491  $ilCtrl->saveParameter($this, "tref_id");
492 
493  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
494  $tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
495  $tpl->setTitleIcon(ilUtil::getImagePath("icon_".
496  ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]).
497  "_b.gif"));
498 
499  // basic skill selection
500 // here basic skill id??
501  $bs = ilSkillTreeNode::getSkillTreeNodes((int) $_GET["skill_id"], true);
502  $options = array();
503  foreach ($bs as $b)
504  {
505  $options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
506  }
507 
508  $cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
509  ? (int) $_POST["basic_skill_id"]
510  : (((int) $_GET["basic_skill_id"] > 0)
511  ? (int) $_GET["basic_skill_id"]
512  : key($options));
513 
514  $ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
515 
516  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
517  $si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
518  $si->setOptions($options);
519  $si->setValue($cur_basic_skill_id);
520  $ilToolbar->addInputItem($si, true);
521  $ilToolbar->addFormButton($lng->txt("select"),
522  "assignMaterials");
523 
524  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
525 
526  // table
527  include_once("./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
528  $tab = new ilSkillAssignMaterialsTableGUI($this, "assignMaterials",
529  (int) $_GET["skill_id"], (int) $_GET["tref_id"], $cur_basic_skill_id);
530 
531  $tpl->setContent($tab->getHTML());
532 
533  }
534 
535 
542  function assignMaterial()
543  {
544  global $tpl, $ilUser, $ilCtrl, $ilTabs, $lng;
545 
546  $ilCtrl->saveParameter($this, "skill_id");
547  $ilCtrl->saveParameter($this, "level_id");
548  $ilCtrl->saveParameter($this, "tref_id");
549  $ilCtrl->saveParameter($this, "basic_skill_id");
550 
551  $ilTabs->setBackTarget($lng->txt("back"),
552  $ilCtrl->getLinkTarget($this, "assignMaterials"));
553 
554  // get ws tree
555  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
556  $tree = new ilWorkspaceTree($ilUser->getId());
557 
558  // get access handler
559  include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
560  $acc_handler = new ilWorkspaceAccessHandler($tree);
561 
562  // get es explorer
563  include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php");
565  'skill_wspexpand', $tree, $acc_handler);
566  $exp->setTargetGet('wsp_id');
567  $exp->setFiltered(false);
568  $exp->removeAllFormItemTypes();
569  $exp->addFormItemForType("file");
570  $exp->addFormItemForType("tstv");
571  $exp->addFormItemForType("excv");
572 
573  if($_GET['skill_wspexpand'] == '')
574  {
575  // not really used as session is already set [see above]
576  $expanded = $tree->readRootId();
577  }
578  else
579  {
580  $expanded = $_GET['skill_wspexpand'];
581  }
582  $exp->setCheckedItems(array((int)$_POST['wsp_id']));
583  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'assignMaterial'));
584  $exp->setPostVar('wsp_id[]');
585  $exp->setExpand($expanded);
586  $exp->setOutput(0);
587 
588  // fill template
589  $mtpl = new ilTemplate("tpl.materials_selection.html", true, true, "Services/Skill");
590  $mtpl->setVariable("EXP", $exp->getOutput());
591 
592  // toolbars
593  $tb = new ilToolbarGUI();
594  $tb->addFormButton($lng->txt("select"),
595  "selectMaterial");
596  $tb->setFormAction($ilCtrl->getFormAction($this));
597  $tb->setOpenFormTag(true);
598  $tb->setCloseFormTag(false);
599  $mtpl->setVariable("TOOLBAR1", $tb->getHTML());
600  $tb->setOpenFormTag(false);
601  $tb->setCloseFormTag(true);
602  $mtpl->setVariable("TOOLBAR2", $tb->getHTML());
603 
604  $tpl->setContent($mtpl->get());
605  }
606 
610  function selectMaterial()
611  {
612  global $ilUser, $ilCtrl, $lng;
613 
614  include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
615  if (is_array($_POST["wsp_id"]))
616  {
617  foreach ($_POST["wsp_id"] as $w)
618  {
619  ilPersonalSkill::assignMaterial($ilUser->getId(), (int) $_GET["skill_id"],
620  (int) $_GET["tref_id"],
621  (int) $_GET["basic_skill_id"], (int) $_GET["level_id"], (int) $w);
622  }
623  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
624  }
625 
626  $ilCtrl->saveParameter($this, "skill_id");
627  $ilCtrl->saveParameter($this, "level_id");
628  $ilCtrl->saveParameter($this, "tref_id");
629  $ilCtrl->saveParameter($this, "basic_skill_id");
630 
631  $ilCtrl->redirect($this, "assignMaterials");
632  }
633 
634 
638  function removeMaterial()
639  {
640  global $ilUser, $lng, $ilCtrl;
641 
642  ilPersonalSkill::removeMaterial($ilUser->getId(), (int) $_GET["tref_id"],
643  (int) $_GET["level_id"],
644  (int) $_GET["wsp_id"]);
645  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
646  $ilCtrl->redirect($this, "assignMaterials");
647  }
648 
649 
650  //
651  // Self evaluation
652  //
653 
660  function selfEvaluation()
661  {
662  global $ilTabs, $lng, $ilCtrl, $tpl, $ilToolbar;
663 
664  $ilTabs->setBackTarget($lng->txt("back"),
665  $ilCtrl->getLinkTarget($this, "listSkills"));
666 
667  $ilCtrl->saveParameter($this, "skill_id");
668  $ilCtrl->saveParameter($this, "basic_skill_id");
669  $ilCtrl->saveParameter($this, "tref_id");
670 
671  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
672  $tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
673  $tpl->setTitleIcon(ilUtil::getImagePath("icon_".
674  ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]).
675  "_b.gif"));
676 
677  // basic skill selection
678 // here basic skill id??
679  $bs = ilSkillTreeNode::getSkillTreeNodes((int) $_GET["skill_id"], true);
680  $options = array();
681  foreach ($bs as $b)
682  {
683  $options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
684  }
685 
686  $cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
687  ? (int) $_POST["basic_skill_id"]
688  : (((int) $_GET["basic_skill_id"] > 0)
689  ? (int) $_GET["basic_skill_id"]
690  : key($options));
691 
692  $ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
693 
694  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
695  $si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
696  $si->setOptions($options);
697  $si->setValue($cur_basic_skill_id);
698  $ilToolbar->addInputItem($si, true);
699  $ilToolbar->addFormButton($lng->txt("select"),
700  "selfEvaluation");
701 
702  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
703 
704  // table
705  include_once("./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
706  $tab = new ilSelfEvaluationSimpleTableGUI($this, "selfEvaluation",
707  (int) $_GET["skill_id"], (int) $_GET["tref_id"], $cur_basic_skill_id);
708 
709  $tpl->setContent($tab->getHTML());
710 
711  }
712 
717  {
718  global $ilUser, $lng, $ilCtrl;
719 
720  ilPersonalSkill::saveSelfEvaluation($ilUser->getId(), (int) $_GET["skill_id"],
721  (int) $_GET["tref_id"], (int) $_GET["basic_skill_id"], (int) $_POST["se"]);
722  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
723 
724 /* $ilCtrl->saveParameter($this, "skill_id");
725  $ilCtrl->saveParameter($this, "level_id");
726  $ilCtrl->saveParameter($this, "tref_id");
727  $ilCtrl->saveParameter($this, "basic_skill_id");*/
728 
729  $ilCtrl->redirect($this, "listSkills");
730 
731  }
732 
739  function listSkillsForAdd()
740  {
741  global $ilUser, $tpl, $ilCtrl, $lng, $ilTabs;
742 
743  ilUtil::sendInfo($lng->txt("skmg_select_skill"));
744 
745  $ilTabs->setBackTarget($lng->txt("back"),
746  $ilCtrl->getLinkTarget($this, ""));
747 
748  include_once("./Services/Skill/classes/class.ilSkillTree.php");
749  $skill_tree = new ilSkillTree();
750 
751  require_once ("./Services/Skill/classes/class.ilPersonalSkillExplorer.php");
752  $exp = new ilPersonalSkillExplorer($ilCtrl->getLinkTarget($this, "listSkillsForAdd"));
753  $exp->setTargetGet("obj_id");
754 
755  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, "listSkillsForAdd"));
756 
757  if ($_GET["skpexpand"] == "")
758  {
759  $expanded = $skill_tree->readRootId();
760  }
761  else
762  {
763  $expanded = $_GET["skpexpand"];
764  }
765 
766  if ($_GET["obj_id"] > 0)
767  {
768  $path = $this->skill_tree->getPathId($_GET["obj_id"]);
769  $exp->setForceOpenPath($path);
770  $exp->highlightNode($_GET["obj_id"]);
771  }
772  else
773  {
774  $exp->highlightNode($this->skill_tree->readRootId());
775  }
776  $exp->setExpand($expanded);
777  // build html-output
778  $exp->setOutput(0);
779  $output = $exp->getOutput();
780 
781  // asynchronous output
782  if ($ilCtrl->isAsynch())
783  {
784  echo $output; exit;
785  }
786 
787  $tpl->setContent($output);
788 
789  }
790 
791 
792 }
793 ?>