ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilExcDeliveredFilesTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
16 
20  function __construct($a_parent_obj, $a_parent_cmd, $a_exc)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  $this->exercise = $a_exc;
25 
26  parent::__construct($a_parent_obj, $a_parent_cmd);
27  $this->setData($this->getDeliveredFiles());
28  $this->setTitle($this->lng->txt("already_delivered_files"));
29  $this->setLimit(9999);
30 
31  $this->addColumn($this->lng->txt(""), "", "1", 1);
32  $this->addColumn($this->lng->txt("filename"));
33  $this->addColumn($this->lng->txt("date"));
34 
35  $this->setEnableHeader(true);
36  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
37  $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
38  $this->disable("footer");
39  $this->setEnableTitle(true);
40 
41  if (mktime() < $this->exercise->getTimestamp())
42  {
43  $this->addMultiCommand("deleteDelivered", $lng->txt("delete"));
44  }
45  $this->addMultiCommand("download", $lng->txt("download"));
46  }
47 
54  function getDeliveredFiles()
55  {
56  global $ilUser;
57 
58  $files = $this->exercise->getDeliveredFiles($ilUser->getId());
59  return $files;
60  }
61 
65  protected function fillRow($file)
66  {
67  global $lng;
68 
69  $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
70  $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
71  $date = new ilDateTime($file['timestamp14'],IL_CAL_TIMESTAMP);
72  $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
73  }
74 
75 }
76 
77 ?>