ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
class.ilTestHistoryTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
5 include_once('./Services/Table/classes/class.ilTable2GUI.php');
6 
16 {
17  protected $tstObject;
18 
26  public function __construct($a_parent_obj, $a_parent_cmd)
27  {
28  parent::__construct($a_parent_obj, $a_parent_cmd);
29 
30  global $lng, $ilCtrl;
31 
32  $this->lng = $lng;
33  $this->ctrl = $ilCtrl;
34 
35  $this->setFormName('questionbrowser');
36  $this->setStyle('table', 'fullwidth');
37 
38  $this->addColumn($this->lng->txt("assessment_log_datetime"),'datetime', '');
39  $this->addColumn($this->lng->txt("user"),'user', '');
40  $this->addColumn($this->lng->txt("assessment_log_text"),'log', '');
41  $this->addColumn($this->lng->txt("location"),'location', '');
42 
43  $this->setRowTemplate("tpl.il_as_tst_history_row.html", "Modules/Test");
44 
45  $this->setDefaultOrderField("datetime");
46  $this->setDefaultOrderDirection("asc");
47 
48  $this->enable('header');
49  }
50 
51  public function setTestObject($obj)
52  {
53  $this->tstObject = $obj;
54  }
55 
63  public function fillRow($data)
64  {
65  global $ilUser,$ilAccess;
66 
67  $username = $this->tstObject->userLookupFullName($data["user_fi"], TRUE);
68  $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($data["tstamp"],IL_CAL_UNIX)));
69  $this->tpl->setVariable("USER", $username);
70  $this->tpl->setVariable("LOG", trim(ilUtil::prepareFormOutput($data["logtext"])));
71  $location = '';
72  if (strlen($data["ref_id"]) && strlen($data["href"]))
73  {
74  $location = '<a href="' . $data['href'] . '">' . $this->lng->txt("perma_link") . '</a>';
75  }
76  $this->tpl->setVariable("LOCATION", $location);
77  }
78 }
79 ?>
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setFormName($a_formname)
Set Form name.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setStyle($a_element, $a_style)
$location
Definition: buildRTE.php:44
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
enable($a_module_name)
enables particular modules of table
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40