ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  {
90  $data[] = $row;
91  }
92  $this->setData($data);
93  }
94 
95 
100  protected function fillRow($a_set)
101  {
102  global $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 $ilCtrl;
114 
115 
116  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
117  $this->setRowTemplate('tpl.scorm_track_item_per_user.html', 'Modules/ScormAicc');
118  $this->setTitle(
119  $this->getSco()->getTitle().' - '.
121  );
122 
123  $this->addColumn($this->lng->txt('cont_lvalue'), 'lvalue', '50%');
124  $this->addColumn($this->lng->txt('cont_rvalue'), 'rvalue', '50%');
125  }
126 }
127 ?>