3 declare(strict_types=1);
59 $this->main_tpl = $DIC->ui()->mainTemplate();
67 $DIC->language()->loadLanguageModule(
'lti');
69 $DIC->tabs()->addSubTab(
70 self::SUBTAB_ID_OBJECT_SETTINGS,
71 $DIC->language()->txt(self::SUBTAB_ID_OBJECT_SETTINGS),
72 $DIC->ctrl()->getLinkTarget($this)
76 $DIC->tabs()->addSubTab(
77 self::SUBTAB_ID_PROVIDER_SETTINGS,
78 $DIC->language()->txt(self::SUBTAB_ID_PROVIDER_SETTINGS),
79 $DIC->ctrl()->getLinkTargetByClass(ilLTIConsumeProviderSettingsGUI::class)
85 if ($validator->validate()) {
86 $DIC->tabs()->addSubTab(
87 self::SUBTAB_ID_CERTIFICATE,
88 $DIC->language()->txt(self::SUBTAB_ID_CERTIFICATE),
89 $DIC->ctrl()->getLinkTargetByClass(ilCertificateGUI::class,
'certificateEditor')
98 if ($this->
object->getProvider()->isGlobal()) {
102 if ($this->
object->getProvider()->getCreator() != $DIC->user()->getId()) {
115 if ($provider->
getCreator() != $DIC->user()->getId()) {
130 $access = $DIC->access();
132 if (!$access->
checkAccess(
'write',
'', $this->object->getRefId())) {
133 $DIC->ui()->mainTemplate()->setOnScreenMessage(
'failure', $DIC->language()->txt(
'permission_denied'),
true);
138 $nc = $DIC->ctrl()->getNextClass();
141 case strtolower(ilCertificateGUI::class):
145 if (!$validator->validate()) {
149 $DIC->tabs()->activateSubTab(self::SUBTAB_ID_CERTIFICATE);
152 $gui = $guiFactory->create($this->
object);
154 $DIC->ctrl()->forwardCommand($gui);
158 case strtolower(ilLTIConsumeProviderSettingsGUI::class):
160 $DIC->tabs()->activateSubTab(self::SUBTAB_ID_PROVIDER_SETTINGS);
163 $DIC->ctrl()->forwardCommand($gui);
167 $DIC->tabs()->activateSubTab(self::SUBTAB_ID_OBJECT_SETTINGS);
168 $command = $DIC->ctrl()->getCmd(self::CMD_SHOW_SETTINGS) .
'Cmd';
179 if ($form === null) {
183 $DIC->ui()->mainTemplate()->setContent($form->getHTML());
192 if ($form->checkInput()) {
193 $oldMasteryScore = $this->
object->getMasteryScore();
195 $form->initObject($this->
object);
196 $this->
object->update();
198 if ($oldMasteryScore !== $this->
object->getMasteryScore()) {
202 $this->main_tpl->setOnScreenMessage(
'success', $DIC->language()->txt(
'msg_obj_modified'),
true);
203 $DIC->ctrl()->redirect($this, self::CMD_SHOW_SETTINGS);
215 $DIC->ctrl()->getFormAction($this),
216 self::CMD_SAVE_SETTINGS,
217 self::CMD_SHOW_SETTINGS
229 if (!$validator->isCertificateDownloadable($DIC->user()->getId(), $this->
object->getId())) {
230 $this->main_tpl->setOnScreenMessage(
'failure', $DIC->language()->txt(
"permission_denied"),
true);
236 $certLogger = $DIC->logger()->cert();
243 $DIC->language()->txt(
'error_creating_certificate_pdf')
246 $pdfAction->
downloadPdf($DIC->user()->getId(), $this->
object->getId());
static get(string $a_var)
Class ilPdfGeneratorConstantsTest.
const SUBTAB_ID_OBJECT_SETTINGS
__construct(ilObjLTIConsumer $object, ilLTIConsumerAccess $access)
ilLTIConsumerAccess constructor.
executeCommand()
Execute Command.
ilGlobalTemplateInterface $main_tpl
checkAccess(string $permission)
static isUserDynamicRegistrationTransaction(ilLTIConsumeProvider $provider)
Validates if an active certificate is stored in the database and can be downloaded by the user...
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
showSettingsCmd(ilLTIConsumerSettingsFormGUI $form=null)
Just a wrapper class to create Unit Test for other classes.
const CMD_DELIVER_CERTIFICATE
needsProviderSettingsSubTab()
const SUBTAB_ID_CERTIFICATE
const SUBTAB_ID_PROVIDER_SETTINGS
ilLTIConsumerAccess $access
downloadPdf(int $userId, int $objectId)