ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilLMMenuItemsTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/Table/classes/class.ilTable2GUI.php");
6
16{
20 function __construct($a_parent_obj, $a_parent_cmd, $a_lmme)
21 {
22 global $ilCtrl, $lng, $ilAccess, $lng;
23
24 parent::__construct($a_parent_obj, $a_parent_cmd);
25
26 $this->lmme = $a_lmme;
27 $entries = $this->lmme->getMenuEntries();
28
29 $this->setData($entries);
30 $this->setTitle($lng->txt("cont_custom_menu_entries"));
31 $this->disable("footer");
32
33// $this->addColumn("", "", "1px", true);
34 $this->addColumn($this->lng->txt("link"));
35 $this->addColumn($this->lng->txt("active"));
36 $this->addColumn($this->lng->txt("actions"));
37
38 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
39 $this->setRowTemplate("tpl.lm_menu_entry_row.html", "Modules/LearningModule");
40
41// $this->addMultiCommand("deleteMenuEntry", $lng->txt("delete"));
42 $this->addCommandButton("saveMenuProperties", $lng->txt("save"));
43 }
44
48 protected function fillRow($entry)
49 {
50 global $lng, $ilCtrl;
51
52 $ilCtrl->setParameter($this->parent_obj, "menu_entry", $entry["id"]);
53
54 $this->tpl->setCurrentBlock("cmd");
55 $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj,"editMenuEntry"));
56 $this->tpl->setVariable("CMD", $this->lng->txt("edit"));
57 $this->tpl->parseCurrentBlock();
58
59 $this->tpl->setCurrentBlock("cmd");
60 $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj,"deleteMenuEntry"));
61 $this->tpl->setVariable("CMD", $this->lng->txt("delete"));
62 $this->tpl->parseCurrentBlock();
63
64 $ilCtrl->setParameter($this, "menu_entry", "");
65
66 $this->tpl->setVariable("LINK_ID", $entry["id"]);
67
68 if ($entry["type"] == "intern")
69 {
70 $entry["link"] = ILIAS_HTTP_PATH."/goto.php?target=".$entry["link"];
71 }
72
73 // add http:// prefix if not exist
74 if (!strstr($entry["link"],'://') && !strstr($entry["link"],'mailto:'))
75 {
76 $entry["link"] = "http://".$entry["link"];
77 }
78
79 $this->tpl->setVariable("HREF_LINK", $entry["link"]);
80 $this->tpl->setVariable("LINK", $entry["title"]);
81
82 if (ilUtil::yn2tf($entry["active"]))
83 {
84 $this->tpl->setVariable("ACTIVE_CHECK", "checked=\"checked\"");
85 }
86
87
88 }
89
90}
91?>
TableGUI class for lm menu items.
__construct($a_parent_obj, $a_parent_cmd, $a_lmme)
Constructor.
fillRow($entry)
Fill table row.
Class ilTable2GUI.
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.
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.
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
global $lng
Definition: privfeed.php:40