ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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  {
85  $lng = $this->lng;
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 }
setData(array $a_data)
static get(string $a_var)
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
static prepareFormOutput($a_str, bool $a_strip=false)
ilLanguage $lng
setId(string $a_val)
ILIAS Help Map MapManager $help_map
static getChapterList(int $a_lm_id)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:26
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
__construct(object $a_parent_obj, string $a_parent_cmd, bool $a_validation=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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...