ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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', '25%');
39  $this->addColumn($this->lng->txt("user"), 'user', '25%');
40  $this->addColumn($this->lng->txt("assessment_log_text"), 'log', '50%');
41 
42  $this->setRowTemplate("tpl.il_as_tst_history_row.html", "Modules/Test");
43 
44  $this->setDefaultOrderField("datetime");
45  $this->setDefaultOrderDirection("asc");
46 
47  $this->enable('header');
48  }
49 
50  public function setTestObject($obj)
51  {
52  $this->tstObject = $obj;
53  }
54 
62  public function fillRow($data)
63  {
64  global $ilUser,$ilAccess;
65 
66  $username = $this->tstObject->userLookupFullName($data["user_fi"], true);
67  $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($data["tstamp"], IL_CAL_UNIX)));
68  $this->tpl->setVariable("USER", $username);
69  $this->tpl->setVariable("LOG", trim(ilUtil::prepareFormOutput($data["logtext"])));
70  }
71 }
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)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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.
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.