ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestHistoryTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once('./Services/Table/classes/class.ilTable2GUI.php');
25 
35 {
36  protected $tstObject;
37 
45  public function __construct($a_parent_obj, $a_parent_cmd)
46  {
47  parent::__construct($a_parent_obj, $a_parent_cmd);
48 
49  global $lng, $ilCtrl;
50 
51  $this->lng = $lng;
52  $this->ctrl = $ilCtrl;
53 
54  $this->setFormName('questionbrowser');
55  $this->setStyle('table', 'fullwidth');
56 
57  $this->addColumn($this->lng->txt("assessment_log_datetime"),'datetime', '');
58  $this->addColumn($this->lng->txt("user"),'user', '');
59  $this->addColumn($this->lng->txt("assessment_log_text"),'log', '');
60  $this->addColumn($this->lng->txt("location"),'location', '');
61 
62  $this->setRowTemplate("tpl.il_as_tst_history_row.html", "Modules/Test");
63 
64  $this->setDefaultOrderField("datetime");
65  $this->setDefaultOrderDirection("asc");
66 
67  $this->enable('header');
68  }
69 
70  public function setTestObject($obj)
71  {
72  $this->tstObject = $obj;
73  }
74 
82  public function fillRow($data)
83  {
84  global $ilUser,$ilAccess;
85 
86  $username = $this->tstObject->userLookupFullName($data["user_fi"], TRUE);
87  $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($data["tstamp"],IL_CAL_UNIX)));
88  $this->tpl->setVariable("USER", $username);
89  $this->tpl->setVariable("LOG", trim(ilUtil::prepareFormOutput($data["logtext"])));
90  $location = '';
91  if (strlen($data["ref_id"]) && strlen($data["href"]))
92  {
93  $location = '<a href="' . $data['href'] . '">' . $this->lng->txt("perma_link") . '</a>';
94  }
95  $this->tpl->setVariable("LOCATION", $location);
96  }
97 }
98 ?>