ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLMMenuItemsTableGUI.php
Go to the documentation of this file.
1<?php
2
24{
27
28 public function __construct(
29 object $a_parent_obj,
30 string $a_parent_cmd,
31 ilLMMenuEditor $a_lmme
32 ) {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $this->access = $DIC->access();
38 $ilCtrl = $DIC->ctrl();
39 $lng = $DIC->language();
40
41 parent::__construct($a_parent_obj, $a_parent_cmd);
42
43 $this->lmme = $a_lmme;
44 $entries = $this->lmme->getMenuEntries();
45
46 $this->setData($entries);
47 $this->setTitle($lng->txt("cont_custom_menu_entries"));
48 $this->disable("footer");
49
50 // $this->addColumn("", "", "1px", true);
51 $this->addColumn($this->lng->txt("link"));
52 $this->addColumn($this->lng->txt("active"));
53 $this->addColumn($this->lng->txt("actions"));
54
55 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
56 $this->setRowTemplate("tpl.lm_menu_entry_row.html", "components/ILIAS/LearningModule");
57
58 // $this->addMultiCommand("deleteMenuEntry", $lng->txt("delete"));
59 $this->addCommandButton("saveMenuProperties", $lng->txt("save"));
60 }
61
62 protected function fillRow(array $a_set): void
63 {
64 $ilCtrl = $this->ctrl;
65
66 $ilCtrl->setParameter($this->parent_obj, "menu_entry", $a_set["id"]);
67
68 $this->tpl->setCurrentBlock("cmd");
69 $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "editMenuEntry"));
70 $this->tpl->setVariable("CMD", $this->lng->txt("edit"));
71 $this->tpl->parseCurrentBlock();
72
73 $this->tpl->setCurrentBlock("cmd");
74 $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "deleteMenuEntry"));
75 $this->tpl->setVariable("CMD", $this->lng->txt("delete"));
76 $this->tpl->parseCurrentBlock();
77
78 $ilCtrl->setParameter($this, "menu_entry", "");
79
80 $this->tpl->setVariable("LINK_ID", $a_set["id"]);
81
82 if ($a_set["type"] == "intern") {
83 $a_set["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $a_set["link"];
84 }
85
86 // add http:// prefix if not exist
87 if (!strstr($a_set["link"], '://') && !strstr($a_set["link"], 'mailto:')) {
88 $a_set["link"] = "https://" . $a_set["link"];
89 }
90
91 $this->tpl->setVariable("HREF_LINK", $a_set["link"]);
92 $this->tpl->setVariable("LINK", $a_set["title"]);
93
94 if (ilUtil::yn2tf($a_set["active"])) {
95 $this->tpl->setVariable("ACTIVE_CHECK", "checked=\"checked\"");
96 }
97 }
98}
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMenuEntries(bool $a_only_active=false)
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, ilLMMenuEditor $a_lmme)
fillRow(array $a_set)
Standard Version of Fill Row.
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...
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
disable(string $a_module_name)
static yn2tf(string $a_yn)
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