ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSCORMTrackingItemsPerUserTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Table/classes/class.ilTable2GUI.php';
5
13{
14 private $obj_id = 0;
15 private $user_id = 0;
16
20 public function __construct($a_obj_id, $a_parent_obj, $a_parent_cmd)
21 {
22 $this->obj_id = $a_obj_id;
23
24 $this->setId('sco_trs_usr_' . $this->obj_id);
25 parent::__construct($a_parent_obj, $a_parent_cmd);
26 }
27
32 public function getObjId()
33 {
34 return $this->obj_id;
35 }
36
41 public function setUserId($a_usr_id)
42 {
43 $this->user_id = $a_usr_id;
44 }
45
50 public function getUserId()
51 {
52 return $this->user_id;
53 }
54
58 public function parse()
59 {
60 $this->initTable();
61
62 $user_data = $this->getParentObject()->object->getTrackingDataAgg($this->getUserId());
63 $data = array();
64 foreach ($user_data as $row) {
65 $data[] = $row;
66 }
67 $this->setData($data);
68 }
69
70
75 protected function fillRow($a_set)
76 {
77 global $DIC;
78 $ilCtrl = $DIC['ilCtrl'];
79
80 $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
81
82 $ilCtrl->setParameter($this->getParentObject(), 'user_id', $this->getUserId());
83 $ilCtrl->setParameter($this->getParentObject(), 'obj_id', $a_set['sco_id']);
84 $this->tpl->setVariable('LINK_SCO', $ilCtrl->getLinkTarget($this->getParentObject(), 'showTrackingItemPerUser'));
85
86 $this->tpl->setVariable('VAL_STATUS', $a_set['status']);
87 $this->tpl->setVariable('VAL_TIME', $a_set['time']);
88 $this->tpl->setVariable('VAL_SCORE', $a_set['score']);
89 }
90
94 protected function initTable()
95 {
96 global $DIC;
97 $ilCtrl = $DIC['ilCtrl'];
98
99
100 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
101 $this->setRowTemplate('tpl.scorm_track_item.html', 'Modules/ScormAicc');
103
104 $this->addColumn($this->lng->txt('title'), 'title', '35%');
105 $this->addColumn($this->lng->txt('cont_status'), 'status', '25%');
106 $this->addColumn($this->lng->txt('cont_time'), 'time', '20%');
107 $this->addColumn($this->lng->txt('cont_score'), 'score', '20%');
108 }
109}
An exception for terminatinating execution or to throw for unit testing.
static _lookupFullname($a_user_id)
Lookup Full Name.
__construct($a_obj_id, $a_parent_obj, $a_parent_cmd)
Constructor.
Class ilTable2GUI.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc