ILIAS  release_8 Revision v8.24
class.ilLTIConsumerVerificationTableGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
30{
35 public function __construct(?ilObjLTIConsumerVerificationGUI $a_parent_obj, ?string $a_parent_cmd = "")
36 {
37 global $DIC; /* @var \ILIAS\DI\Container $DIC */
38
39 parent::__construct($a_parent_obj, $a_parent_cmd);
40
41 $this->addColumn($this->lng->txt("title"), "title");
42 $this->addColumn($this->lng->txt("passed"), "passed");
43 $this->addColumn($this->lng->txt("action"), "");
44
45 $this->setTitle($this->lng->txt("ltiv_create"));
46 $this->setDescription($this->lng->txt("ltiv_create_info"));
47
48 $this->setRowTemplate("tpl.lti_verification_row.html", "Modules/LTIConsumer");
49 $this->setFormAction($DIC->ctrl()->getFormAction($a_parent_obj, $a_parent_cmd));
50
51 $this->getItems();
52 }
53
57 protected function getItems(): void
58 {
59 global $DIC; /* @var \ILIAS\DI\Container $DIC */
60
61 $userCertificateRepository = new ilUserCertificateRepository(
62 $DIC->database(),
63 $DIC->logger()->root()
64 );
65
66 $certificateArray = $userCertificateRepository->fetchActiveCertificatesByTypeForPresentation(
67 $DIC->user()->getId(),
68 'lti'
69 );
70
71 $data = array();
72
73 foreach ($certificateArray as $certificate) {
74 $data[] = array(
75 'id' => $certificate->getUserCertificate()->getObjId(),
76 'title' => $certificate->getObjectTitle(),
77 'passed' => true
78 );
79 }
80
81 $this->setData($data);
82 }
83
87 protected function fillRow(array $a_set): void
88 {
89 global $DIC; /* @var \ILIAS\DI\Container $DIC */
90
91 $this->tpl->setVariable("TITLE", $a_set["title"]);
92 $this->tpl->setVariable("PASSED", ($a_set["passed"]) ? $this->lng->txt("yes") :
93 $this->lng->txt("no"));
94
95 if ($a_set["passed"]) {
96 $DIC->ctrl()->setParameter($this->parent_obj, "lti_id", $a_set["id"]);
97 $action = $DIC->ctrl()->getLinkTarget($this->parent_obj, "save");
98 $this->tpl->setVariable("URL_SELECT", $action);
99 $this->tpl->setVariable("TXT_SELECT", $this->lng->txt("select"));
100 }
101 }
102}
__construct(?ilObjLTIConsumerVerificationGUI $a_parent_obj, ?string $a_parent_cmd="")
Constructor.
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="")
setDescription(string $a_val)
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.
setData(array $a_data)
Set table data.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc