ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
21  protected $access;
22 
23  public $online_help_mode = false;
24 
25 
29  public function __construct($a_parent_obj, $a_parent_cmd, $a_validation = false)
30  {
31  global $DIC;
32 
33  $this->ctrl = $DIC->ctrl();
34  $this->lng = $DIC->language();
35  $this->access = $DIC->access();
36  $ilCtrl = $DIC->ctrl();
37  $lng = $DIC->language();
38  $ilAccess = $DIC->access();
39  $lng = $DIC->language();
40 
41  $this->setId("lm_help_map");
42  $this->validation = $a_validation;
43 
44  parent::__construct($a_parent_obj, $a_parent_cmd);
45  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
46 
47  $this->getChapters();
48 
49  $this->setTitle($lng->txt("help_assign_help_ids"));
50 
51  $this->addColumn($this->lng->txt("st"), "title");
52  $this->addColumn($this->lng->txt("cont_screen_ids"));
53 
54  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
55  $this->setRowTemplate("tpl.help_map_row.html", "Modules/LearningModule");
56  $this->setDefaultOrderField("title");
57  $this->setDefaultOrderDirection("asc");
58 
59  $this->addCommandButton("saveHelpMapping", $lng->txt("save"));
60  }
61 
68  public function getChapters()
69  {
70  $hc = ilSession::get("help_chap");
71  $lm_tree = $this->parent_obj->object->getTree();
72 
73  if ($hc > 0 && $lm_tree->isInTree($hc)) {
74  //$node = $lm_tree->getNodeData($hc);
75  //$chaps = $lm_tree->getSubTree($node);
76  $chaps = $lm_tree->getFilteredSubTree($hc, array("pg"));
77  unset($chaps[0]);
78  } else {
79  $chaps = ilStructureObject::getChapterList($this->parent_obj->object->getId());
80  }
81 
82  $this->setData($chaps);
83  }
84 
85 
89  protected function fillRow($a_set)
90  {
91  $lng = $this->lng;
92 
93  $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
94  $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
95 
96  $screen_ids = ilHelpMapping::getScreenIdsOfChapter($a_set["obj_id"]);
97 
98  $this->tpl->setVariable(
99  "SCREEN_IDS",
100  ilUtil::prepareFormOutput(implode($screen_ids, "\n"))
101  );
102  }
103 }
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.
global $DIC
Definition: saml.php:7
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.
static 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.
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.