ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLTIConsumeProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
32{
33 protected int $id = 0;
34
35 protected string $title = '';
36
37 protected string $description = '';
38
40 public const AVAILABILITY_NONE = 0; // Provider is not longer available (error message)
41 public const AVAILABILITY_EXISTING = 1; // Existing objects can still use the provider, new objects not
42 public const AVAILABILITY_CREATE = 2; // New objects can use this provider
43
44 protected string $remarks = '';
45
46 protected int $time_to_delete = 0;
47
48 protected int $log_level = 0;
49
50 protected string $provider_url = '';
51
52 protected string $provider_key = '';
53
54 protected string $provider_secret = '';
55
56 protected bool $provider_key_customizable = true;
57
58 protected string $provider_icon_filename = '';
59
64
69 protected ?array $providerIconUploadFileData = null;
70
71 public const CATEGORY_ASSESSMENT = 'assessment';
72 public const CATEGORY_FEEDBACK = 'feedback';
73 public const CATEGORY_CONTENT = 'content';
74 public const CATEGORY_COMMUNICATION = 'communication';
75 public const CATEGORY_ORGANISATION = 'organisation';
80
81 protected string $provider_xml = '';
82
83 protected bool $is_external_provider = false;
84
85 //ToDo : necessary?
86 public const LAUNCH_METHOD_OWN = 'ownWin';
87 public const LAUNCH_METHOD_NEW = 'newWin';
89
90 protected bool $has_outcome = false;
91
92 protected float $mastery_score = 0.8;
93
94 protected bool $keep_lp = false;
95
99 public const PRIVACY_IDENT_REAL_EMAIL = 3;
103
104 public const PRIVACY_NAME_NONE = 0;
105 public const PRIVACY_NAME_FIRSTNAME = 1;
106 public const PRIVACY_NAME_LASTNAME = 2;
107 public const PRIVACY_NAME_FULLNAME = 3;
109
110 protected bool $include_user_picture = false;
111
112 protected string $privacy_comment_default = '';
113
114 protected bool $always_learner = false;
115
116 protected bool $use_provider_id = false;
117
118 protected bool $use_xapi = false;
119
120 protected string $xapi_launch_url = '';
121
122 protected string $xapi_launch_key = '';
123
124 protected string $xapi_launch_secret = '';
125
126 protected string $xapi_activity_id = '';
127
128 protected string $custom_params = '';
129
130 protected string $keywords = '';
131
132 protected int $creator = 0;
133
134 protected int $accepted_by = 0;
135
136 protected bool $is_global = false;
137
138 protected bool $instructor_send_name = false;
139
140 protected bool $instructor_send_email = false;
141
142 protected string $client_id = '';
143
144 protected string $enabled_capability = '';
145
146 protected string $key_type = '';
147
148 protected string $public_key = '';
149
150 protected string $public_keyset = '';
151
152 protected string $initiate_login = '';
153
154 protected string $redirection_uris = '';
155
156 protected bool $content_item = false;
157
158 protected string $content_item_url = '';
159
160 protected bool $grade_synchronization = false;
161
162 protected string $lti_version = 'LTI-1p0';
163
164
169 public function __construct(?int $providerId = null)
170 {
171 if ($providerId) {
172 $this->setId($providerId);
173 $this->load();
174 }
175 }
176
181 public static function getInstance(?int $providerId = null): ilLTIConsumeProvider
182 {
183 return new self($providerId);
184 }
185
186 public function getId(): int
187 {
188 return $this->id;
189 }
190
191 public function setId(int $id): void
192 {
193 $this->id = $id;
194 }
195
196 public function getTitle(): string
197 {
198 return $this->title;
199 }
200
201 public function setTitle(string $title): void
202 {
203 $this->title = $title;
204 }
205
206 public function getDescription(): string
207 {
208 return $this->description;
209 }
210
211 public function setDescription(string $description): void
212 {
213 $this->description = $description;
214 }
215
216 public function getAvailability(): int
217 {
218 return $this->availability;
219 }
220
221 public function setAvailability(int $availability): void
222 {
223 $this->availability = $availability;
224 }
225
226 public function getRemarks(): string
227 {
228 return $this->remarks;
229 }
230
231 public function setRemarks(string $remarks): void
232 {
233 $this->remarks = $remarks;
234 }
235
236 public function getTimeToDelete(): int
237 {
239 }
240
241 public function setTimeToDelete(int $time_to_delete): void
242 {
243 $this->time_to_delete = $time_to_delete;
244 }
245
246 public function getLogLevel(): int
247 {
248 return $this->log_level;
249 }
250
251 public function setLogLevel(int $log_level): void
252 {
253 $this->log_level = $log_level;
254 }
255
256 public function getProviderUrl(): string
257 {
258 return $this->provider_url;
259 }
260
261 public function setProviderUrl(string $provider_url): void
262 {
263 $this->provider_url = $provider_url;
264 }
265
266 public function getProviderKey(): string
267 {
268 return $this->provider_key;
269 }
270
271 public function setProviderKey(string $provider_key): void
272 {
273 $this->provider_key = $provider_key;
274 }
275
276 public function getProviderSecret(): string
277 {
279 }
280
281 public function setProviderSecret(string $provider_secret): void
282 {
283 $this->provider_secret = $provider_secret;
284 }
285
286 public function isProviderKeyCustomizable(): bool
287 {
289 }
290
292 {
293 $this->provider_key_customizable = $provider_key_customizable;
294 }
295
296 public function getProviderIconFilename(): string
297 {
299 }
300
302 {
303 $this->provider_icon_filename = $provider_icon_filename;
304 }
305
307 {
308 return $this->providerIcon;
309 }
310
311 public function hasProviderIcon(): bool
312 {
313 if (!($this->providerIcon instanceof ilLTIConsumeProviderIcon)) {
314 return false;
315 }
316
317 return (bool) strlen($this->providerIcon->getFilename());
318 }
319
321 {
322 $this->providerIcon = $providerIcon;
323 }
324
325 public function hasProviderIconUploadInput(): bool
326 {
327 return $this->providerIconUploadInput instanceof ilImageFileInputGUI;
328 }
329
331 {
333 }
334
339 {
340 $this->providerIconUploadInput = $providerIconUploadInput;
341 }
342
343 public function getProviderIconUploadFileData(): array
344 {
346 }
347
349 {
350 $this->providerIconUploadFileData = $providerIconUploadFileData;
351 }
352
356 public static function getCategoriesSelectOptions(): array
357 {
358 global $DIC; /* @var \ILIAS\DI\Container $DIC */
359
360 $categories = [];
361 $translation = '';
362
363 foreach (self::getValidCategories() as $category) {
364 switch ($category) {
366
367 $translation = $DIC->language()->txt('rep_add_new_def_grp_organisation');
368 break;
370
371 $translation = $DIC->language()->txt('rep_add_new_def_grp_communication');
372 break;
374
375 $translation = $DIC->language()->txt('rep_add_new_def_grp_content');
376 break;
378
379 $translation = $DIC->language()->txt('rep_add_new_def_grp_assessment');
380 break;
382
383 $translation = $DIC->language()->txt('rep_add_new_def_grp_feedback');
384 break;
385 }
386
387 $categories[$category] = $translation;
388 }
389
390 return $categories;
391 }
392
393 public static function getValidCategories(): array
394 {
395 return [
401 ];
402 }
403
404 public function isValidCategory(string $category): bool
405 {
406 return in_array($category, self::getValidCategories());
407 }
408
409 public function getCategory(): string
410 {
411 return $this->category;
412 }
413
414 public function setCategory(string $category): void
415 {
416 $this->category = $category;
417 }
418
419 public function getProviderXml(): string
420 {
421 return $this->provider_xml;
422 }
423
424 public function setProviderXml(string $provider_xml): void
425 {
426 $this->provider_xml = $provider_xml;
427 }
428
429 public function isExternalProvider(): bool
430 {
432 }
433
435 {
436 $this->is_external_provider = $is_external_provider;
437 }
438
439 public function getLaunchMethod(): string
440 {
442 }
443
444 public function setLaunchMethod(string $launch_method): void
445 {
446 $this->launch_method = $launch_method;
447 }
448
449 public function getHasOutcome(): bool
450 {
451 return $this->has_outcome;
452 }
453
454 public function setHasOutcome(bool $has_outcome): void
455 {
456 $this->has_outcome = $has_outcome;
457 }
458
459 public function getMasteryScore(): float
460 {
462 }
463
464 public function setMasteryScore(float $mastery_score): void
465 {
466 $this->mastery_score = $mastery_score;
467 }
468
469 public function getMasteryScorePercent(): float
470 {
471 return $this->mastery_score * 100;
472 }
473
474 public function setMasteryScorePercent(float $mastery_score_percent): void
475 {
476 $this->mastery_score = $mastery_score_percent / 100;
477 }
478
479 public function isKeepLp(): bool
480 {
481 return $this->keep_lp;
482 }
483
484 public function setKeepLp(bool $keep_lp): void
485 {
486 $this->keep_lp = $keep_lp;
487 }
488
489
490 public function getPrivacyIdent(): int
491 {
493 }
494
495 public function setPrivacyIdent(int $privacy_ident): void
496 {
497 $this->privacy_ident = $privacy_ident;
498 }
499
500 public function getPrivacyName(): int
501 {
502 return $this->privacy_name;
503 }
504
505 public function setPrivacyName(int $privacy_name): void
506 {
507 $this->privacy_name = $privacy_name;
508 }
509
510 public function getIncludeUserPicture(): bool
511 {
513 }
514
516 {
517 $this->include_user_picture = $include_user_picture;
518 }
519
520 public function getPrivacyCommentDefault(): string
521 {
523 }
524
526 {
527 $this->privacy_comment_default = $privacy_comment_default;
528 }
529
530 public function getAlwaysLearner(): bool
531 {
533 }
534
535 public function setAlwaysLearner(bool $always_learner): void
536 {
537 $this->always_learner = $always_learner;
538 }
539
540 public function getUseProviderId(): bool
541 {
543 }
544
545 public function setUseProviderId(bool $use_provider_id): void
546 {
547 $this->use_provider_id = $use_provider_id;
548 }
549
550 public function getUseXapi(): bool
551 {
552 return $this->use_xapi;
553 }
554
555 public function setUseXapi(bool $use_xapi): void
556 {
557 $this->use_xapi = $use_xapi;
558 }
559
560 public function getXapiLaunchUrl(): string
561 {
563 }
564
565 public function setXapiLaunchUrl(string $xapi_launch_url): void
566 {
567 $this->xapi_launch_url = $xapi_launch_url;
568 }
569
570 public function getXapiLaunchKey(): string
571 {
573 }
574
575 public function setXapiLaunchKey(string $xapi_launch_key): void
576 {
577 $this->xapi_launch_key = $xapi_launch_key;
578 }
579
580 public function getXapiLaunchSecret(): string
581 {
583 }
584
585 public function setXapiLaunchSecret(string $xapi_launch_secret): void
586 {
587 $this->xapi_launch_secret = $xapi_launch_secret;
588 }
589
590 public function getXapiActivityId(): string
591 {
593 }
594
595 public function setXapiActivityId(string $xapi_activity_id): void
596 {
597 $this->xapi_activity_id = $xapi_activity_id;
598 }
599
600 public function getCustomParams(): string
601 {
603 }
604
605 public function setCustomParams(string $custom_params): void
606 {
607 $this->custom_params = $custom_params;
608 }
609
613 public function getKeywordsArray(): array
614 {
615 $keywords = [];
616
617 foreach (explode(';', $this->getKeywords()) as $keyword) {
618 $keywords[] = trim($keyword);
619 }
620
621 return $keywords;
622 }
623
624 public function getKeywords(): string
625 {
626 return $this->keywords;
627 }
628
629 public function setKeywords(string $keywords): void
630 {
631 $this->keywords = $keywords;
632 }
633
634 public function getCreator(): int
635 {
636 return $this->creator;
637 }
638
639 public function setCreator(int $creator): void
640 {
641 $this->creator = $creator;
642 }
643
644 public function getAcceptedBy(): int
645 {
646 return $this->accepted_by;
647 }
648
649 public function setAcceptedBy(int $accepted_by): void
650 {
651 $this->accepted_by = $accepted_by;
652 }
653
654 public function isGlobal(): bool
655 {
656 return $this->is_global;
657 }
658
659 public function setIsGlobal(bool $is_global): void
660 {
661 $this->is_global = $is_global;
662 }
663
664 public function isInstructorSendName(): bool
665 {
667 }
668
670 {
671 $this->instructor_send_name = $instructor_send_name;
672 }
673
674 public function isInstructorSendEmail(): bool
675 {
677 }
678
680 {
681 $this->instructor_send_email = $instructor_send_email;
682 }
683
684 public function getClientId(): string
685 {
686 if ($this->client_id == '') {
687 //ohne Sonderzeichen
688 $this->client_id = ilObjLTIConsumer::getNewClientId();
689 }
690 return $this->client_id;
691 }
692
693 public function setClientId(string $client_id): void
694 {
695 $this->client_id = $client_id;
696 }
697
698 public function getEnabledCapability(): string
699 {
701 }
702
703 public function setEnabledCapability(string $enabled_capability): void
704 {
705 $this->enabled_capability = $enabled_capability;
706 }
707
708 public function getKeyType(): string
709 {
710 return $this->key_type;
711 }
712
713 public function setKeyType(string $key_type): void
714 {
715 $this->key_type = $key_type;
716 }
717
718 public function getPublicKey(): string
719 {
720 return $this->public_key;
721 }
722
723 public function setPublicKey(string $public_key): void
724 {
725 $this->public_key = $public_key;
726 }
727
728 public function getPublicKeyset(): string
729 {
731 }
732
733 public function setPublicKeyset(string $public_keyset): void
734 {
735 $this->public_keyset = $public_keyset;
736 }
737
738 public function getInitiateLogin(): string
739 {
741 }
742
743 public function setInitiateLogin(string $initiate_login): void
744 {
745 $this->initiate_login = $initiate_login;
746 }
747
748 public function getRedirectionUris(): string
749 {
751 }
752
753 public function setRedirectionUris(string $redirection_uris): void
754 {
755 $this->redirection_uris = $redirection_uris;
756 }
757
758 public function isContentItem(): bool
759 {
760 return $this->content_item;
761 }
762
763 public function setContentItem(bool $content_item): void
764 {
765 $this->content_item = $content_item;
766 }
767
768 public function getContentItemUrl(): string
769 {
771 }
772
773 public function setContentItemUrl(string $content_item_url): void
774 {
775 $this->content_item_url = $content_item_url;
776 }
777
778 public function isGradeSynchronization(): bool
779 {
781 }
782
784 {
785 $this->grade_synchronization = $grade_synchronization;
786 }
787
788 public function getLtiVersion(): string
789 {
790 return $this->lti_version;
791 }
792
793 public function setLtiVersion(string $lti_version): void
794 {
795 $this->lti_version = $lti_version;
796 }
797
798
799
800
804 public function assignFromDbRow(array $dbRow): void
805 {
806 foreach ($dbRow as $field => $value) {
807 switch ($field) {
808 case 'id': $this->setId((int) $value);
809 break;
810 case 'title': $this->setTitle($value);
811 break;
812 case 'description': $this->setDescription($value);
813 break;
814 case 'availability': $this->setAvailability((int) $value);
815 break;
816 case 'remarks': $this->setRemarks($value);
817 break;
818 case 'time_to_delete': $this->setTimeToDelete((int) $value);
819 break;
820 case 'log_level': $this->setLogLevel((int) $value);
821 break;
822 case 'provider_url': $this->setProviderUrl($value);
823 break;
824 case 'provider_key': $this->setProviderKey($value);
825 break;
826 case 'provider_secret': $this->setProviderSecret($value);
827 break;
828 case 'provider_key_customizable': $this->setProviderKeyCustomizable((bool) $value);
829 break;
830 case 'provider_icon': $this->setProviderIconFilename($value);
831 break;
832 case 'category': $this->setCategory($value);
833 break;
834 case 'provider_xml': $this->setProviderXml($value);
835 break;
836 case 'external_provider': $this->setIsExternalProvider((bool) $value);
837 break;
838 case 'launch_method': $this->setLaunchMethod($value);
839 break;
840 case 'has_outcome': $this->setHasOutcome((bool) $value);
841 break;
842 case 'mastery_score': $this->setMasteryScore((float) $value);
843 break;
844 case 'keep_lp': $this->setKeepLp((bool) $value);
845 break;
846 case 'privacy_ident': $this->setPrivacyIdent((int) $value);
847 break;
848 case 'privacy_name': $this->setPrivacyName((int) $value);
849 break;
850 case 'inc_usr_pic': $this->setIncludeUserPicture((bool) $value);
851 break;
852 case 'privacy_comment_default': $this->setPrivacyCommentDefault($value);
853 break;
854 case 'always_learner': $this->setAlwaysLearner((bool) $value);
855 break;
856 case 'use_provider_id': $this->setUseProviderId((bool) $value);
857 break;
858 case 'use_xapi': $this->setUseXapi((bool) $value);
859 break;
860 case 'xapi_launch_url': $this->setXapiLaunchUrl((string) $value);
861 break;
862 case 'xapi_launch_key': $this->setXapiLaunchKey((string) $value);
863 break;
864 case 'xapi_launch_secret': $this->setXapiLaunchSecret((string) $value);
865 break;
866 case 'xapi_activity_id': $this->setXapiActivityId((string) $value);
867 break;
868 case 'custom_params': $this->setCustomParams((string) $value);
869 break;
870 case 'keywords': $this->setKeywords((string) $value);
871 break;
872 case 'creator': $this->setCreator((int) $value);
873 break;
874 case 'accepted_by': $this->setAcceptedBy((int) $value);
875 break;
876 case 'global': $this->setIsGlobal((bool) $value);
877 break;
878 case 'instructor_send_name': $this->setInstructorSendName((bool) $value);
879 break;
880 case 'instructor_send_email': $this->setInstructorSendEmail((bool) $value);
881 break;
882 case 'client_id': $this->setClientId((string) $value);
883 break;
884 case 'enabled_capability': $this->setEnabledCapability((string) $value);
885 break;
886 case 'key_type': $this->setKeyType((string) $value);
887 break;
888 case 'public_key': $this->setPublicKey((string) $value);
889 break;
890 case 'public_keyset': $this->setPublicKeyset((string) $value);
891 break;
892 case 'initiate_login': $this->setInitiateLogin((string) $value);
893 break;
894 case 'redirection_uris': $this->setRedirectionUris((string) $value);
895 break;
896 case 'content_item': $this->setContentItem((bool) $value);
897 break;
898 case 'content_item_url': $this->setContentItemUrl((string) $value);
899 break;
900 case 'grade_synchronization': $this->setGradeSynchronization((bool) $value);
901 break;
902 case 'lti_version': $this->setLtiVersion((string) $value);
903 break;
904 }
905 }
906
907 $this->setProviderIcon(new ilLTIConsumeProviderIcon($this->getId()));
908 $this->getProviderIcon()->setFilename($this->getProviderIconFilename());
909 }
910
914 public function load(): void
915 {
916 global $DIC; /* @var \ILIAS\DI\Container $DIC */
917
918 $query = "SELECT * FROM lti_ext_provider WHERE id = %s";
919 $res = $DIC->database()->queryF($query, array('integer'), array($this->getId()));
920
921 while ($row = $DIC->database()->fetchAssoc($res)) {
922 $this->assignFromDbRow($row);
923 }
924 }
925
929 public static function getProviderIdFromClientId(string $clientId): int
930 {
931 global $DIC; /* @var \ILIAS\DI\Container $DIC */
932
933 $query = "SELECT * FROM lti_ext_provider WHERE client_id = %s";
934 $res = $DIC->database()->queryF($query, array('text'), array($clientId));
935 $id = 0;
936 while ($row = $DIC->database()->fetchAssoc($res)) {
937 $id = (int) $row['id'];
938 }
939 return $id;
940 }
941
947 public function save(): void
948 {
949 if ($this->getId() !== 0) {
950 if ($this->hasProviderIconUploadInput()) {
951 $this->getProviderIcon()->handleUploadInputSubission($this->getProviderIconUploadInput(), $this->getProviderIconUploadFileData());
952 $this->setProviderIconFilename($this->getProviderIcon()->getFilename());
953 }
954
955 $this->update();
956 } else {
957 $this->insert();
958
959 if ($this->hasProviderIconUploadInput()) {
960 $this->setProviderIcon(new ilLTIConsumeProviderIcon($this->getId()));
961
962 $this->getProviderIcon()->handleUploadInputSubission($this->getProviderIconUploadInput(), $this->getProviderIconUploadFileData());
963 $this->setProviderIconFilename($this->getProviderIcon()->getFilename());
964
965 $this->update();
966 }
967 }
968 }
969
970 public function update(): void
971 {
972 global $DIC; /* @var \ILIAS\DI\Container $DIC */
973
974 $DIC->database()->update('lti_ext_provider', $this->getInsertUpdateFields(), array(
975 'id' => array('integer', $this->getId()),
976 ));
977 }
978
979 public function insert(): void
980 {
981 global $DIC; /* @var \ILIAS\DI\Container $DIC */
982
983 $this->setId($DIC->database()->nextId('lti_ext_provider'));
984
985 $DIC->database()->insert('lti_ext_provider', $this->getInsertUpdateFields());
986 }
987
991 protected function getInsertUpdateFields(): array
992 {
993 return array(
994 'id' => array('integer', $this->getId()),
995 'title' => array('text', $this->getTitle()),
996 'description' => array('text', $this->getDescription()),
997 'availability' => array('integer', $this->getAvailability()),
998 'remarks' => array('text', $this->getRemarks()),
999 'time_to_delete' => array('integer', $this->getTimeToDelete()),
1000 'provider_url' => array('text', $this->getProviderUrl()),
1001 'provider_key' => array('text', $this->getProviderKey()),
1002 'provider_secret' => array('text', $this->getProviderSecret()),
1003 'provider_key_customizable' => array('integer', $this->isProviderKeyCustomizable()),
1004 'provider_icon' => array('text', $this->getProviderIconFilename()),
1005 'category' => array('text', $this->getCategory()),
1006 'provider_xml' => array('text', $this->getProviderXml()),
1007 'external_provider' => array('integer', $this->isExternalProvider()),
1008 'launch_method' => array('text', $this->getLaunchMethod()),
1009 'has_outcome' => array('integer', $this->getHasOutcome()),
1010 'mastery_score' => array('float', $this->getMasteryScore()),
1011 'keep_lp' => array('integer', $this->isKeepLp()),
1012 'privacy_ident' => array('integer', $this->getPrivacyIdent()),
1013 'privacy_name' => array('integer', $this->getPrivacyName()),
1014 'inc_usr_pic' => array('integer', $this->getIncludeUserPicture()),
1015 'privacy_comment_default' => array('text', $this->getPrivacyCommentDefault()),
1016 'always_learner' => array('integer', $this->getAlwaysLearner()),
1017 'use_provider_id' => array('integer', $this->getUseProviderId()),
1018 'use_xapi' => array('integer', $this->getUseXapi()),
1019 'xapi_launch_url' => array('text', $this->getXapiLaunchUrl()),
1020 'xapi_launch_key' => array('text', $this->getXapiLaunchKey()),
1021 'xapi_launch_secret' => array('text', $this->getXapiLaunchSecret()),
1022 'xapi_activity_id' => array('text', $this->getXapiActivityId()),
1023 'custom_params' => array('text', $this->getCustomParams()),
1024 'keywords' => array('text', $this->getKeywords()),
1025 'creator' => array('integer', $this->getCreator()),
1026 'accepted_by' => array('integer', $this->getAcceptedBy()),
1027 'global' => array('integer', (int) $this->isGlobal()),
1028 'instructor_send_name' => array('integer', (int) $this->isInstructorSendName()),
1029 'instructor_send_email' => array('integer', (int) $this->isInstructorSendEmail()),
1030 'client_id' => array('text', $this->getClientId()),
1031 'enabled_capability' => array('text', $this->getEnabledCapability()),
1032 'key_type' => array('text', $this->getKeyType()),
1033 'public_key' => array('text', $this->getPublicKey()),
1034 'public_keyset' => array('text', $this->getPublicKeyset()),
1035 'initiate_login' => array('text', $this->getInitiateLogin()),
1036 'redirection_uris' => array('text', $this->getRedirectionUris()),
1037 'content_item' => array('integer', (int) $this->isContentItem()),
1038 'content_item_url' => array('text', $this->getContentItemUrl()),
1039 'grade_synchronization' => array('integer', (int) $this->isGradeSynchronization()),
1040 'lti_version' => array('text', $this->getLtiVersion())
1041 );
1042 }
1043
1044 public function delete(): void
1045 {
1046 global $DIC; /* @var \ILIAS\DI\Container $DIC */
1047
1048 $DIC->database()->manipulateF(
1049 "DELETE FROM lti_ext_provider WHERE id = %s",
1050 ['integer'],
1051 [$this->getId()]
1052 );
1053 }
1054
1055 public function isAcceptableAsGlobal(): bool
1056 {
1057 return !$this->isGlobal() && (bool) $this->getCreator();
1058 }
1059
1060 public function isResetableToUserDefined(): bool
1061 {
1062 return $this->isGlobal() && (bool) $this->getCreator();
1063 }
1064
1065 // public function getPlattformId(): string
1066 // {
1067 // return ILIAS_HTTP_PATH;
1068 // }
1069
1070 // public function getAuthenticationRequestUrl(): string
1071 // {
1072 // return ILIAS_HTTP_PATH . "/components/ILIAS/LTIConsumer/ltiauth.php";
1073 // }
1074
1075 // public function getAccessTokenUrl(): string
1076 // {
1077 // return ILIAS_HTTP_PATH . "/components/ILIAS/LTIConsumer/ltitoken.php";
1078 // }
1079
1080 // public function getPublicKeysetUrl(): string
1081 // {
1082 // return ILIAS_HTTP_PATH . "/components/ILIAS/LTIConsumer/lticerts.php";
1083 // }
1084}
Indicates general problems with the input or output operations.
Definition: IOException.php:28
This class represents a property in a property form.
This class represents an image file property in a property form.
setProviderUrl(string $provider_url)
setPrivacyCommentDefault(string $privacy_comment_default)
setPrivacyIdent(int $privacy_ident)
setUseProviderId(bool $use_provider_id)
setCustomParams(string $custom_params)
__construct(?int $providerId=null)
ilLTIConsumeProvider constructor.
setTimeToDelete(int $time_to_delete)
setPublicKeyset(string $public_keyset)
ilLTIConsumeProviderIcon $providerIcon
setDescription(string $description)
setProviderIconUploadFileData(array $providerIconUploadFileData)
ilImageFileInputGUI $providerIconUploadInput
setProviderIconUploadInput(ilFormPropertyGUI $providerIconUploadInput)
setInstructorSendEmail(bool $instructor_send_email)
setXapiLaunchSecret(string $xapi_launch_secret)
setInstructorSendName(bool $instructor_send_name)
setProviderIconFilename(string $provider_icon_filename)
setProviderKey(string $provider_key)
setMasteryScorePercent(float $mastery_score_percent)
setLtiVersion(string $lti_version)
setMasteryScore(float $mastery_score)
static getProviderIdFromClientId(string $clientId)
static getInstance(?int $providerId=null)
Inits class static.
setIncludeUserPicture(bool $include_user_picture)
setIsExternalProvider(bool $is_external_provider)
setXapiLaunchUrl(string $xapi_launch_url)
setContentItemUrl(string $content_item_url)
setAlwaysLearner(bool $always_learner)
setRedirectionUris(string $redirection_uris)
setProviderKeyCustomizable(bool $provider_key_customizable)
setProviderIcon(ilLTIConsumeProviderIcon $providerIcon)
setXapiActivityId(string $xapi_activity_id)
setContentItem(bool $content_item)
setInitiateLogin(string $initiate_login)
setGradeSynchronization(bool $grade_synchronization)
setXapiLaunchKey(string $xapi_launch_key)
setLaunchMethod(string $launch_method)
setProviderSecret(string $provider_secret)
setProviderXml(string $provider_xml)
setEnabledCapability(string $enabled_capability)
$clientId
Definition: ltiregend.php:26
$res
Definition: ltiservices.php:69
if(empty($clientId)) $providerId
Definition: ltitoken.php:79
global $DIC
Definition: shib_login.php:26