ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSCORMTrackingItemPerUserTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Table/classes/class.ilTable2GUI.php';
5 
13 {
14  private $obj_id = 0;
15  private $user_id = 0;
16  private $sco = null;
17 
21  public function __construct($a_obj_id, $a_parent_obj, $a_parent_cmd)
22  {
23  $this->obj_id = $a_obj_id;
24 
25  $this->setId('sco_tr_usr_' . $this->obj_id);
26  parent::__construct($a_parent_obj, $a_parent_cmd);
27  }
28 
33  public function getObjId()
34  {
35  return $this->obj_id;
36  }
37 
42  public function setUserId($a_usr_id)
43  {
44  $this->user_id = $a_usr_id;
45  }
46 
51  public function getUserId()
52  {
53  return $this->user_id;
54  }
55 
60  public function setScoId($a_sco_id)
61  {
62  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
63  $this->sco = new ilSCORMItem($a_sco_id);
64  }
65 
70  public function getSco()
71  {
72  return $this->sco;
73  }
74 
78  public function parse()
79  {
80  $this->initTable();
81 
82  $sco_data = $this->getParentObject()->object->getTrackingDataPerUser(
83  $this->getSco()->getId(),
84  $this->getUserId()
85  );
86 
87  $data = array();
88  foreach ($sco_data as $row) {
89  $data[] = $row;
90  }
91  $this->setData($data);
92  }
93 
94 
99  protected function fillRow($a_set)
100  {
101  global $DIC;
102  $ilCtrl = $DIC['ilCtrl'];
103 
104  $this->tpl->setVariable('VAR', $a_set['lvalue']);
105  $this->tpl->setVariable('VAL', $a_set['rvalue']);
106  }
107 
111  protected function initTable()
112  {
113  global $DIC;
114  $ilCtrl = $DIC['ilCtrl'];
115 
116 
117  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
118  $this->setRowTemplate('tpl.scorm_track_item_per_user.html', 'Modules/ScormAicc');
119  $this->setTitle(
120  $this->getSco()->getTitle() . ' - ' .
122  );
123 
124  $this->addColumn($this->lng->txt('cont_lvalue'), 'lvalue', '50%');
125  $this->addColumn($this->lng->txt('cont_rvalue'), 'rvalue', '50%');
126  }
127 }
global $DIC
Definition: saml.php:7
static _lookupFullname($a_user_id)
Lookup Full Name.
getParentObject()
Get parent object.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
SCORM Item.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
$row
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
getId()
Get element id.
__construct($a_obj_id, $a_parent_obj, $a_parent_cmd)
Constructor.