ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilHelpMappingTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
15{
19 protected $access;
20
21 public $online_help_mode = false;
22
23
27 public function __construct($a_parent_obj, $a_parent_cmd, $a_validation = false)
28 {
29 global $DIC;
30
31 $this->ctrl = $DIC->ctrl();
32 $this->lng = $DIC->language();
33 $this->access = $DIC->access();
34 $ilCtrl = $DIC->ctrl();
35 $lng = $DIC->language();
36 $ilAccess = $DIC->access();
37 $lng = $DIC->language();
38
39 $this->setId("lm_help_map");
40 $this->validation = $a_validation;
41
42 parent::__construct($a_parent_obj, $a_parent_cmd);
43
44 $this->getChapters();
45
46 $this->setTitle($lng->txt("help_assign_help_ids"));
47
48 $this->addColumn($this->lng->txt("st"), "title");
49 $this->addColumn($this->lng->txt("cont_screen_ids"));
50
51 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
52 $this->setRowTemplate("tpl.help_map_row.html", "Modules/LearningModule");
53 $this->setDefaultOrderField("title");
54 $this->setDefaultOrderDirection("asc");
55
56 $this->addCommandButton("saveHelpMapping", $lng->txt("save"));
57 }
58
65 public function getChapters()
66 {
67 $hc = ilSession::get("help_chap");
68 $lm_tree = $this->parent_obj->object->getTree();
69
70 if ($hc > 0 && $lm_tree->isInTree($hc)) {
71 //$node = $lm_tree->getNodeData($hc);
72 //$chaps = $lm_tree->getSubTree($node);
73 $chaps = $lm_tree->getFilteredSubTree($hc, array("pg"));
74 unset($chaps[0]);
75 } else {
76 $chaps = ilStructureObject::getChapterList($this->parent_obj->object->getId());
77 }
78
79 $this->setData($chaps);
80 }
81
82
86 protected function fillRow($a_set)
87 {
89
90 $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
91 $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
92
93 $screen_ids = ilHelpMapping::getScreenIdsOfChapter($a_set["obj_id"]);
94
95 $this->tpl->setVariable(
96 "SCREEN_IDS",
97 ilUtil::prepareFormOutput(implode("\n", $screen_ids))
98 );
99 }
100}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd, $a_validation=false)
Constructor.
fillRow($a_set)
Fill table row.
static getScreenIdsOfChapter($a_chap, $a_module_id=0)
Get screen ids of chapter.
static get($a_var)
Get a value.
static getChapterList($a_lm_id)
export (sub)structure objects of structure object (see ilias_co.dtd)
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
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 @access public
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46