ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLTIConsumeProviderFormGUI Class Reference
+ Inheritance diagram for ilLTIConsumeProviderFormGUI:
+ Collaboration diagram for ilLTIConsumeProviderFormGUI:

Public Member Functions

 __construct (ilLTIConsumeProvider $provider)
 ilLTIConsumeProviderFormGUI constructor. More...
 
 isAdminContext ()
 
 setAdminContext (bool $adminContext)
 
 initForm (string $formaction, string $saveCmd, string $cancelCmd)
 
 initToolConfigForm (string $formaction, string $saveCmd, string $cancelCmd)
 
 initProvider (ilLTIConsumeProvider $provider)
 
 initDynRegForm (string $formaction)
 
 getContentSelectionFrame ($formaction)
 
 getDynRegRequest ()
 
 getDynRegError ()
 
 getProvider ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Protected Attributes

ilLTIConsumeProvider $provider
 
bool $adminContext = false
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 
 checkForRequiredField ()
 

Detailed Description

Definition at line 29 of file class.ilLTIConsumeProviderFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumeProviderFormGUI::__construct ( ilLTIConsumeProvider  $provider)

ilLTIConsumeProviderFormGUI constructor.

Definition at line 44 of file class.ilLTIConsumeProviderFormGUI.php.

References $provider, and ILIAS\MetaData\Repository\Validation\Data\__construct().

45  {
47  $this->provider = $provider;
48  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ getContentSelectionFrame()

ilLTIConsumeProviderFormGUI::getContentSelectionFrame (   $formaction)

Definition at line 942 of file class.ilLTIConsumeProviderFormGUI.php.

References $DIC, ilFormGUI\$formaction, ilPropertyFormGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\clearCommandButtons(), ilPropertyFormGUI\getHTML(), ilFormGUI\setFormAction(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

942  : string
943  {
944  global $DIC;
945  $lng = $DIC->language();
946  $this->setFormAction($formaction);
947  $this->setTitle($lng->txt('lti_form_provider_content_selection'));
948  $this->clearCommandButtons();
949  $this->addCommandButton("cancelContentSelection", $lng->txt('cancel'));
950  $src = $DIC->ctrl()->getLinkTargetByClass(ilObjLTIConsumerGUI::class, 'contentSelectionRequest');
951  $template = new ilTemplate('tpl.lti_content_selection.html', true, true, "Modules/LTIConsumer");
952  $template->setVariable('LTI_CONTENT_SELECTION_IFRAME_SRC', $src);
953  return $this->getHTML() . $template->get();
954  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
string $formaction
+ Here is the call graph for this function:

◆ getDynRegError()

ilLTIConsumeProviderFormGUI::getDynRegError ( )

Definition at line 984 of file class.ilLTIConsumeProviderFormGUI.php.

References $DIC, ilPropertyFormGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\clearCommandButtons(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\removeItemByPostVar(), and ilPropertyFormGUI\setTitle().

984  : string
985  {
986  global $DIC; /* @var \ILIAS\DI\Container $DIC */
987  $lng = $DIC->language();
988  $this->removeItemByPostVar('lti_dyn_reg_url');
989  $this->removeItemByPostVar('lti_dyn_reg_custom_params');
990  $this->setTitle("");
991  $this->clearCommandButtons();
992  $this->addCommandButton("cancelDynReg", $DIC->language()->txt('cancel'));
993  return $this->getHTML();
994  }
removeItemByPostVar(string $a_post_var, bool $a_remove_unused_headers=false)
global $DIC
Definition: feed.php:28
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:

◆ getDynRegRequest()

ilLTIConsumeProviderFormGUI::getDynRegRequest ( )

Definition at line 956 of file class.ilLTIConsumeProviderFormGUI.php.

References $DIC, ilPropertyFormGUI\$lng, ilPropertyFormGUI\clearCommandButtons(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilObjLTIConsumer\getRegistrationEndUrl(), and ilObjLTIConsumer\getRegistrationStartUrl().

956  : string
957  {
958  global $DIC;
959  $lng = $DIC->language();
960  //ToDo: is url format validation?
961  $toolRegUrl = $this->getInput('lti_dyn_reg_url');
962  $customParams = $this->getInput('lti_dyn_reg_custom_params');
963  $regUrl = ilObjLTIConsumer::getRegistrationStartUrl() . "?url=" . urlencode($toolRegUrl);
964  if (!empty($customParams)) {
965  $regUrl .= "&custom_params=" . urlencode($customParams);
966  }
967  $showToolConfigUrl = $DIC->ctrl()->getLinkTargetByClass([ilRepositoryGUI::class,ilObjLTIConsumerGUI::class], 'showToolConfig');
968  $regErrorUrl = $DIC->ctrl()->getLinkTargetByClass([ilRepositoryGUI::class,ilObjLTIConsumerGUI::class], 'addDynReg');
969  $this->getItemByPostVar('lti_dyn_reg_url')->setDisabled(true);
970  $this->getItemByPostVar('lti_dyn_reg_custom_params')->setDisabled(true);
971  $this->clearCommandButtons();
972  //$this->addCommandButton("cancelDynReg", $DIC->language()->txt('cancel'));
973  $template = new ilTemplate('tpl.lti_dyn_reg_request.html', true, true, "Modules/LTIConsumer");
974  $template->setVariable('LTI_TOOL_REG_URL', $toolRegUrl);
975  $template->setVariable('LTI_DYN_REG_URL', $regUrl);
976  $template->setVariable('LTI_DYN_REG_URL_BY_POST', $toolRegUrl);
977  $template->setVariable('LTI_REG_END_URL', ilObjLTIConsumer::getRegistrationEndUrl());
978  $template->setVariable('LTI_SHOW_TOOL_CONFIG_URL', $showToolConfigUrl);
979  $template->setVariable('LTI_REG_ERROR_URL', $regErrorUrl);
980  //$DIC->ui()->mainTemplate()->setOnScreenMessage('info', $lng->txt('lti_dyn_reg_redirect_after_10_secs'));
981  return $template->get() . $this->getHTML();
982  }
getItemByPostVar(string $a_post_var)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getProvider()

ilLTIConsumeProviderFormGUI::getProvider ( )

◆ initDynRegForm()

ilLTIConsumeProviderFormGUI::initDynRegForm ( string  $formaction)

Definition at line 924 of file class.ilLTIConsumeProviderFormGUI.php.

References $DIC, ilPropertyFormGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPropertyFormGUI\clearCommandButtons(), ilFormGUI\setFormAction(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

924  : void
925  {
926  global $DIC; /* @var \ILIAS\DI\Container $DIC */
927  $lng = $DIC->language();
928  $this->setFormAction($formaction);
929  $this->clearCommandButtons();
930 
931  $this->setTitle($lng->txt('lti_form_provider_create'));
932  $regUrlInp = new ilTextInputGUI($lng->txt('lti_con_prov_dyn_reg_url'), 'lti_dyn_reg_url');
933  $regUrlInp->setInfo($lng->txt('lti_con_prov_dyn_reg_url_info'));
934  $regUrlInp->setRequired(true);
935  $this->addItem($regUrlInp);
936  $regParamsInp = new ilTextInputGUI($lng->txt('lti_con_prov_dyn_reg_params'), 'lti_dyn_reg_custom_params');
937  $regParamsInp->setInfo($lng->txt('lti_con_prov_dyn_reg_params_info'));
938  $this->addCommandButton("addDynReg", $DIC->language()->txt('lti_dyn_reg_add_tool'));
939  $this->addItem($regParamsInp);
940  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
string $formaction
+ Here is the call graph for this function:

◆ initForm()

ilLTIConsumeProviderFormGUI::initForm ( string  $formaction,
string  $saveCmd,
string  $cancelCmd 
)

Definition at line 60 of file class.ilLTIConsumeProviderFormGUI.php.

References $DIC, ilPropertyFormGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilSubEnabledFormPropertyGUI\addSubItem(), ilLTIConsumeProvider\AVAILABILITY_CREATE, ilLTIConsumeProvider\AVAILABILITY_EXISTING, ilLTIConsumeProvider\AVAILABILITY_NONE, ilObjLTIConsumer\getAccessTokenUrl(), ilObjLTIConsumer\getAuthenticationRequestUrl(), ilLTIConsumeProvider\getCategoriesSelectOptions(), ilCmiXapiUser\getIliasUuid(), ilObjLTIConsumer\getPlattformId(), ilObjLTIConsumer\getPublicKeysetUrl(), ilLTIConsumeProviderIcon\getSupportedFileExtensions(), isAdminContext(), ilLTIConsumeProvider\PRIVACY_IDENT_IL_UUID_EXT_ACCOUNT, ilLTIConsumeProvider\PRIVACY_IDENT_IL_UUID_LOGIN, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_RANDOM, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_SHA256, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_SHA256URL, ilLTIConsumeProvider\PRIVACY_IDENT_IL_UUID_USER_ID, ilLTIConsumeProvider\PRIVACY_IDENT_REAL_EMAIL, ilLTIConsumeProvider\PRIVACY_NAME_FIRSTNAME, ilLTIConsumeProvider\PRIVACY_NAME_FULLNAME, ilLTIConsumeProvider\PRIVACY_NAME_LASTNAME, ilLTIConsumeProvider\PRIVACY_NAME_NONE, ilFormGUI\setFormAction(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilTextAreaInputGUI\setRows(), ilPropertyFormGUI\setTitle(), ilRadioGroupInputGUI\setValue(), ilTextAreaInputGUI\setValue(), and ilLanguage\txt().

60  : void
61  {
62  global $DIC; /* @var \ILIAS\DI\Container $DIC */
63  $lng = $DIC->language();
64 
65  $this->setFormAction($formaction);
66  $this->addCommandButton($saveCmd, $lng->txt('save'));
67  $this->addCommandButton($cancelCmd, $lng->txt('cancel'));
68 
69  if ($this->provider->getId() !== 0) {
70  $this->setTitle($lng->txt('lti_form_provider_edit'));
71  } else {
72  $this->setTitle($lng->txt('lti_form_provider_create'));
73  }
74 
75  $titleInp = new ilTextInputGUI($lng->txt('lti_con_prov_title'), 'title');
76  $titleInp->setValue($this->provider->getTitle());
77  $titleInp->setRequired(true);
78  $this->addItem($titleInp);
79 
80  $descInp = new ilTextInputGUI($lng->txt('lti_con_prov_description'), 'description');
81  $descInp->setValue($this->provider->getDescription());
82  $this->addItem($descInp);
83 
84  $iconInp = new ilImageFileInputGUI($lng->txt('lti_con_prov_icon'), 'icon');
85  $iconInp->setInfo($lng->txt('obj_tile_image_info'));
87  $iconInp->setUseCache(false);
88  if ($this->provider->hasProviderIcon() && $this->provider->getProviderIcon()->exists()) {
89  $iconInp->setImage($this->provider->getProviderIcon()->getAbsoluteFilePath());
90  } else {
91  $iconInp->setImage('');//todo default image?
92  }
93  $this->addItem($iconInp);
94 
95  if ($this->isAdminContext()) {
96  $availabilityInp = new ilRadioGroupInputGUI($lng->txt('lti_con_prov_availability'), 'availability');
97  $availabilityInp->setValue((string) $this->provider->getAvailability());
98  $availabilityInp->setRequired(true);
99  $optionCreate = new ilRadioOption(
100  $lng->txt('lti_con_prov_availability_create'),
102  );
103  $availabilityInp->addOption($optionCreate);
104  $optionCreate = new ilRadioOption(
105  $lng->txt('lti_con_prov_availability_existing'),
107  );
108  $availabilityInp->addOption($optionCreate);
109  $optionCreate = new ilRadioOption(
110  $lng->txt('lti_con_prov_availability_non'),
112  );
113  $availabilityInp->addOption($optionCreate);
114  $this->addItem($availabilityInp);
115  }
116 
117  $sectionHeader = new ilFormSectionHeaderGUI();
118  $sectionHeader->setTitle($lng->txt('lti_con_prov_authentication'));
119  $this->addItem($sectionHeader);
120 
121  $versionInp = new ilRadioGroupInputGUI($lng->txt('lti_con_version'), 'lti_version');
122 
123  //1.3
124  $lti13 = new ilRadioOption($lng->txt('lti_con_version_1.3'), '1.3.0');
125  if ($this->provider->getId() == 0) {
126  $lti13->setInfo($lng->txt('lti_con_version_1.3_before_id'));
127  }
128  $versionInp->addOption($lti13);
129  $providerUrlInp = new ilTextInputGUI($lng->txt('lti_con_tool_url'), 'provider_url13');
130  $providerUrlInp->setValue($this->provider->getProviderUrl());
131  $providerUrlInp->setRequired(true);
132  $lti13->addSubItem($providerUrlInp);
133 
134  $initiateLogin = new ilTextInputGUI($lng->txt('lti_con_initiate_login_url'), 'initiate_login');
135  $initiateLogin->setValue($this->provider->getInitiateLogin());
136  $initiateLogin->setRequired(true);
137  $lti13->addSubItem($initiateLogin);
138 
139  $redirectionUris = new ilTextAreaInputGUI($lng->txt('lti_con_redirection_uris'), 'redirection_uris');
140  $redirectionUris->setRows(4);
141  $redirectionUris->setValue(implode("\n", explode(",", $this->provider->getRedirectionUris())));
142  $redirectionUris->setRequired(true);
143  $lti13->addSubItem($redirectionUris);
144 
145  //key_type
146  $keyType = new ilRadioGroupInputGUI($lng->txt('lti_con_key_type'), 'key_type');
147  $keyType->setRequired(true);
148  //RSA
149  $keyRsa = new ilRadioOption($lng->txt('lti_con_key_type_rsa'), 'RSA_KEY');
150  $keyType->addOption($keyRsa);
151  $publicKey = new ilTextAreaInputGUI($lng->txt('lti_con_key_type_rsa_public_key'), 'public_key');
152  $publicKey->setRows(6);
153  $publicKey->setRequired(true);
154  $publicKey->setInfo($lng->txt('lti_con_key_type_rsa_public_key_info'));
155  $keyRsa->addSubItem($publicKey);
156  //JWK
157  $keyJwk = new ilRadioOption($lng->txt('lti_con_key_type_jwk'), 'JWK_KEYSET');
158  $keyType->addOption($keyJwk);
159  $keyset = new ilTextInputGUI($lng->txt('lti_con_key_type_jwk_url'), 'public_keyset');
160  $keyset->setValue($this->provider->getPublicKeyset());
161  $keyset->setRequired(true);
162  $keyJwk->addSubItem($keyset);
163 
164  $keyType->setValue($this->provider->getKeyType());
165  $lti13->addSubItem($keyType);
166 
167  $contentItem = new ilCheckboxInputGUI($lng->txt('lti_con_content_item'), 'content_item');
168  $contentItem->setValue('1');
169  $contentItem->setChecked($this->provider->isContentItem());
170 
171  $contentItemUrl = new ilTextInputGUI($lng->txt('lti_con_content_item_url'), 'content_item_url');
172  $contentItemUrl->setValue($this->provider->getContentItemUrl());
173  $contentItem->addSubItem($contentItemUrl);
174  $lti13->addSubItem($contentItem);
175 
176  //grade sync
177  $gradeSynchronization = new ilCheckboxInputGUI($lng->txt('lti_con_grade_synchronization'), 'grade_synchronization');
178  $gradeSynchronization->setInfo($lng->txt('lti_con_grade_synchronization_info'));
179  $gradeSynchronization->setValue('1');
180  $gradeSynchronization->setChecked($this->provider->isGradeSynchronization());
181  $lti13->addSubItem($gradeSynchronization);
182 
183  if ($this->provider->getId() > 0) {
184  $Lti13Info = new ilTextAreaInputGUI($lng->txt('lti13_hints'), 'lti13_hints');
185  $Lti13Info->setRows(6);
186  $Lti13Info->setValue(
187  "Platform ID: \t\t\t\t\t" . ilObjLTIConsumer::getPlattformId()
188  . "\nClient ID: \t\t\t\t\t" . $this->provider->getClientId()
189  . "\nDeployment ID: \t\t\t\t" . (string) $this->provider->getId()
190  . "\nPublic keyset URL: \t\t\t" . ilObjLTIConsumer::getPublicKeysetUrl()
191  . "\nAccess token URL: \t\t\t" . ilObjLTIConsumer::getAccessTokenUrl()
192  . "\nAuthentication request URL: \t" . ilObjLTIConsumer::getAuthenticationRequestUrl()
193  );
194  $Lti13Info->setDisabled(true);
195  $lti13->addSubItem($Lti13Info);
196  }
197 
198  $versionInp->setValue($this->provider->getLtiVersion());
199  $this->addItem($versionInp);
200 
201  $lti11 = new ilRadioOption($lng->txt('lti_con_version_1.1'), 'LTI-1p0');
202  $versionInp->addOption($lti11);
203 
204  $providerUrlInp = new ilTextInputGUI($lng->txt('lti_con_prov_url'), 'provider_url');
205  $providerUrlInp->setValue($this->provider->getProviderUrl());
206  $providerUrlInp->setRequired(true);
207  $lti11->addSubItem($providerUrlInp);
208  // Abfrage ob Key und secret von Objekterstellern eingegeben werden soll
209  $keyGlobal = new ilCheckboxInputGUI($lng->txt('lti_con_prov_provider_key_global'), 'provider_key_global');
210  $keyGlobal->setValue("1");
211  if (!$this->provider->isProviderKeyCustomizable()) {
212  $keyGlobal->setChecked(true);
213  }
214  $keyGlobal->setInfo($lng->txt('lti_con_prov_provider_key_global_info'));
215 
216  $providerKeyInp = new ilTextInputGUI($lng->txt('lti_con_prov_key'), 'provider_key');
217  $providerKeyInp->setValue($this->provider->getProviderKey());
218  $providerKeyInp->setRequired(true);
219  $keyGlobal->addSubItem($providerKeyInp);
220 
221  $providerSecretInp = new ilTextInputGUI($lng->txt('lti_con_prov_secret'), 'provider_secret');
222  $providerSecretInp->setValue($this->provider->getProviderSecret());
223  $providerSecretInp->setRequired(true);
224  $keyGlobal->addSubItem($providerSecretInp);
225  $lti11->addSubItem($keyGlobal);
226 
227  //privacy-settings
228 
229  $sectionHeader = new ilFormSectionHeaderGUI();
230  $sectionHeader->setTitle($lng->txt('lti_con_prov_privacy_settings'));
231  $this->addItem($sectionHeader);
232 
233  $item = new ilRadioGroupInputGUI($lng->txt('clti_privacy_ident'), 'privacy_ident');
234  $op = new ilRadioOption(
235  $lng->txt('clti_privacy_ident_il_uuid_user_id'),
237  );
238  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_user_id_info'));
239  $item->addOption($op);
240  $op = new ilRadioOption(
241  $lng->txt('clti_privacy_ident_il_uuid_login'),
243  );
244  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_login_info'));
245  $item->addOption($op);
246  $op = new ilRadioOption(
247  $lng->txt('clti_privacy_ident_il_uuid_ext_account'),
249  );
250  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_ext_account_info'));
251  $item->addOption($op);
252  $op = new ilRadioOption(
253  $lng->txt('clti_privacy_ident_il_uuid_sha256'),
255  );
256  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_sha256_info'));
257  $item->addOption($op);
258  $op = new ilRadioOption(
259  $lng->txt('clti_privacy_ident_il_uuid_sha256url'),
261  );
262  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_sha256url_info'));
263  $item->addOption($op);
264 
265  $op = new ilRadioOption(
266  $lng->txt('clti_privacy_ident_il_uuid_random'),
268  );
269  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_random_info'));
270  $item->addOption($op);
271 
272  $op = new ilRadioOption(
273  $lng->txt('clti_privacy_ident_real_email'),
275  );
276  $op->setInfo($lng->txt('clti_privacy_ident_real_email_info'));
277  $item->addOption($op);
278  $item->setValue((string) $this->provider->getPrivacyIdent());
279  $item->setInfo(
280  $lng->txt('clti_privacy_ident_info') . ' ' . ilCmiXapiUser::getIliasUuid() . '.ilias'
281  );
282  $item->setRequired(false);
283  $this->addItem($item);
284 
285  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_email'), 'instructor_email');
286  $item->setValue("1");
287  if ($this->provider->isInstructorSendEmail()) {
288  $item->setChecked(true);
289  }
290  $item->setInfo($lng->txt('lti_con_prov_instructor_email_info'));
291  $this->addItem($item);
292 
293  $item = new ilRadioGroupInputGUI($lng->txt('clti_privacy_name'), 'privacy_name');
294  $op = new ilRadioOption($lng->txt('clti_privacy_name_none'), (string) ilLTIConsumeProvider::PRIVACY_NAME_NONE);
295  $op->setInfo($lng->txt('clti_privacy_name_none_info'));
296  $item->addOption($op);
297  $op = new ilRadioOption($lng->txt('clti_privacy_name_firstname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FIRSTNAME);
298  $item->addOption($op);
299  $op = new ilRadioOption($lng->txt('clti_privacy_name_lastname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_LASTNAME);
300  $item->addOption($op);
301  $op = new ilRadioOption($lng->txt('clti_privacy_name_fullname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FULLNAME);
302  $item->addOption($op);
303  $item->setValue((string) $this->provider->getPrivacyName());
304  $item->setInfo($lng->txt('clti_privacy_name_info'));
305  $item->setRequired(false);
306  $this->addItem($item);
307 
308  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_name'), 'instructor_name');
309  $item->setValue("1");
310  if ($this->provider->isInstructorSendName()) {
311  $item->setChecked(true);
312  }
313  $item->setInfo($lng->txt('lti_con_prov_instructor_name_info'));
314  $this->addItem($item);
315 
316  $includeUserImage = new ilCheckboxInputGUI($lng->txt('lti_con_prov_inc_usr_pic'), 'inc_usr_pic');
317  $includeUserImage->setInfo($lng->txt('lti_con_prov_inc_usr_pic_info'));
318  $includeUserImage->setChecked($this->provider->getIncludeUserPicture());
319  $this->addItem($includeUserImage);
320 
321  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_external_provider'), 'is_external_provider');
322  $item->setValue("1");
323  if ($this->provider->IsExternalProvider()) {
324  $item->setChecked(true);
325  }
326  $item->setInfo($lng->txt('lti_con_prov_external_provider_info'));
327  $this->addItem($item);
328 
329 
330  $sectionHeader = new ilFormSectionHeaderGUI();
331  $sectionHeader->setTitle($lng->txt('lti_con_prov_learning_progress_options'));
332  $this->addItem($sectionHeader);
333  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_has_outcome_service'), 'has_outcome_service');
334  $item->setValue("1");
335  if ($this->provider->getHasOutcome()) {
336  $item->setChecked(true);
337  }
338  $item->setInfo($lng->txt('lti_con_prov_has_outcome_service_info'));
339  $masteryScore = new ilNumberInputGUI($lng->txt('lti_con_prov_mastery_score_default'), 'mastery_score');
340  $masteryScore->setInfo($lng->txt('lti_con_prov_mastery_score_default_info'));
341  $masteryScore->setSuffix('%');
342  $masteryScore->allowDecimals(true);
343  $masteryScore->setDecimals(2);
344  $masteryScore->setMinvalueShouldBeGreater(false);
345  $masteryScore->setMinValue(0);
346  $masteryScore->setMaxvalueShouldBeLess(false);
347  $masteryScore->setMaxValue(100);
348  $masteryScore->setSize(4);
349  $masteryScore->setValue((string) $this->provider->getMasteryScorePercent());
350  $item->addSubItem($masteryScore);
351  $this->addItem($item);
352 
353  $sectionHeader = new ilFormSectionHeaderGUI();
354  $sectionHeader->setTitle($lng->txt('lti_con_prov_launch_options'));
355  $this->addItem($sectionHeader);
356 
357  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_provider_id'), 'use_provider_id');
358  $item->setValue("1");
359  if ($this->provider->getUseProviderId()) {
360  $item->setChecked(true);
361  }
362  $item->setInfo($lng->txt('lti_con_prov_use_provider_id_info'));
363 
364  $this->addItem($item);
365 
366  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_always_learner'), 'always_learner');
367  $item->setValue("1");
368  if ($this->provider->getAlwaysLearner()) {
369  $item->setChecked(true);
370  }
371  $item->setInfo($lng->txt('lti_con_prov_always_learner_info'));
372  $this->addItem($item);
373 
374  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_xapi'), 'use_xapi');
375  $item->setValue("1");
376  if ($this->provider->getUseXapi()) {
377  $item->setChecked(true);
378  }
379  $item->setInfo($lng->txt('lti_con_prov_use_xapi_info'));
380 
381  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_url'), 'xapi_launch_url');
382  $subitem->setValue($this->provider->getXapiLaunchUrl());
383  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_url_info'));
384  $subitem->setRequired(true);
385  $subitem->setMaxLength(255);
386  $item->addSubItem($subitem);
387 
388  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_key'), 'xapi_launch_key');
389  $subitem->setValue($this->provider->getXapiLaunchKey());
390  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_key_info'));
391  $subitem->setRequired(true);
392  $subitem->setMaxLength(64);
393  $item->addSubItem($subitem);
394 
395  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_secret'), 'xapi_launch_secret');
396  $subitem->setValue($this->provider->getXapiLaunchSecret());
397  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_secret_info'));
398  $subitem->setRequired(true);
399  $subitem->setMaxLength(64);
400  $item->addSubItem($subitem);
401 
402  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_activity_id'), 'xapi_activity_id');
403  $subitem->setValue($this->provider->getXapiActivityId());
404  $subitem->setInfo($lng->txt('lti_con_prov_xapi_activity_id_info'));
405  $subitem->setMaxLength(128);
406  $item->addSubItem($subitem);
407 
408  $this->addItem($item);
409 
410  $item = new ilTextAreaInputGUI($lng->txt('lti_con_prov_custom_params'), 'custom_params');
411  $item->setValue($this->provider->getCustomParams());
412 
413  $item->setRows(6);
414  $item->setInfo($lng->txt('lti_con_prov_custom_params_info'));
415  $this->addItem($item);
416 
417  $sectionHeader = new ilFormSectionHeaderGUI();
418  $sectionHeader->setTitle($lng->txt('lti_con_prov_group_options'));
419  $this->addItem($sectionHeader);
420 
421  $item = new ilTextInputGUI($lng->txt('lti_con_prov_keywords'), 'keywords');
422  $item->setValue($this->provider->getKeywords());
423  $item->setInfo($lng->txt('lti_con_prov_keywords_info'));
424  $item->setMaxLength(1000);
425  $this->addItem($item);
426 
427  $category = new ilRadioGroupInputGUI($lng->txt('lti_con_prov_category'), 'category');
428  $category->setInfo($lng->txt('lti_con_prov_category_info'));
429  $category->setValue($this->provider->getCategory());
430  $category->setRequired(true);
431  foreach (ilLTIConsumeProvider::getCategoriesSelectOptions() as $value => $label) {
432  $category->addOption(new ilRadioOption($label, $value));
433  }
434  $this->addItem($category);
435 
436  $sectionHeader = new ilFormSectionHeaderGUI();
437  $sectionHeader->setTitle($lng->txt('lti_con_prov_hints'));
438  $this->addItem($sectionHeader);
439 
440  $remarksInp = new ilTextAreaInputGUI($lng->txt('lti_con_prov_remarks'), 'remarks');
441  $remarksInp->setValue($this->provider->getRemarks());
442  $remarksInp->setRows(6);
443  $this->addItem($remarksInp);
444  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
This class represents a property in a property form.
setFormAction(string $a_formaction)
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents an image file property in a property form.
This class represents a text area property in a property form.
string $formaction
+ Here is the call graph for this function:

◆ initProvider()

ilLTIConsumeProviderFormGUI::initProvider ( ilLTIConsumeProvider  $provider)

Definition at line 843 of file class.ilLTIConsumeProviderFormGUI.php.

References ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilLTIConsumeProvider\getKeyType(), ilLTIConsumeProvider\getLtiVersion(), isAdminContext(), ilLTIConsumeProvider\isContentItem(), ilLTIConsumeProvider\isProviderKeyCustomizable(), ilLTIConsumeProvider\isValidCategory(), ilLTIConsumeProvider\setAlwaysLearner(), ilLTIConsumeProvider\setAvailability(), ilLTIConsumeProvider\setCategory(), ilLTIConsumeProvider\setContentItem(), ilLTIConsumeProvider\setContentItemUrl(), ilLTIConsumeProvider\setCustomParams(), ilLTIConsumeProvider\setDescription(), ilLTIConsumeProvider\setGradeSynchronization(), ilLTIConsumeProvider\setHasOutcome(), ilLTIConsumeProvider\setIncludeUserPicture(), ilLTIConsumeProvider\setInitiateLogin(), ilLTIConsumeProvider\setInstructorSendEmail(), ilLTIConsumeProvider\setInstructorSendName(), ilLTIConsumeProvider\setIsExternalProvider(), ilLTIConsumeProvider\setKeyType(), ilLTIConsumeProvider\setKeywords(), ilLTIConsumeProvider\setLtiVersion(), ilLTIConsumeProvider\setMasteryScorePercent(), ilLTIConsumeProvider\setPrivacyIdent(), ilLTIConsumeProvider\setPrivacyName(), ilLTIConsumeProvider\setProviderIconUploadFileData(), ilLTIConsumeProvider\setProviderIconUploadInput(), ilLTIConsumeProvider\setProviderKey(), ilLTIConsumeProvider\setProviderKeyCustomizable(), ilLTIConsumeProvider\setProviderSecret(), ilLTIConsumeProvider\setProviderUrl(), ilLTIConsumeProvider\setPublicKey(), ilLTIConsumeProvider\setPublicKeyset(), ilLTIConsumeProvider\setRedirectionUris(), ilLTIConsumeProvider\setRemarks(), ilLTIConsumeProvider\setTitle(), ilLTIConsumeProvider\setUseProviderId(), ilLTIConsumeProvider\setUseXapi(), ilLTIConsumeProvider\setXapiActivityId(), ilLTIConsumeProvider\setXapiLaunchKey(), ilLTIConsumeProvider\setXapiLaunchSecret(), and ilLTIConsumeProvider\setXapiLaunchUrl().

843  : void
844  {
845  $provider->setTitle($this->getInput('title'));
846  $provider->setDescription($this->getInput('description'));
847 
848  $provider->setProviderIconUploadFileData((array) $this->getInput('icon'));
849  $provider->setProviderIconUploadInput($this->getItemByPostVar('icon'));
850 
851  $provider->setHasOutcome((bool) $this->getInput('has_outcome_service'));
852  $provider->setMasteryScorePercent($this->getInput('mastery_score'));
853 
854  if ($this->isAdminContext()) {
855  $provider->setAvailability((int) $this->getInput('availability'));
856  }
857 
858  //authenticate
859  $provider->setLtiVersion($this->getInput('lti_version'));
860  if ($provider->getLtiVersion() == 'LTI-1p0') {
861  if (null !== $this->getInput('provider_url')) {
862  $provider->setProviderUrl($this->getInput('provider_url'));
863  }
864  if ($this->getInput('provider_key_global') == 1) {
865  $provider->setProviderKeyCustomizable(false);
866  $provider->setProviderKey($this->getInput('provider_key'));
867  $provider->setProviderSecret($this->getInput('provider_secret'));
868  } else {
869  $provider->setProviderKeyCustomizable(true);
870  }
871  } else {
872  if (null !== $this->getInput('provider_url13')) {
873  $provider->setProviderUrl($this->getInput('provider_url13'));
874  }
875  $provider->setInitiateLogin($this->getInput('initiate_login'));
876  if (preg_match_all('/\S+/sm', $this->getInput('redirection_uris'), $redirect_uris_matches)) {
877  $provider->setRedirectionUris(implode(",", $redirect_uris_matches[0]));
878  } else {
879  $provider->setRedirectionUris($this->provider->getInitiateLogin());
880  }
881  $provider->setKeyType($this->getInput('key_type'));
882  if ($provider->getKeyType() == 'RSA_KEY') {
883  $provider->setPublicKey($this->getInput('public_key'));
884  } else {
885  $provider->setPublicKeyset($this->getInput('public_keyset'));
886  }
887  $provider->setContentItem((bool) $this->getInput('content_item'));
888  //ToDo: maybe its usefull to seperate the switch from the content field
889  if ($provider->isContentItem()) {
890  $provider->setContentItemUrl($this->getInput('content_item_url'));
891  }
892  $provider->setGradeSynchronization((bool) $this->getInput('grade_synchronization'));
893  }
894  $provider->setPrivacyIdent((int) $this->getInput('privacy_ident'));
895  $provider->setInstructorSendEmail((bool) $this->getInput('instructor_email'));
896  $provider->setPrivacyName((int) $this->getInput('privacy_name'));
897  $provider->setInstructorSendName((bool) $this->getInput('instructor_name'));
898  $provider->setIncludeUserPicture((bool) $this->getInput('inc_usr_pic'));
899  $provider->setIsExternalProvider((bool) $this->getInput('is_external_provider'));
900 
901  $provider->setAlwaysLearner((bool) $this->getInput('always_learner'));
902 
903  $provider->setUseProviderId((bool) $this->getInput('use_provider_id'));
904  $provider->setXapiActivityId($this->getInput('xapi_activity_id'));
905 
906  $provider->setUseXapi((bool) $this->getInput('use_xapi'));
907  $provider->setXapiLaunchUrl($this->getInput('xapi_launch_url'));
908  $provider->setXapiLaunchKey($this->getInput('xapi_launch_key'));
909  $provider->setXapiLaunchSecret($this->getInput('xapi_launch_secret'));
910  $provider->setCustomParams($this->getInput('custom_params'));
911  $provider->setKeywords($this->getInput('keywords'));
912 
913  if ($provider->isValidCategory($this->getInput('category'))) {
914  $provider->setCategory($this->getInput('category'));
915  }
916 
917  if ($provider->isProviderKeyCustomizable()) {
918  $provider->setProviderKey($this->getInput('provider_key'));
919  $provider->setProviderSecret($this->getInput('provider_secret'));
920  }
921  $provider->setRemarks($this->getInput('remarks'));
922  }
setGradeSynchronization(bool $grade_synchronization)
setInitiateLogin(string $initiate_login)
setPublicKeyset(string $public_keyset)
setIsExternalProvider(bool $is_external_provider)
getItemByPostVar(string $a_post_var)
setContentItemUrl(string $content_item_url)
setContentItem(bool $content_item)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
setMasteryScorePercent(float $mastery_score_percent)
setXapiLaunchSecret(string $xapi_launch_secret)
setInstructorSendEmail(bool $instructor_send_email)
setXapiLaunchUrl(string $xapi_launch_url)
setIncludeUserPicture(bool $include_user_picture)
setRedirectionUris(string $redirection_uris)
setUseProviderId(bool $use_provider_id)
setPrivacyIdent(int $privacy_ident)
setCustomParams(string $custom_params)
setProviderIconUploadFileData(array $providerIconUploadFileData)
setProviderKey(string $provider_key)
setAlwaysLearner(bool $always_learner)
setXapiActivityId(string $xapi_activity_id)
setProviderKeyCustomizable(bool $provider_key_customizable)
setInstructorSendName(bool $instructor_send_name)
setProviderIconUploadInput(ilFormPropertyGUI $providerIconUploadInput)
setXapiLaunchKey(string $xapi_launch_key)
setLtiVersion(string $lti_version)
setProviderSecret(string $provider_secret)
setDescription(string $description)
setProviderUrl(string $provider_url)
+ Here is the call graph for this function:

◆ initToolConfigForm()

ilLTIConsumeProviderFormGUI::initToolConfigForm ( string  $formaction,
string  $saveCmd,
string  $cancelCmd 
)

Definition at line 446 of file class.ilLTIConsumeProviderFormGUI.php.

References $DIC, ilPropertyFormGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilLTIConsumeProvider\AVAILABILITY_CREATE, ilLTIConsumeProvider\AVAILABILITY_EXISTING, ilLTIConsumeProvider\AVAILABILITY_NONE, ilSession\get(), ilObjLTIConsumer\getAccessTokenUrl(), ilObjLTIConsumer\getAuthenticationRequestUrl(), ilLTIConsumeProvider\getCategoriesSelectOptions(), ilCmiXapiUser\getIliasUuid(), ilObjLTIConsumer\getPlattformId(), ilObjLTIConsumer\getPublicKeysetUrl(), ilLTIConsumeProviderIcon\getSupportedFileExtensions(), ilSession\has(), isAdminContext(), ilLTIConsumerSettingsGUI\isUserDynamicRegistrationTransaction(), ilLTIConsumeProvider\PRIVACY_IDENT_IL_UUID_EXT_ACCOUNT, ilLTIConsumeProvider\PRIVACY_IDENT_IL_UUID_LOGIN, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_RANDOM, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_SHA256, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_SHA256URL, ilLTIConsumeProvider\PRIVACY_IDENT_IL_UUID_USER_ID, ilLTIConsumeProvider\PRIVACY_IDENT_REAL_EMAIL, ilLTIConsumeProvider\PRIVACY_NAME_FIRSTNAME, ilLTIConsumeProvider\PRIVACY_NAME_FULLNAME, ilLTIConsumeProvider\PRIVACY_NAME_LASTNAME, ilLTIConsumeProvider\PRIVACY_NAME_NONE, ilFormPropertyGUI\setDisabled(), ilFormGUI\setFormAction(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilTextAreaInputGUI\setRows(), ilPropertyFormGUI\setTitle(), ilRadioGroupInputGUI\setValue(), ilTextAreaInputGUI\setValue(), and ilLanguage\txt().

446  : void
447  {
448  global $DIC; /* @var \ILIAS\DI\Container $DIC */
449  $lng = $DIC->language();
450 
451  $this->setFormAction($formaction);
452  $this->addCommandButton($saveCmd, $lng->txt('save'));
453 
454  $this->setTitle($lng->txt('lti_form_provider_edit'));
455 
456  $titleInp = new ilTextInputGUI($lng->txt('lti_con_prov_title'), 'title');
457  $titleInp->setValue($this->provider->getTitle());
458  $titleInp->setRequired(true);
459  $this->addItem($titleInp);
460 
461  $descInp = new ilTextInputGUI($lng->txt('lti_con_prov_description'), 'description');
462  $descInp->setValue($this->provider->getDescription());
463  $this->addItem($descInp);
464 
465  $iconInp = new ilImageFileInputGUI($lng->txt('lti_con_prov_icon'), 'icon');
466  $iconInp->setInfo($lng->txt('obj_tile_image_info'));
468  $iconInp->setUseCache(false);
469  if ($this->provider->hasProviderIcon() && $this->provider->getProviderIcon()->exists()) {
470  $iconInp->setImage($this->provider->getProviderIcon()->getAbsoluteFilePath());
471  } else {
472  $iconInp->setImage('');//todo default image?
473  }
474  $this->addItem($iconInp);
475 
476  if ($this->isAdminContext()) {
477  $availabilityInp = new ilRadioGroupInputGUI($lng->txt('lti_con_prov_availability'), 'availability');
478  $availabilityInp->setValue((string) $this->provider->getAvailability());
479  $availabilityInp->setRequired(true);
480  $optionCreate = new ilRadioOption(
481  $lng->txt('lti_con_prov_availability_create'),
483  );
484  $availabilityInp->addOption($optionCreate);
485  $optionCreate = new ilRadioOption(
486  $lng->txt('lti_con_prov_availability_existing'),
488  );
489  $availabilityInp->addOption($optionCreate);
490  $optionCreate = new ilRadioOption(
491  $lng->txt('lti_con_prov_availability_non'),
493  );
494  $availabilityInp->addOption($optionCreate);
495  $this->addItem($availabilityInp);
496  }
497 
498  $sectionHeader = new ilFormSectionHeaderGUI();
499  $sectionHeader->setTitle($lng->txt('lti_con_prov_authentication'));
500  $this->addItem($sectionHeader);
501 
502  $versionInp = new ilRadioGroupInputGUI($lng->txt('lti_con_version'), 'lti_version');
503  $versionInp->setDisabled(true);
504  //1.3
505  $lti13 = new ilRadioOption($lng->txt('lti_con_version_1.3'), '1.3.0');
506  if ($this->provider->getId() == 0) {
507  $lti13->setInfo($lng->txt('lti_con_version_1.3_before_id'));
508  }
509  $versionInp->addOption($lti13);
510  $providerUrlInp = new ilTextInputGUI($lng->txt('lti_con_tool_url'), 'provider_url13');
511  $providerUrlInp->setValue($this->provider->getProviderUrl());
512  $providerUrlInp->setRequired(true);
513  $lti13->addSubItem($providerUrlInp);
514 
515  $initiateLogin = new ilTextInputGUI($lng->txt('lti_con_initiate_login_url'), 'initiate_login');
516  $initiateLogin->setValue($this->provider->getInitiateLogin());
517  $initiateLogin->setRequired(true);
518  $lti13->addSubItem($initiateLogin);
519 
520  $redirectionUris = new ilTextAreaInputGUI($lng->txt('lti_con_redirection_uris'), 'redirection_uris');
521  $redirectionUris->setRows(4);
522  $redirectionUris->setValue(implode("\n", explode(",", $this->provider->getRedirectionUris())));
523  $redirectionUris->setRequired(true);
524  $lti13->addSubItem($redirectionUris);
525 
526  //key_type
527  $keyType = new ilRadioGroupInputGUI($lng->txt('lti_con_key_type'), 'key_type');
528  $keyType->setRequired(true);
529  //RSA
530  $keyRsa = new ilRadioOption($lng->txt('lti_con_key_type_rsa'), 'RSA_KEY');
531  $keyType->addOption($keyRsa);
532  $publicKey = new ilTextAreaInputGUI($lng->txt('lti_con_key_type_rsa_public_key'), 'public_key');
533  $publicKey->setRows(6);
534  $publicKey->setRequired(true);
535  $publicKey->setValue($this->provider->getPublicKey());
536  $publicKey->setInfo($lng->txt('lti_con_key_type_rsa_public_key_info'));
537  $keyRsa->addSubItem($publicKey);
538  //JWK
539  $keyJwk = new ilRadioOption($lng->txt('lti_con_key_type_jwk'), 'JWK_KEYSET');
540  $keyType->addOption($keyJwk);
541  $keyset = new ilTextInputGUI($lng->txt('lti_con_key_type_jwk_url'), 'public_keyset');
542  $keyset->setValue($this->provider->getPublicKeyset());
543  $keyset->setRequired(true);
544  $keyJwk->addSubItem($keyset);
545 
546  $keyType->setValue($this->provider->getKeyType());
547  $lti13->addSubItem($keyType);
548 
549  $contentItem = new ilCheckboxInputGUI($lng->txt('lti_con_content_item'), 'content_item');
550  $contentItem->setValue('1');
551  // check if dynreg transaction session
553  if (!ilSession::has('lti_dynamic_registration_custom_params') && !empty($this->provider->getContentItemUrl())) {
554  $contentItem->setChecked(true);
555  } else {
556  $contentItem->setChecked(false);
557  }
558  } else {
559  if (empty($this->provider->getContentItemUrl())) {
560  $contentItem->setChecked(false);
561  } else {
562  $contentItem->setChecked($this->provider->isContentItem());
563  }
564  }
565  $contentItemUrl = new ilTextInputGUI($lng->txt('lti_con_content_item_url'), 'content_item_url');
566  $contentItemUrl->setValue($this->provider->getContentItemUrl());
567  $contentItem->addSubItem($contentItemUrl);
568  $lti13->addSubItem($contentItem);
569 
570  //grade sync
571  $gradeSynchronization = new ilCheckboxInputGUI($lng->txt('lti_con_grade_synchronization'), 'grade_synchronization');
572  $gradeSynchronization->setInfo($lng->txt('lti_con_grade_synchronization_info'));
573  $gradeSynchronization->setValue('1');
574  $gradeSynchronization->setChecked($this->provider->isGradeSynchronization());
575  $lti13->addSubItem($gradeSynchronization);
576 
577  $Lti13Info = new ilTextAreaInputGUI($lng->txt('lti13_hints'), 'lti13_hints');
578  $Lti13Info->setRows(6);
579  $Lti13Info->setValue(
580  "Platform ID: \t\t\t\t\t" . ilObjLTIConsumer::getPlattformId()
581  . "\nClient ID: \t\t\t\t\t" . $this->provider->getClientId()
582  . "\nDeployment ID: \t\t\t\t" . (string) $this->provider->getId()
583  . "\nPublic keyset URL: \t\t\t" . ilObjLTIConsumer::getPublicKeysetUrl()
584  . "\nAccess token URL: \t\t\t" . ilObjLTIConsumer::getAccessTokenUrl()
585  . "\nAuthentication request URL: \t" . ilObjLTIConsumer::getAuthenticationRequestUrl()
586  );
587  $Lti13Info->setDisabled(true);
588  $lti13->addSubItem($Lti13Info);
589 
590  $versionInp->setValue($this->provider->getLtiVersion());
591  $this->addItem($versionInp);
592 
593  $lti11 = new ilRadioOption($lng->txt('lti_con_version_1.1'), 'LTI-1p0');
594  $versionInp->addOption($lti11);
595 
596  $providerUrlInp = new ilTextInputGUI($lng->txt('lti_con_prov_url'), 'provider_url');
597  $providerUrlInp->setValue($this->provider->getProviderUrl());
598  $providerUrlInp->setRequired(true);
599  $lti11->addSubItem($providerUrlInp);
600  // Abfrage ob Key und secret von Objekterstellern eingegeben werden soll
601  $keyGlobal = new ilCheckboxInputGUI($lng->txt('lti_con_prov_provider_key_global'), 'provider_key_global');
602  $keyGlobal->setValue("1");
603  if (!$this->provider->isProviderKeyCustomizable()) {
604  $keyGlobal->setChecked(true);
605  }
606  $keyGlobal->setInfo($lng->txt('lti_con_prov_provider_key_global_info'));
607 
608  $providerKeyInp = new ilTextInputGUI($lng->txt('lti_con_prov_key'), 'provider_key');
609  $providerKeyInp->setValue($this->provider->getProviderKey());
610  $providerKeyInp->setRequired(true);
611  $keyGlobal->addSubItem($providerKeyInp);
612 
613  $providerSecretInp = new ilTextInputGUI($lng->txt('lti_con_prov_secret'), 'provider_secret');
614  $providerSecretInp->setValue($this->provider->getProviderSecret());
615  $providerSecretInp->setRequired(true);
616  $keyGlobal->addSubItem($providerSecretInp);
617  $lti11->addSubItem($keyGlobal);
618 
619  //privacy-settings
620 
621  $sectionHeader = new ilFormSectionHeaderGUI();
622  $sectionHeader->setTitle($lng->txt('lti_con_prov_privacy_settings'));
623  $this->addItem($sectionHeader);
624 
625  $item = new ilRadioGroupInputGUI($lng->txt('clti_privacy_ident'), 'privacy_ident');
626  $op = new ilRadioOption(
627  $lng->txt('clti_privacy_ident_il_uuid_user_id'),
629  );
630  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_user_id_info'));
631  $item->addOption($op);
632  $op = new ilRadioOption(
633  $lng->txt('clti_privacy_ident_il_uuid_login'),
635  );
636  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_login_info'));
637  $item->addOption($op);
638  $op = new ilRadioOption(
639  $lng->txt('clti_privacy_ident_il_uuid_ext_account'),
641  );
642  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_ext_account_info'));
643  $item->addOption($op);
644  $op = new ilRadioOption(
645  $lng->txt('clti_privacy_ident_il_uuid_sha256'),
647  );
648  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_sha256_info'));
649  $item->addOption($op);
650  $op = new ilRadioOption(
651  $lng->txt('clti_privacy_ident_il_uuid_sha256url'),
653  );
654  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_sha256url_info'));
655  $item->addOption($op);
656 
657  $op = new ilRadioOption(
658  $lng->txt('clti_privacy_ident_il_uuid_random'),
660  );
661  $op->setInfo($lng->txt('clti_privacy_ident_il_uuid_random_info'));
662  $item->addOption($op);
663 
664  $op = new ilRadioOption(
665  $lng->txt('clti_privacy_ident_real_email'),
667  );
668  $op->setInfo($lng->txt('clti_privacy_ident_real_email_info'));
669  $item->addOption($op);
670  $item->setValue((string) $this->provider->getPrivacyIdent());
671  $item->setInfo(
672  $lng->txt('clti_privacy_ident_info') . ' ' . ilCmiXapiUser::getIliasUuid() . '.ilias'
673  );
674  $item->setRequired(false);
675  $this->addItem($item);
676 
677  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_email'), 'instructor_email');
678  $item->setValue("1");
679  if ($this->provider->isInstructorSendEmail()) {
680  $item->setChecked(true);
681  }
682  $item->setInfo($lng->txt('lti_con_prov_instructor_email_info'));
683  $this->addItem($item);
684 
685  $item = new ilRadioGroupInputGUI($lng->txt('clti_privacy_name'), 'privacy_name');
686  $op = new ilRadioOption($lng->txt('clti_privacy_name_none'), (string) ilLTIConsumeProvider::PRIVACY_NAME_NONE);
687  $op->setInfo($lng->txt('clti_privacy_name_none_info'));
688  $item->addOption($op);
689  $op = new ilRadioOption($lng->txt('clti_privacy_name_firstname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FIRSTNAME);
690  $item->addOption($op);
691  $op = new ilRadioOption($lng->txt('clti_privacy_name_lastname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_LASTNAME);
692  $item->addOption($op);
693  $op = new ilRadioOption($lng->txt('clti_privacy_name_fullname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FULLNAME);
694  $item->addOption($op);
695  $item->setValue((string) $this->provider->getPrivacyName());
696  $item->setInfo($lng->txt('clti_privacy_name_info'));
697  $item->setRequired(false);
698  $this->addItem($item);
699 
700  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_name'), 'instructor_name');
701  $item->setValue("1");
702  if ($this->provider->isInstructorSendName()) {
703  $item->setChecked(true);
704  }
705  $item->setInfo($lng->txt('lti_con_prov_instructor_name_info'));
706  $this->addItem($item);
707 
708  $includeUserImage = new ilCheckboxInputGUI($lng->txt('lti_con_prov_inc_usr_pic'), 'inc_usr_pic');
709  $includeUserImage->setInfo($lng->txt('lti_con_prov_inc_usr_pic_info'));
710  $includeUserImage->setChecked($this->provider->getIncludeUserPicture());
711  $this->addItem($includeUserImage);
712 
713  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_external_provider'), 'is_external_provider');
714  $item->setValue("1");
715  if ($this->provider->IsExternalProvider()) {
716  $item->setChecked(true);
717  }
718  $item->setInfo($lng->txt('lti_con_prov_external_provider_info'));
719  $this->addItem($item);
720 
721 
722  $sectionHeader = new ilFormSectionHeaderGUI();
723  $sectionHeader->setTitle($lng->txt('lti_con_prov_learning_progress_options'));
724  $this->addItem($sectionHeader);
725  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_has_outcome_service'), 'has_outcome_service');
726  $item->setValue("1");
727  if ($this->provider->getHasOutcome()) {
728  $item->setChecked(true);
729  }
730  $item->setInfo($lng->txt('lti_con_prov_has_outcome_service_info'));
731  $masteryScore = new ilNumberInputGUI($lng->txt('lti_con_prov_mastery_score_default'), 'mastery_score');
732  $masteryScore->setInfo($lng->txt('lti_con_prov_mastery_score_default_info'));
733  $masteryScore->setSuffix('%');
734  $masteryScore->allowDecimals(true);
735  $masteryScore->setDecimals(2);
736  $masteryScore->setMinvalueShouldBeGreater(false);
737  $masteryScore->setMinValue(0);
738  $masteryScore->setMaxvalueShouldBeLess(false);
739  $masteryScore->setMaxValue(100);
740  $masteryScore->setSize(4);
741  $masteryScore->setValue((string) $this->provider->getMasteryScorePercent());
742  $item->addSubItem($masteryScore);
743  $this->addItem($item);
744 
745  $sectionHeader = new ilFormSectionHeaderGUI();
746  $sectionHeader->setTitle($lng->txt('lti_con_prov_launch_options'));
747  $this->addItem($sectionHeader);
748 
749  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_provider_id'), 'use_provider_id');
750  $item->setValue("1");
751  if ($this->provider->getUseProviderId()) {
752  $item->setChecked(true);
753  }
754  $item->setInfo($lng->txt('lti_con_prov_use_provider_id_info'));
755 
756  $this->addItem($item);
757 
758  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_always_learner'), 'always_learner');
759  $item->setValue("1");
760  if ($this->provider->getAlwaysLearner()) {
761  $item->setChecked(true);
762  }
763  $item->setInfo($lng->txt('lti_con_prov_always_learner_info'));
764  $this->addItem($item);
765 
766  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_xapi'), 'use_xapi');
767  $item->setValue("1");
768  if ($this->provider->getUseXapi()) {
769  $item->setChecked(true);
770  }
771  $item->setInfo($lng->txt('lti_con_prov_use_xapi_info'));
772 
773  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_url'), 'xapi_launch_url');
774  $subitem->setValue($this->provider->getXapiLaunchUrl());
775  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_url_info'));
776  $subitem->setRequired(true);
777  $subitem->setMaxLength(255);
778  $item->addSubItem($subitem);
779 
780  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_key'), 'xapi_launch_key');
781  $subitem->setValue($this->provider->getXapiLaunchKey());
782  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_key_info'));
783  $subitem->setRequired(true);
784  $subitem->setMaxLength(64);
785  $item->addSubItem($subitem);
786 
787  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_secret'), 'xapi_launch_secret');
788  $subitem->setValue($this->provider->getXapiLaunchSecret());
789  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_secret_info'));
790  $subitem->setRequired(true);
791  $subitem->setMaxLength(64);
792  $item->addSubItem($subitem);
793 
794  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_activity_id'), 'xapi_activity_id');
795  $subitem->setValue($this->provider->getXapiActivityId());
796  $subitem->setInfo($lng->txt('lti_con_prov_xapi_activity_id_info'));
797  $subitem->setMaxLength(128);
798  $item->addSubItem($subitem);
799 
800  $this->addItem($item);
801 
802  $item = new ilTextAreaInputGUI($lng->txt('lti_con_prov_custom_params'), 'custom_params');
803 
804  if (ilSession::has('lti_dynamic_registration_custom_params')) {
805  $item->setValue(ilSession::get('lti_dynamic_registration_custom_params'));
806  } else {
807  $item->setValue($this->provider->getCustomParams());
808  }
809 
810  $item->setRows(6);
811  $item->setInfo($lng->txt('lti_con_prov_custom_params_info'));
812  $this->addItem($item);
813 
814  $sectionHeader = new ilFormSectionHeaderGUI();
815  $sectionHeader->setTitle($lng->txt('lti_con_prov_group_options'));
816  $this->addItem($sectionHeader);
817 
818  $item = new ilTextInputGUI($lng->txt('lti_con_prov_keywords'), 'keywords');
819  $item->setValue($this->provider->getKeywords());
820  $item->setInfo($lng->txt('lti_con_prov_keywords_info'));
821  $item->setMaxLength(1000);
822  $this->addItem($item);
823 
824  $category = new ilRadioGroupInputGUI($lng->txt('lti_con_prov_category'), 'category');
825  $category->setInfo($lng->txt('lti_con_prov_category_info'));
826  $category->setValue($this->provider->getCategory());
827  $category->setRequired(true);
828  foreach (ilLTIConsumeProvider::getCategoriesSelectOptions() as $value => $label) {
829  $category->addOption(new ilRadioOption($label, $value));
830  }
831  $this->addItem($category);
832 
833  $sectionHeader = new ilFormSectionHeaderGUI();
834  $sectionHeader->setTitle($lng->txt('lti_con_prov_hints'));
835  $this->addItem($sectionHeader);
836 
837  $remarksInp = new ilTextAreaInputGUI($lng->txt('lti_con_prov_remarks'), 'remarks');
838  $remarksInp->setValue($this->provider->getRemarks());
839  $remarksInp->setRows(6);
840  $this->addItem($remarksInp);
841  }
static get(string $a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setInfo(string $a_info)
global $DIC
Definition: feed.php:28
This class represents a property in a property form.
static isUserDynamicRegistrationTransaction(ilLTIConsumeProvider $provider)
setFormAction(string $a_formaction)
static has($a_var)
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents an image file property in a property form.
This class represents a text area property in a property form.
string $formaction
setDisabled(bool $a_disabled)
+ Here is the call graph for this function:

◆ isAdminContext()

ilLTIConsumeProviderFormGUI::isAdminContext ( )

Definition at line 50 of file class.ilLTIConsumeProviderFormGUI.php.

References $adminContext.

Referenced by initForm(), initProvider(), and initToolConfigForm().

50  : bool
51  {
52  return $this->adminContext;
53  }
+ Here is the caller graph for this function:

◆ setAdminContext()

ilLTIConsumeProviderFormGUI::setAdminContext ( bool  $adminContext)

Definition at line 55 of file class.ilLTIConsumeProviderFormGUI.php.

References $adminContext.

55  : void
56  {
57  $this->adminContext = $adminContext;
58  }

Field Documentation

◆ $adminContext

bool ilLTIConsumeProviderFormGUI::$adminContext = false
protected

Definition at line 39 of file class.ilLTIConsumeProviderFormGUI.php.

Referenced by isAdminContext(), and setAdminContext().

◆ $provider

ilLTIConsumeProvider ilLTIConsumeProviderFormGUI::$provider
protected

Definition at line 34 of file class.ilLTIConsumeProviderFormGUI.php.

Referenced by __construct(), and getProvider().


The documentation for this class was generated from the following file: