ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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 ?>
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static getChapterList($a_lm_id)
export (sub)structure objects of structure object (see ilias_co.dtd)
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
fillRow($a_set)
Fill table row.
static get($a_var)
Get a value.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
getScreenIdsOfChapter($a_chap, $a_module_id=0)
Get screen ids of chapter.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct($a_parent_obj, $a_parent_cmd, $a_validation=false)
Constructor.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $lng
Definition: privfeed.php:40
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.