ILIAS  release_7 Revision v7.30-3-g800a261c036
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
5include_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->setFormAction($ilCtrl->getFormAction($this->parent_obj, "history"));
39 $this->setStyle('table', 'fullwidth');
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}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setStyle($a_element, $a_style)
enable($a_module_name)
enables particular modules of table
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc