ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHelpModuleTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected int $order_nr;
29 protected bool $has_write_permission;
30
31 public function __construct(
32 object $a_parent_obj,
33 string $a_parent_cmd,
34 bool $a_has_write_permission = false
35 ) {
36 global $DIC;
37
38 $this->ctrl = $DIC->ctrl();
39 $this->lng = $DIC->language();
40 $this->access = $DIC->access();
41 $this->settings = $DIC->settings();
42 $ilCtrl = $DIC->ctrl();
43 $lng = $DIC->language();
44 $this->has_write_permission = $a_has_write_permission;
45 $module_manager = $DIC->help()->internal()->domain()->module();
46 $this->order_nr = 0;
47
48 $this->setId("help_mods");
49
50 parent::__construct($a_parent_obj, $a_parent_cmd);
51 $this->setData($module_manager->getHelpModules());
52 $this->setTitle($lng->txt("help_modules"));
53
54 $this->addColumn("", "", "1");
55 $this->addColumn($this->lng->txt("help_order"));
56 $this->addColumn($this->lng->txt("title"));
57 $this->addColumn($this->lng->txt("help_imported_on"));
58 $this->addColumn($this->lng->txt("active"));
59 $this->addColumn($this->lng->txt("actions"));
60
61 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
62 $this->setRowTemplate("tpl.help_module_row.html", "components/ILIAS/Help/Administration");
63 $this->addCommandButton("saveOrdering", $lng->txt("sorting_save"));
64
65 if ($this->has_write_permission) {
66 $this->addMultiCommand("confirmHelpModulesDeletion", $lng->txt("delete"));
67 }
68 }
69
70 protected function fillRow(array $a_set): void
71 {
74 $ilCtrl = $this->ctrl;
75
76 $ilCtrl->setParameter($this->parent_obj, "hm_id", $a_set["id"]);
77 if ($this->has_write_permission) {
78 $this->tpl->setCurrentBlock("cmd");
79 if ($a_set["active"]) {
80 $this->tpl->setVariable(
81 "HREF_CMD",
82 $ilCtrl->getLinkTarget($this->parent_obj, "deactivateModule")
83 );
84 $this->tpl->setVariable("TXT_CMD", $lng->txt("deactivate"));
85 } else {
86 $this->tpl->setVariable(
87 "HREF_CMD",
88 $ilCtrl->getLinkTarget($this->parent_obj, "activateModule")
89 );
90 $this->tpl->setVariable("TXT_CMD", $lng->txt("activate"));
91 }
92 $this->tpl->parseCurrentBlock();
93 }
94 $ilCtrl->setParameter($this->parent_obj, "hm_id", "");
95 $this->tpl->setVariable("TITLE", $a_set["title"] ?? "");
96 $this->tpl->setVariable(
97 "CREATION_DATE",
98 ilDatePresentation::formatDate(new ilDateTime($a_set["create_date"] ?? null, IL_CAL_DATETIME))
99 );
100 $this->tpl->setVariable("ID", $a_set["id"]);
101 $this->order_nr += 10;
102 $this->tpl->setVariable("ORDER_NR", $this->order_nr);
103 if ($a_set["active"]) {
104 $this->tpl->setVariable("ACTIVE", $this->lng->txt("yes"));
105 } else {
106 $this->tpl->setVariable("ACTIVE", $this->lng->txt("no"));
107 }
108 }
109}
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, ?ilObjUser $user=null,)
@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...
ILIAS Setting Class.
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="")
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
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26