ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilHelpMappingTableGUI.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 include_once("./Services/Help/classes/class.ilHelpMapping.php");
6 
7 
17 {
18  var $online_help_mode = false;
19 
20 
24  function __construct($a_parent_obj, $a_parent_cmd, $a_validation = false)
25  {
26  global $ilCtrl, $lng, $ilAccess, $lng;
27 
28  $this->setId("lm_help_map");
29  $this->validation = $a_validation;
30 
31  parent::__construct($a_parent_obj, $a_parent_cmd);
32  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
33 
34  $this->getChapters();
35 
36  $this->setTitle($lng->txt("help_assign_help_ids"));
37 
38  $this->addColumn($this->lng->txt("st"), "title");
39  $this->addColumn($this->lng->txt("cont_screen_ids"));
40 
41  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
42  $this->setRowTemplate("tpl.help_map_row.html", "Modules/LearningModule");
43  $this->setDefaultOrderField("title");
44  $this->setDefaultOrderDirection("asc");
45 
46  $this->addCommandButton("saveHelpMapping", $lng->txt("save"));
47  }
48 
55  function getChapters()
56  {
57  $hc = ilSession::get("help_chap");
58  $lm_tree = $this->parent_obj->object->getTree();
59 
60  if ($hc > 0 && $lm_tree->isInTree($hc))
61  {
62  //$node = $lm_tree->getNodeData($hc);
63  //$chaps = $lm_tree->getSubTree($node);
64  $chaps = $lm_tree->getFilteredSubTree($hc, array("pg"));
65  unset($chaps[0]);
66  }
67  else
68  {
69  $chaps = ilStructureObject::getChapterList($this->parent_obj->object->getId());
70  }
71 
72  $this->setData($chaps);
73  }
74 
75 
79  protected function fillRow($a_set)
80  {
81  global $lng;
82 
83  $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
84  $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
85 
86  $screen_ids = ilHelpMapping::getScreenIdsOfChapter($a_set["obj_id"]);
87 
88  $this->tpl->setVariable("SCREEN_IDS",
89  ilUtil::prepareFormOutput(implode($screen_ids, "\n")));
90 
91  }
92 
93 }
94 
95 ?>