ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCORMTrackingItemsPerScoTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
27{
28 private int $obj_id;
29
30 public function __construct(int $a_obj_id, ?object $a_parent_obj, string $a_parent_cmd)
31 {
32 $this->obj_id = $a_obj_id;
33
34 $this->setId('sco_trs_usr_' . $this->obj_id);
35 parent::__construct($a_parent_obj, $a_parent_cmd);
36 }
37
38 public function getObjId(): int
39 {
40 return $this->obj_id;
41 }
42
46 public function parse(): void
47 {
48 $this->initTable();
49
50 $scos = $this->getParentObject()->getTrackedItems();
51
52 $data = array();
53 foreach ($scos as $row) {
54 $tmp = array();
55 $tmp['title'] = $row->getTitle();
56 $tmp['id'] = $row->getId();
57
58 $data[] = $tmp;
59 }
60 $this->setData($data);
61 }
62
63
67 protected function fillRow(array $a_set): void
68 {
69 global $DIC;
70 $ilCtrl = $DIC->ctrl();
71
72 $this->tpl->setVariable('TXT_ITEM_TITLE', $a_set['title']);
73 $ilCtrl->setParameter($this->getParentObject(), 'obj_id', $a_set['id']);
74 $this->tpl->setVariable('LINK_ITEM', $ilCtrl->getLinkTarget($this->getParentObject(), 'showTrackingItemSco'));
75 }
76
77 protected function initTable(): void
78 {
79 global $DIC;
80 $ilCtrl = $DIC->ctrl();
81
82
83 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
84 $this->setRowTemplate('tpl.scorm_track_items_sco.html', 'components/ILIAS/ScormAicc');
85 $this->setTitle($this->lng->txt('cont_tracking_items'));
86
87 $this->addColumn($this->lng->txt('title'), 'title', '100%');
88 }
89}
__construct(int $a_obj_id, ?object $a_parent_obj, string $a_parent_cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26