ILIAS  release_8 Revision v8.24
class.ilHelpMappingTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected bool $validation;
28 public bool $online_help_mode = false;
29
30 public function __construct(
31 object $a_parent_obj,
32 string $a_parent_cmd,
33 bool $a_validation = false
34 ) {
35 global $DIC;
36
37 $this->ctrl = $DIC->ctrl();
38 $this->lng = $DIC->language();
39 $this->access = $DIC->access();
40 $ilCtrl = $DIC->ctrl();
41 $lng = $DIC->language();
42
43 $this->setId("lm_help_map");
44 $this->validation = $a_validation;
45
46 parent::__construct($a_parent_obj, $a_parent_cmd);
47
48 $this->getChapters();
49
50 $this->setTitle($lng->txt("help_assign_help_ids"));
51
52 $this->addColumn($this->lng->txt("st"), "title");
53 $this->addColumn($this->lng->txt("cont_screen_ids"));
54
55 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
56 $this->setRowTemplate("tpl.help_map_row.html", "Modules/LearningModule");
57 $this->setDefaultOrderField("title");
58 $this->setDefaultOrderDirection("asc");
59
60 $this->addCommandButton("saveHelpMapping", $lng->txt("save"));
61 }
62
63 public function getChapters(): void
64 {
65 $hc = ilSession::get("help_chap");
66 $lm_tree = $this->parent_obj->getObject()->getTree();
67
68 if ($hc > 0 && $lm_tree->isInTree($hc)) {
69 //$node = $lm_tree->getNodeData($hc);
70 //$chaps = $lm_tree->getSubTree($node);
71 $chaps = $lm_tree->getFilteredSubTree($hc, array("pg"));
72 unset($chaps[0]);
73 } else {
74 $chaps = ilStructureObject::getChapterList($this->parent_obj->getObject()->getId());
75 }
76
77 $this->setData($chaps);
78 }
79
80
81 protected function fillRow(array $a_set): void
82 {
84
85 $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
86 $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
87
88 $screen_ids = ilHelpMapping::getScreenIdsOfChapter($a_set["obj_id"]);
89
90 $this->tpl->setVariable(
91 "SCREEN_IDS",
92 ilLegacyFormElementsUtil::prepareFormOutput(implode("\n", $screen_ids))
93 );
94 }
95}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, bool $a_validation=false)
fillRow(array $a_set)
Standard Version of Fill Row.
static getScreenIdsOfChapter(int $a_chap, int $a_module_id=0)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static prepareFormOutput($a_str, bool $a_strip=false)
static get(string $a_var)
static getChapterList(int $a_lm_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
ilLanguage $lng
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc