ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
20  protected $access;
21 
25  public function __construct($a_parent_obj, $a_parent_cmd, $a_lmme)
26  {
27  global $DIC;
28 
29  $this->ctrl = $DIC->ctrl();
30  $this->lng = $DIC->language();
31  $this->access = $DIC->access();
32  $ilCtrl = $DIC->ctrl();
33  $lng = $DIC->language();
34  $ilAccess = $DIC->access();
35  $lng = $DIC->language();
36 
37  parent::__construct($a_parent_obj, $a_parent_cmd);
38 
39  $this->lmme = $a_lmme;
40  $entries = $this->lmme->getMenuEntries();
41 
42  $this->setData($entries);
43  $this->setTitle($lng->txt("cont_custom_menu_entries"));
44  $this->disable("footer");
45 
46  // $this->addColumn("", "", "1px", true);
47  $this->addColumn($this->lng->txt("link"));
48  $this->addColumn($this->lng->txt("active"));
49  $this->addColumn($this->lng->txt("actions"));
50 
51  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
52  $this->setRowTemplate("tpl.lm_menu_entry_row.html", "Modules/LearningModule");
53 
54  // $this->addMultiCommand("deleteMenuEntry", $lng->txt("delete"));
55  $this->addCommandButton("saveMenuProperties", $lng->txt("save"));
56  }
57 
61  protected function fillRow($entry)
62  {
63  $lng = $this->lng;
65 
66  $ilCtrl->setParameter($this->parent_obj, "menu_entry", $entry["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", $entry["id"]);
81 
82  if ($entry["type"] == "intern") {
83  $entry["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $entry["link"];
84  }
85 
86  // add http:// prefix if not exist
87  if (!strstr($entry["link"], '://') && !strstr($entry["link"], 'mailto:')) {
88  $entry["link"] = "http://" . $entry["link"];
89  }
90 
91  $this->tpl->setVariable("HREF_LINK", $entry["link"]);
92  $this->tpl->setVariable("LINK", $entry["title"]);
93 
94  if (ilUtil::yn2tf($entry["active"])) {
95  $this->tpl->setVariable("ACTIVE_CHECK", "checked=\"checked\"");
96  }
97  }
98 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
fillRow($entry)
Fill table row.
TableGUI class for lm menu items.
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
__construct($a_parent_obj, $a_parent_cmd, $a_lmme)
Constructor.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
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.
static yn2tf($a_yn)
convert "y"/"n" to true/false