ILIAS  release_8 Revision v8.24
class.ilHelpModuleTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
28 protected bool $has_write_permission;
29
30 public function __construct(
31 object $a_parent_obj,
32 string $a_parent_cmd,
33 bool $a_has_write_permission = false
34 ) {
35 global $DIC;
36
37 $this->ctrl = $DIC->ctrl();
38 $this->lng = $DIC->language();
39 $this->access = $DIC->access();
40 $this->settings = $DIC->settings();
41 $ilCtrl = $DIC->ctrl();
42 $lng = $DIC->language();
43 $this->has_write_permission = $a_has_write_permission;
44
45 $this->setId("help_mods");
46
47 parent::__construct($a_parent_obj, $a_parent_cmd);
48 $this->getHelpModules();
49 $this->setTitle($lng->txt("help_modules"));
50
51 $this->addColumn("", "", "1");
52 $this->addColumn($this->lng->txt("title"));
53 $this->addColumn($this->lng->txt("help_imported_on"));
54 $this->addColumn($this->lng->txt("actions"));
55
56 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
57 $this->setRowTemplate("tpl.help_module_row.html", "Services/Help");
58
59 if ($this->has_write_permission) {
60 $this->addMultiCommand("confirmHelpModulesDeletion", $lng->txt("delete"));
61 }
62 }
63
64 public function getHelpModules(): void
65 {
66 $this->setData($this->parent_obj->getObject()->getHelpModules());
67 }
68
69 protected function fillRow(array $a_set): void
70 {
73 $ilCtrl = $this->ctrl;
74
75 $ilCtrl->setParameter($this->parent_obj, "hm_id", $a_set["id"]);
76 if ($this->has_write_permission) {
77 $this->tpl->setCurrentBlock("cmd");
78 if ((int) $a_set["id"] === (int) $ilSetting->get("help_module")) {
79 $this->tpl->setVariable(
80 "HREF_CMD",
81 $ilCtrl->getLinkTarget($this->parent_obj, "deactivateModule")
82 );
83 $this->tpl->setVariable("TXT_CMD", $lng->txt("deactivate"));
84 } else {
85 $this->tpl->setVariable(
86 "HREF_CMD",
87 $ilCtrl->getLinkTarget($this->parent_obj, "activateModule")
88 );
89 $this->tpl->setVariable("TXT_CMD", $lng->txt("activate"));
90 }
91 $this->tpl->parseCurrentBlock();
92 }
93 $ilCtrl->setParameter($this->parent_obj, "hm_id", "");
94 $this->tpl->setVariable("TITLE", $a_set["title"] ?? "");
95 $this->tpl->setVariable(
96 "CREATION_DATE",
97 ilDatePresentation::formatDate(new ilDateTime($a_set["create_date"] ?? null, IL_CAL_DATETIME))
98 );
99 $this->tpl->setVariable("ID", $a_set["id"]);
100 }
101}
const IL_CAL_DATETIME
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, bool $a_has_write_permission=false)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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="")
addMultiCommand(string $a_cmd, string $a_text)
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
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
global $ilSetting
Definition: privfeed.php:17