ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
31  $lng = $DIC['lng'];
32  $ilCtrl = $DIC['ilCtrl'];
33 
34  $this->lng = $lng;
35  $this->ctrl = $ilCtrl;
36 
37  $this->setFormName('questionbrowser');
38  $this->setStyle('table', 'fullwidth');
39 
40  $this->addColumn($this->lng->txt("assessment_log_datetime"), 'datetime', '25%');
41  $this->addColumn($this->lng->txt("user"), 'user', '25%');
42  $this->addColumn($this->lng->txt("assessment_log_text"), 'log', '50%');
43 
44  $this->setRowTemplate("tpl.il_as_tst_history_row.html", "Modules/Test");
45 
46  $this->setDefaultOrderField("datetime");
47  $this->setDefaultOrderDirection("asc");
48 
49  $this->enable('header');
50  }
51 
52  public function setTestObject($obj)
53  {
54  $this->tstObject = $obj;
55  }
56 
64  public function fillRow($data)
65  {
66  global $DIC;
67  $ilUser = $DIC['ilUser'];
68  $ilAccess = $DIC['ilAccess'];
69 
70  $username = $this->tstObject->userLookupFullName($data["user_fi"], true);
71  $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($data["tstamp"], IL_CAL_UNIX)));
72  $this->tpl->setVariable("USER", $username);
73  $this->tpl->setVariable("LOG", trim(ilUtil::prepareFormOutput($data["logtext"])));
74  }
75 }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setStyle($a_element, $a_style)
global $DIC
Definition: saml.php:7
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
enable($a_module_name)
enables particular modules of table
Date and time handling
$ilUser
Definition: imgupload.php:18
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormName($a_formname="")
Set Form name.
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.