ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSCORMTrackingItemsPerScoTableGUI.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 
19  public function __construct($a_obj_id, $a_parent_obj, $a_parent_cmd)
20  {
21  $this->obj_id = $a_obj_id;
22 
23  $this->setId('sco_trs_usr_' . $this->obj_id);
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25  }
26 
31  public function getObjId()
32  {
33  return $this->obj_id;
34  }
35 
39  public function parse()
40  {
41  $this->initTable();
42 
43  $scos = $this->getParentObject()->object->getTrackedItems();
44 
45  $data = array();
46  foreach ($scos as $row) {
47  $tmp = array();
48  $tmp['title'] = $row->getTitle();
49  $tmp['id'] = $row->getId();
50 
51  $data[] = $tmp;
52  }
53  $this->setData($data);
54  }
55 
56 
61  protected function fillRow($a_set)
62  {
63  global $DIC;
64  $ilCtrl = $DIC['ilCtrl'];
65 
66  $this->tpl->setVariable('TXT_ITEM_TITLE', $a_set['title']);
67  $ilCtrl->setParameter($this->getParentObject(), 'obj_id', $a_set['id']);
68  $this->tpl->setVariable('LINK_ITEM', $ilCtrl->getLinkTarget($this->getParentObject(), 'showTrackingItemSco'));
69  }
70 
74  protected function initTable()
75  {
76  global $DIC;
77  $ilCtrl = $DIC['ilCtrl'];
78 
79 
80  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
81  $this->setRowTemplate('tpl.scorm_track_items_sco.html', 'Modules/ScormAicc');
82  $this->setTitle($this->lng->txt('cont_tracking_items'));
83 
84  $this->addColumn($this->lng->txt('title'), 'title', '100%');
85  }
86 }
global $DIC
Definition: saml.php:7
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.
__construct($a_obj_id, $a_parent_obj, $a_parent_cmd)
Constructor.
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.