ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  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 ?>