ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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\GlobalScreen\Provider\__construct().

45  {
47  $this->provider = $provider;
48  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getContentSelectionFrame()

ilLTIConsumeProviderFormGUI::getContentSelectionFrame (   $formaction)

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

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

949  : string
950  {
951  global $DIC;
952  $lng = $DIC->language();
953  $this->setFormAction($formaction);
954  $this->setTitle($lng->txt('lti_form_provider_content_selection'));
955  $this->clearCommandButtons();
956  $this->addCommandButton("cancelContentSelection", $lng->txt('cancel'));
957  $src = $DIC->ctrl()->getLinkTargetByClass(ilObjLTIConsumerGUI::class, 'contentSelectionRequest');
958  $template = new ilTemplate('tpl.lti_content_selection.html', true, true, "components/ILIAS/LTIConsumer");
959  $template->setVariable('LTI_CONTENT_SELECTION_IFRAME_SRC', $src);
960  return $this->getHTML() . $template->get();
961  }
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...
setFormAction(string $a_formaction)
global $DIC
Definition: shib_login.php:25
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 991 of file class.ilLTIConsumeProviderFormGUI.php.

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

991  : string
992  {
993  global $DIC; /* @var \ILIAS\DI\Container $DIC */
994  $lng = $DIC->language();
995  $this->removeItemByPostVar('lti_dyn_reg_url');
996  $this->removeItemByPostVar('lti_dyn_reg_custom_params');
997  $this->setTitle("");
998  $this->clearCommandButtons();
999  $this->addCommandButton("cancelDynReg", $DIC->language()->txt('cancel'));
1000  return $this->getHTML();
1001  }
removeItemByPostVar(string $a_post_var, bool $a_remove_unused_headers=false)
global $DIC
Definition: shib_login.php:25
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:

◆ getDynRegRequest()

ilLTIConsumeProviderFormGUI::getDynRegRequest ( )

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

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

963  : string
964  {
965  global $DIC;
966  $lng = $DIC->language();
967  //ToDo: is url format validation?
968  $toolRegUrl = $this->getInput('lti_dyn_reg_url');
969  $customParams = $this->getInput('lti_dyn_reg_custom_params');
970  $regUrl = ilObjLTIConsumer::getRegistrationStartUrl() . "?url=" . urlencode($toolRegUrl);
971  if (!empty($customParams)) {
972  $regUrl .= "&custom_params=" . urlencode($customParams);
973  }
974  $showToolConfigUrl = $DIC->ctrl()->getLinkTargetByClass([ilRepositoryGUI::class,ilObjLTIConsumerGUI::class], 'showToolConfig');
975  $regErrorUrl = $DIC->ctrl()->getLinkTargetByClass([ilRepositoryGUI::class,ilObjLTIConsumerGUI::class], 'addDynReg');
976  $this->getItemByPostVar('lti_dyn_reg_url')->setDisabled(true);
977  $this->getItemByPostVar('lti_dyn_reg_custom_params')->setDisabled(true);
978  $this->clearCommandButtons();
979  //$this->addCommandButton("cancelDynReg", $DIC->language()->txt('cancel'));
980  $template = new ilTemplate('tpl.lti_dyn_reg_request.html', true, true, "components/ILIAS/LTIConsumer");
981  $template->setVariable('LTI_TOOL_REG_URL', $toolRegUrl);
982  $template->setVariable('LTI_DYN_REG_URL', $regUrl);
983  $template->setVariable('LTI_DYN_REG_URL_BY_POST', $toolRegUrl);
984  $template->setVariable('LTI_REG_END_URL', ilObjLTIConsumer::getRegistrationEndUrl());
985  $template->setVariable('LTI_SHOW_TOOL_CONFIG_URL', $showToolConfigUrl);
986  $template->setVariable('LTI_REG_ERROR_URL', $regErrorUrl);
987  //$DIC->ui()->mainTemplate()->setOnScreenMessage('info', $lng->txt('lti_dyn_reg_redirect_after_10_secs'));
988  return $template->get() . $this->getHTML();
989  }
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: shib_login.php:25
+ Here is the call graph for this function:

◆ getProvider()

ilLTIConsumeProviderFormGUI::getProvider ( )

◆ initDynRegForm()

ilLTIConsumeProviderFormGUI::initDynRegForm ( string  $formaction)

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

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

931  : void
932  {
933  global $DIC; /* @var \ILIAS\DI\Container $DIC */
934  $lng = $DIC->language();
935  $this->setFormAction($formaction);
936  $this->clearCommandButtons();
937 
938  $this->setTitle($lng->txt('lti_form_provider_create'));
939  $regUrlInp = new ilTextInputGUI($lng->txt('lti_con_prov_dyn_reg_url'), 'lti_dyn_reg_url');
940  $regUrlInp->setInfo($lng->txt('lti_con_prov_dyn_reg_url_info'));
941  $regUrlInp->setRequired(true);
942  $this->addItem($regUrlInp);
943  $regParamsInp = new ilTextInputGUI($lng->txt('lti_con_prov_dyn_reg_params'), 'lti_dyn_reg_custom_params');
944  $regParamsInp->setInfo($lng->txt('lti_con_prov_dyn_reg_params_info'));
945  $this->addCommandButton("addDynReg", $DIC->language()->txt('lti_dyn_reg_add_tool'));
946  $this->addItem($regParamsInp);
947  }
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...
setFormAction(string $a_formaction)
global $DIC
Definition: shib_login.php:25
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(false);
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->setValue($this->provider->getPublicKey());
154  $publicKey->setRequired(false);
155  $publicKey->setInfo($lng->txt('lti_con_key_type_rsa_public_key_info'));
156  $keyRsa->addSubItem($publicKey);
157  //JWK
158  $keyJwk = new ilRadioOption($lng->txt('lti_con_key_type_jwk'), 'JWK_KEYSET');
159  $keyType->addOption($keyJwk);
160  $keyset = new ilTextInputGUI($lng->txt('lti_con_key_type_jwk_url'), 'public_keyset');
161  $keyset->setValue($this->provider->getPublicKeyset());
162  $keyset->setRequired(false);
163  $keyJwk->addSubItem($keyset);
164 
165  $keyType->setValue($this->provider->getKeyType());
166  $lti13->addSubItem($keyType);
167 
168  $contentItem = new ilCheckboxInputGUI($lng->txt('lti_con_content_item'), 'content_item');
169  $contentItem->setValue('1');
170  $contentItem->setChecked($this->provider->isContentItem());
171 
172  $contentItemUrl = new ilTextInputGUI($lng->txt('lti_con_content_item_url'), 'content_item_url');
173  $contentItemUrl->setValue($this->provider->getContentItemUrl());
174  $contentItem->addSubItem($contentItemUrl);
175  $lti13->addSubItem($contentItem);
176 
177  //grade sync
178  $gradeSynchronization = new ilCheckboxInputGUI($lng->txt('lti_con_grade_synchronization'), 'grade_synchronization');
179  $gradeSynchronization->setInfo($lng->txt('lti_con_grade_synchronization_info'));
180  $gradeSynchronization->setValue('1');
181  $gradeSynchronization->setChecked($this->provider->isGradeSynchronization());
182  $lti13->addSubItem($gradeSynchronization);
183 
184  if ($this->provider->getId() > 0) {
185  $Lti13Info = new ilTextAreaInputGUI($lng->txt('lti13_hints'), 'lti13_hints');
186  $Lti13Info->setRows(6);
187  $Lti13Info->setValue(
188  "Platform ID: \t\t\t\t\t" . ilObjLTIConsumer::getPlattformId()
189  . "\nClient ID: \t\t\t\t\t" . $this->provider->getClientId()
190  . "\nDeployment ID: \t\t\t\t" . (string) $this->provider->getId()
191  . "\nPublic keyset URL: \t\t\t" . ilObjLTIConsumer::getPublicKeysetUrl()
192  . "\nAccess token URL: \t\t\t" . ilObjLTIConsumer::getAccessTokenUrl()
193  . "\nAuthentication request URL: \t" . ilObjLTIConsumer::getAuthenticationRequestUrl()
194  );
195  $Lti13Info->setDisabled(true);
196  $lti13->addSubItem($Lti13Info);
197  }
198 
199  $versionInp->setValue($this->provider->getLtiVersion());
200  $this->addItem($versionInp);
201 
202  $lti11 = new ilRadioOption($lng->txt('lti_con_version_1.1'), 'LTI-1p0');
203  $versionInp->addOption($lti11);
204 
205  $providerUrlInp = new ilTextInputGUI($lng->txt('lti_con_prov_url'), 'provider_url');
206  $providerUrlInp->setValue($this->provider->getProviderUrl());
207  $providerUrlInp->setRequired(true);
208  $lti11->addSubItem($providerUrlInp);
209  // Abfrage ob Key und secret von Objekterstellern eingegeben werden soll
210  $keyGlobal = new ilCheckboxInputGUI($lng->txt('lti_con_prov_provider_key_global'), 'provider_key_global');
211  $keyGlobal->setValue("1");
212  if (!$this->provider->isProviderKeyCustomizable()) {
213  $keyGlobal->setChecked(true);
214  }
215  $keyGlobal->setInfo($lng->txt('lti_con_prov_provider_key_global_info'));
216 
217  $providerKeyInp = new ilTextInputGUI($lng->txt('lti_con_prov_key'), 'provider_key');
218  $providerKeyInp->setValue($this->provider->getProviderKey());
219  $providerKeyInp->setRequired(true);
220  $keyGlobal->addSubItem($providerKeyInp);
221 
222  $providerSecretInp = new ilTextInputGUI($lng->txt('lti_con_prov_secret'), 'provider_secret');
223  $providerSecretInp->setValue($this->provider->getProviderSecret());
224  $providerSecretInp->setRequired(true);
225  $keyGlobal->addSubItem($providerSecretInp);
226  $lti11->addSubItem($keyGlobal);
227 
228  //privacy-settings
229 
230  $sectionHeader = new ilFormSectionHeaderGUI();
231  $sectionHeader->setTitle($lng->txt('lti_con_prov_privacy_settings'));
232  $this->addItem($sectionHeader);
233 
234  $item = new ilRadioGroupInputGUI($lng->txt('conf_privacy_ident'), 'privacy_ident');
235  $op = new ilRadioOption(
236  $lng->txt('conf_privacy_ident_il_uuid_user_id'),
238  );
239  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_user_id_info'));
240  $item->addOption($op);
241  $op = new ilRadioOption(
242  $lng->txt('conf_privacy_ident_il_uuid_login'),
244  );
245  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_login_info'));
246  $item->addOption($op);
247  $op = new ilRadioOption(
248  $lng->txt('conf_privacy_ident_il_uuid_ext_account'),
250  );
251  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_ext_account_info'));
252  $item->addOption($op);
253  $op = new ilRadioOption(
254  $lng->txt('conf_privacy_ident_il_uuid_sha256'),
256  );
257  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_sha256_info'));
258  $item->addOption($op);
259  $op = new ilRadioOption(
260  $lng->txt('conf_privacy_ident_il_uuid_sha256url'),
262  );
263  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_sha256url_info'));
264  $item->addOption($op);
265 
266  $op = new ilRadioOption(
267  $lng->txt('conf_privacy_ident_il_uuid_random'),
269  );
270  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_random_info'));
271  $item->addOption($op);
272 
273  $op = new ilRadioOption(
274  $lng->txt('conf_privacy_ident_real_email'),
276  );
277  $op->setInfo($lng->txt('conf_privacy_ident_real_email_info'));
278  $item->addOption($op);
279  $item->setValue((string) $this->provider->getPrivacyIdent());
280  $item->setInfo(
281  $lng->txt('conf_privacy_ident_info') . ' ' . ilCmiXapiUser::getIliasUuid() . '.ilias'
282  );
283  $item->setRequired(false);
284  $this->addItem($item);
285 
286  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_email'), 'instructor_email');
287  $item->setValue("1");
288  if ($this->provider->isInstructorSendEmail()) {
289  $item->setChecked(true);
290  }
291  $item->setInfo($lng->txt('lti_con_prov_instructor_email_info'));
292  $this->addItem($item);
293 
294  $item = new ilRadioGroupInputGUI($lng->txt('conf_privacy_name'), 'privacy_name');
295  $op = new ilRadioOption($lng->txt('conf_privacy_name_none'), (string) ilLTIConsumeProvider::PRIVACY_NAME_NONE);
296  $op->setInfo($lng->txt('conf_privacy_name_none_info'));
297  $item->addOption($op);
298  $op = new ilRadioOption($lng->txt('conf_privacy_name_firstname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FIRSTNAME);
299  $op->setInfo($lng->txt('conf_privacy_name_firstname_info'));
300  $item->addOption($op);
301  $op = new ilRadioOption($lng->txt('conf_privacy_name_lastname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_LASTNAME);
302  $op->setInfo($lng->txt('conf_privacy_name_lastname_info'));
303  $item->addOption($op);
304  $op = new ilRadioOption($lng->txt('conf_privacy_name_fullname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FULLNAME);
305  $op->setInfo($lng->txt('conf_privacy_name_fullname_info'));
306  $item->addOption($op);
307  $item->setValue((string) $this->provider->getPrivacyName());
308  $item->setInfo($lng->txt('conf_privacy_name_info'));
309  $item->setRequired(false);
310  $this->addItem($item);
311 
312  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_name'), 'instructor_name');
313  $item->setValue("1");
314  if ($this->provider->isInstructorSendName()) {
315  $item->setChecked(true);
316  }
317  $item->setInfo($lng->txt('lti_con_prov_instructor_name_info'));
318  $this->addItem($item);
319 
320  $includeUserImage = new ilCheckboxInputGUI($lng->txt('lti_con_prov_inc_usr_pic'), 'inc_usr_pic');
321  $includeUserImage->setInfo($lng->txt('lti_con_prov_inc_usr_pic_info'));
322  $includeUserImage->setChecked($this->provider->getIncludeUserPicture());
323  $this->addItem($includeUserImage);
324 
325  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_external_provider'), 'is_external_provider');
326  $item->setValue("1");
327  if ($this->provider->IsExternalProvider()) {
328  $item->setChecked(true);
329  }
330  $item->setInfo($lng->txt('lti_con_prov_external_provider_info'));
331  $this->addItem($item);
332 
333 
334  $sectionHeader = new ilFormSectionHeaderGUI();
335  $sectionHeader->setTitle($lng->txt('lti_con_prov_learning_progress_options'));
336  $this->addItem($sectionHeader);
337  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_has_outcome_service'), 'has_outcome_service');
338  $item->setValue("1");
339  if ($this->provider->getHasOutcome()) {
340  $item->setChecked(true);
341  }
342  $item->setInfo($lng->txt('lti_con_prov_has_outcome_service_info'));
343  $masteryScore = new ilNumberInputGUI($lng->txt('lti_con_prov_mastery_score_default'), 'mastery_score');
344  $masteryScore->setInfo($lng->txt('lti_con_prov_mastery_score_default_info'));
345  $masteryScore->setSuffix('%');
346  $masteryScore->allowDecimals(true);
347  $masteryScore->setDecimals(2);
348  $masteryScore->setMinvalueShouldBeGreater(false);
349  $masteryScore->setMinValue(0);
350  $masteryScore->setMaxvalueShouldBeLess(false);
351  $masteryScore->setMaxValue(100);
352  $masteryScore->setSize(4);
353  $masteryScore->setValue((string) $this->provider->getMasteryScorePercent());
354  $item->addSubItem($masteryScore);
355  $this->addItem($item);
356 
357  $sectionHeader = new ilFormSectionHeaderGUI();
358  $sectionHeader->setTitle($lng->txt('lti_con_prov_launch_options'));
359  $this->addItem($sectionHeader);
360 
361  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_provider_id'), 'use_provider_id');
362  $item->setValue("1");
363  if ($this->provider->getUseProviderId()) {
364  $item->setChecked(true);
365  }
366  $item->setInfo($lng->txt('lti_con_prov_use_provider_id_info'));
367 
368  $this->addItem($item);
369 
370  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_always_learner'), 'always_learner');
371  $item->setValue("1");
372  if ($this->provider->getAlwaysLearner()) {
373  $item->setChecked(true);
374  }
375  $item->setInfo($lng->txt('lti_con_prov_always_learner_info'));
376  $this->addItem($item);
377 
378  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_xapi'), 'use_xapi');
379  $item->setValue("1");
380  if ($this->provider->getUseXapi()) {
381  $item->setChecked(true);
382  }
383  $item->setInfo($lng->txt('lti_con_prov_use_xapi_info'));
384 
385  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_url'), 'xapi_launch_url');
386  $subitem->setValue($this->provider->getXapiLaunchUrl());
387  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_url_info'));
388  $subitem->setRequired(true);
389  $subitem->setMaxLength(255);
390  $item->addSubItem($subitem);
391 
392  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_key'), 'xapi_launch_key');
393  $subitem->setValue($this->provider->getXapiLaunchKey());
394  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_key_info'));
395  $subitem->setRequired(true);
396  $subitem->setMaxLength(64);
397  $item->addSubItem($subitem);
398 
399  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_secret'), 'xapi_launch_secret');
400  $subitem->setValue($this->provider->getXapiLaunchSecret());
401  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_secret_info'));
402  $subitem->setRequired(true);
403  $subitem->setMaxLength(64);
404  $item->addSubItem($subitem);
405 
406  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_activity_id'), 'xapi_activity_id');
407  $subitem->setValue($this->provider->getXapiActivityId());
408  $subitem->setInfo($lng->txt('lti_con_prov_xapi_activity_id_info'));
409  $subitem->setMaxLength(128);
410  $item->addSubItem($subitem);
411 
412  $this->addItem($item);
413 
414  $item = new ilTextAreaInputGUI($lng->txt('lti_con_prov_custom_params'), 'custom_params');
415  $item->setValue($this->provider->getCustomParams());
416 
417  $item->setRows(6);
418  $item->setInfo($lng->txt('lti_con_prov_custom_params_info'));
419  $this->addItem($item);
420 
421  $sectionHeader = new ilFormSectionHeaderGUI();
422  $sectionHeader->setTitle($lng->txt('lti_con_prov_group_options'));
423  $this->addItem($sectionHeader);
424 
425  $item = new ilTextInputGUI($lng->txt('lti_con_prov_keywords'), 'keywords');
426  $item->setValue($this->provider->getKeywords());
427  $item->setInfo($lng->txt('lti_con_prov_keywords_info'));
428  $item->setMaxLength(1000);
429  $this->addItem($item);
430 
431  $category = new ilRadioGroupInputGUI($lng->txt('lti_con_prov_category'), 'category');
432  $category->setInfo($lng->txt('lti_con_prov_category_info'));
433  $category->setValue($this->provider->getCategory());
434  $category->setRequired(true);
435  foreach (ilLTIConsumeProvider::getCategoriesSelectOptions() as $value => $label) {
436  $category->addOption(new ilRadioOption($label, $value));
437  }
438  $this->addItem($category);
439 
440  $sectionHeader = new ilFormSectionHeaderGUI();
441  $sectionHeader->setTitle($lng->txt('lti_con_prov_hints'));
442  $this->addItem($sectionHeader);
443 
444  $remarksInp = new ilTextAreaInputGUI($lng->txt('lti_con_prov_remarks'), 'remarks');
445  $remarksInp->setValue($this->provider->getRemarks());
446  $remarksInp->setRows(6);
447  $this->addItem($remarksInp);
448  }
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...
This class represents a property in a property form.
setFormAction(string $a_formaction)
global $DIC
Definition: shib_login.php:25
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 850 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().

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

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