ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilHelpModuleTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
20  protected $ctrl;
21 
25  protected $access;
26 
30  protected $settings;
31 
36 
40  public function __construct($a_parent_obj, $a_parent_cmd, $a_has_write_permission = false)
41  {
42  global $DIC;
43 
44  $this->ctrl = $DIC->ctrl();
45  $this->lng = $DIC->language();
46  $this->access = $DIC->access();
47  $this->settings = $DIC->settings();
48  $ilCtrl = $DIC->ctrl();
49  $lng = $DIC->language();
50  $ilAccess = $DIC->access();
51  $lng = $DIC->language();
52  $this->has_write_permission = $a_has_write_permission;
53 
54  $this->setId("help_mods");
55 
56  parent::__construct($a_parent_obj, $a_parent_cmd);
57  $this->getHelpModules();
58  $this->setTitle($lng->txt("help_modules"));
59 
60  $this->addColumn("", "", "1");
61  $this->addColumn($this->lng->txt("title"));
62  $this->addColumn($this->lng->txt("help_imported_on"));
63  $this->addColumn($this->lng->txt("actions"));
64 
65  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
66  $this->setRowTemplate("tpl.help_module_row.html", "Services/Help");
67 
68  if ($this->has_write_permission) {
69  $this->addMultiCommand("confirmHelpModulesDeletion", $lng->txt("delete"));
70  }
71  //$this->addCommandButton("", $lng->txt(""));
72  }
73 
77  public function getHelpModules()
78  {
79  $this->setData($this->parent_obj->object->getHelpModules());
80  }
81 
85  protected function fillRow($a_set)
86  {
87  $lng = $this->lng;
90 
91  $ilCtrl->setParameter($this->parent_obj, "hm_id", $a_set["id"]);
92  if ($this->has_write_permission) {
93  if ($a_set["id"] == $ilSetting->get("help_module")) {
94  $this->tpl->setCurrentBlock("cmd");
95  $this->tpl->setVariable(
96  "HREF_CMD",
97  $ilCtrl->getLinkTarget($this->parent_obj, "deactivateModule")
98  );
99  $this->tpl->setVariable("TXT_CMD", $lng->txt("deactivate"));
100  $this->tpl->parseCurrentBlock();
101  } else {
102  $this->tpl->setCurrentBlock("cmd");
103  $this->tpl->setVariable(
104  "HREF_CMD",
105  $ilCtrl->getLinkTarget($this->parent_obj, "activateModule")
106  );
107  $this->tpl->setVariable("TXT_CMD", $lng->txt("activate"));
108  $this->tpl->parseCurrentBlock();
109  }
110  }
111  $ilCtrl->setParameter($this->parent_obj, "hm_id", "");
112  $this->tpl->setVariable("TITLE", $a_set["title"]);
113  $this->tpl->setVariable(
114  "CREATION_DATE",
115  ilDatePresentation::formatDate(new ilDateTime($a_set["create_date"], IL_CAL_DATETIME))
116  );
117  $this->tpl->setVariable("ID", $a_set["id"]);
118  }
119 }
fillRow($a_set)
Fill table row.
__construct($a_parent_obj, $a_parent_cmd, $a_has_write_permission=false)
Constructor.
getHelpModules()
Get help modules.
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
TableGUI class for help modules.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
settings()
Definition: settings.php:2
global $ilSetting
Definition: privfeed.php:17
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.