ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHelpMappingTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected \ILIAS\Help\Map\MapManager $help_map;
27 protected bool $validation;
29 public bool $online_help_mode = false;
30
31 public function __construct(
32 object $a_parent_obj,
33 string $a_parent_cmd,
34 bool $a_validation = false
35 ) {
36 global $DIC;
37
38 $this->ctrl = $DIC->ctrl();
39 $this->lng = $DIC->language();
40 $this->access = $DIC->access();
41 $ilCtrl = $DIC->ctrl();
42 $lng = $DIC->language();
43 $this->help_map = $DIC->help()->internal()->domain()->map();
44
45 $this->setId("lm_help_map");
46 $this->validation = $a_validation;
47
48 parent::__construct($a_parent_obj, $a_parent_cmd);
49
50 $this->getChapters();
51
52 $this->setTitle($lng->txt("help_assign_help_ids"));
53
54 $this->addColumn($this->lng->txt("st"), "title");
55 $this->addColumn($this->lng->txt("cont_screen_ids"));
56
57 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
58 $this->setRowTemplate("tpl.help_map_row.html", "components/ILIAS/LearningModule");
59 $this->setDefaultOrderField("title");
60 $this->setDefaultOrderDirection("asc");
61
62 $this->addCommandButton("saveHelpMapping", $lng->txt("save"));
63 }
64
65 public function getChapters(): void
66 {
67 $hc = ilSession::get("help_chap");
68 $lm_tree = $this->parent_obj->getObject()->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->getObject()->getId());
77 }
78
79 $this->setData($chaps);
80 }
81
82
83 protected function fillRow(array $a_set): void
84 {
86
87 $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
88 $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
89
90 $screen_ids = $this->help_map->getScreenIdsOfChapter($a_set["obj_id"]);
91
92 $this->tpl->setVariable(
93 "SCREEN_IDS",
94 ilLegacyFormElementsUtil::prepareFormOutput(implode("\n", $screen_ids))
95 );
96 }
97}
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.
ILIAS Help Map MapManager $help_map
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
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26