ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAssessmentFolderLogTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
27  public function __construct(ilObjAssessmentFolderGUI $a_parent_obj, string $a_parent_cmd)
28  {
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30 
31  global $DIC;
32  $lng = $DIC['lng'];
33  $ilCtrl = $DIC['ilCtrl'];
34 
35  $this->lng = $lng;
36  $this->ctrl = $ilCtrl;
37 
38  $this->setFormName('showlog');
39  $this->setStyle('table', 'fullwidth');
40 
41  $this->addColumn($this->lng->txt("assessment_log_datetime"), 'date', '10%');
42  $this->addColumn($this->lng->txt("user"), 'user', '20%');
43  $this->addColumn($this->lng->txt("assessment_log_text"), 'message', '50%');
44  $this->addColumn($this->lng->txt("ass_location"), '', '20%');
45 
46  $this->setRowTemplate("tpl.il_as_tst_assessment_log_row.html", "Modules/Test");
47 
48  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
49 
50  $this->setDefaultOrderField("date");
51  $this->setDefaultOrderDirection("asc");
52 
53  $this->enable('header');
54  $this->enable('sort');
55  $this->disable('select_all');
56  }
57 
58  protected function fillRow(array $a_set): void
59  {
60  $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime((int) $a_set['tstamp'], IL_CAL_UNIX)));
61  $user = ilObjUser::_lookupName((int) $a_set["user_fi"]);
62  $this->tpl->setVariable(
63  "USER",
65  trim($user["title"] . " " . $user["firstname"] . " " . $user["lastname"])
66  )
67  );
68 
69  $title = "";
70  if ($a_set["question_fi"] || $a_set["original_fi"]) {
71  $title = assQuestion::_getQuestionTitle((int) $a_set["question_fi"]);
72  if ($title === '') {
73  $title = assQuestion::_getQuestionTitle((int) $a_set["original_fi"]);
74  }
75  $title = $this->lng->txt("assessment_log_question") . ": " . $title;
76  }
77  $this->tpl->setVariable(
78  "MESSAGE",
79  ilLegacyFormElementsUtil::prepareFormOutput($a_set['logtext']) . (($title !== '') ? " (" . $title . ")" : '')
80  );
81 
82  if ($a_set['location_href'] !== '' && $a_set['location_txt'] !== '') {
83  $this->tpl->setVariable("LOCATION_HREF", $a_set['location_href']);
84  $this->tpl->setVariable("LOCATION_TXT", $a_set['location_txt']);
85  }
86  }
87 }
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
Class ilObjAssessmentFolderGUI.
static _getQuestionTitle(int $question_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _lookupName(int $a_user_id)
lookup user name
static prepareFormOutput($a_str, bool $a_strip=false)
const IL_CAL_UNIX
setFormName(string $a_name="")
ilLanguage $lng
global $DIC
Definition: feed.php:28
setStyle(string $a_element, string $a_style)
__construct(ilObjAssessmentFolderGUI $a_parent_obj, string $a_parent_cmd)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
disable(string $a_module_name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...