ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLMMenuItemsTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14{
18 protected $access;
19
23 public function __construct($a_parent_obj, $a_parent_cmd, $a_lmme)
24 {
25 global $DIC;
26
27 $this->ctrl = $DIC->ctrl();
28 $this->lng = $DIC->language();
29 $this->access = $DIC->access();
30 $ilCtrl = $DIC->ctrl();
31 $lng = $DIC->language();
32 $ilAccess = $DIC->access();
33 $lng = $DIC->language();
34
35 parent::__construct($a_parent_obj, $a_parent_cmd);
36
37 $this->lmme = $a_lmme;
38 $entries = $this->lmme->getMenuEntries();
39
40 $this->setData($entries);
41 $this->setTitle($lng->txt("cont_custom_menu_entries"));
42 $this->disable("footer");
43
44 // $this->addColumn("", "", "1px", true);
45 $this->addColumn($this->lng->txt("link"));
46 $this->addColumn($this->lng->txt("active"));
47 $this->addColumn($this->lng->txt("actions"));
48
49 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
50 $this->setRowTemplate("tpl.lm_menu_entry_row.html", "Modules/LearningModule");
51
52 // $this->addMultiCommand("deleteMenuEntry", $lng->txt("delete"));
53 $this->addCommandButton("saveMenuProperties", $lng->txt("save"));
54 }
55
59 protected function fillRow($entry)
60 {
63
64 $ilCtrl->setParameter($this->parent_obj, "menu_entry", $entry["id"]);
65
66 $this->tpl->setCurrentBlock("cmd");
67 $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "editMenuEntry"));
68 $this->tpl->setVariable("CMD", $this->lng->txt("edit"));
69 $this->tpl->parseCurrentBlock();
70
71 $this->tpl->setCurrentBlock("cmd");
72 $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "deleteMenuEntry"));
73 $this->tpl->setVariable("CMD", $this->lng->txt("delete"));
74 $this->tpl->parseCurrentBlock();
75
76 $ilCtrl->setParameter($this, "menu_entry", "");
77
78 $this->tpl->setVariable("LINK_ID", $entry["id"]);
79
80 if ($entry["type"] == "intern") {
81 $entry["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $entry["link"];
82 }
83
84 // add http:// prefix if not exist
85 if (!strstr($entry["link"], '://') && !strstr($entry["link"], 'mailto:')) {
86 $entry["link"] = "http://" . $entry["link"];
87 }
88
89 $this->tpl->setVariable("HREF_LINK", $entry["link"]);
90 $this->tpl->setVariable("LINK", $entry["title"]);
91
92 if (ilUtil::yn2tf($entry["active"])) {
93 $this->tpl->setVariable("ACTIVE_CHECK", "checked=\"checked\"");
94 }
95 }
96}
An exception for terminatinating execution or to throw for unit testing.
TableGUI class for lm menu items.
__construct($a_parent_obj, $a_parent_cmd, $a_lmme)
Constructor.
fillRow($entry)
Fill table row.
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
static yn2tf($a_yn)
convert "y"/"n" to true/false
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46