ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilLTIProviderReleasedObjectsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 {
29  //only because type in ilObjectTableGUI - could be erased
30  public function __construct(?object $a_parent_obj, string $a_parent_cmd, $a_id)
31  {
32  $this->setId('obj_table_' . $a_id);
33  parent::__construct($a_parent_obj, $a_parent_cmd, "");
34  }
35 
39  public function init(): void
40  {
41  if ($this->enabledRowSelectionInput()) {
42  $this->addColumn('', 'id', '5px');
43  }
44 
45  $this->addColumn($this->lng->txt('type'), 'type', '30px');
46  $this->addColumn($this->lng->txt('title'), 'title');
47  $this->addColumn($this->lng->txt('lti_consumer'), 'consumer', '30%');
48 
49  $this->setOrderColumn('title');
50  $this->setRowTemplate('tpl.lti_object_table_row.html', 'components/ILIAS/LTIProvider');
51  }
52 
57  public function fillRow(array $a_set): void
58  {
59  if (!isset($a_set['type'])) {
60  $a_set['type'] = '';
61  }
62 
63  parent::fillRow($a_set);
64 
65  $this->tpl->setVariable('CONSUMER_TITLE', $a_set['consumer']);
66  }
67 
68  public function parse(): void
69  {
71 
72  $counter = 0;
73  $set = array();
74  foreach ($rows as $row) {
75  $ref_id = (int) $row['ref_id'];
76 
77 
79  if ($type == 'rolf') {
80  continue;
81  }
82 
83  $set[$counter]['ref_id'] = $ref_id;
84  $set[$counter]['obj_id'] = ilObject::_lookupObjId($ref_id);
85  $set[$counter]['type'] = ilObject::_lookupType(ilObject::_lookupObjId($ref_id));
86  $set[$counter]['title'] = ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id));
87  $set[$counter]['consumer'] = $row['title'];
88  $counter++;
89  }
90  $this->setData($set);
91  }
92 }
setData(array $a_data)
static readReleaseObjects()
Read released objects.
__construct(?object $a_parent_obj, string $a_parent_cmd, $a_id)
setId(string $a_val)
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
__construct(Container $dic, ilPlugin $plugin)
Settings for LO courses.
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)
static _lookupType(int $id, bool $reference=false)
setOrderColumn(string $a_order_column="", string $a_default_column="")