ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 948 of file class.ilLTIConsumeProviderFormGUI.php.

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

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

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

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

◆ getDynRegRequest()

ilLTIConsumeProviderFormGUI::getDynRegRequest ( )

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

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

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

◆ getProvider()

ilLTIConsumeProviderFormGUI::getProvider ( )

◆ initDynRegForm()

ilLTIConsumeProviderFormGUI::initDynRegForm ( string  $formaction)

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

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

930  : void
931  {
932  global $DIC; /* @var \ILIAS\DI\Container $DIC */
933  $lng = $DIC->language();
934  $this->setFormAction($formaction);
935  $this->clearCommandButtons();
936 
937  $this->setTitle($lng->txt('lti_form_provider_create'));
938  $regUrlInp = new ilTextInputGUI($lng->txt('lti_con_prov_dyn_reg_url'), 'lti_dyn_reg_url');
939  $regUrlInp->setInfo($lng->txt('lti_con_prov_dyn_reg_url_info'));
940  $regUrlInp->setRequired(true);
941  $this->addItem($regUrlInp);
942  $regParamsInp = new ilTextInputGUI($lng->txt('lti_con_prov_dyn_reg_params'), 'lti_dyn_reg_custom_params');
943  $regParamsInp->setInfo($lng->txt('lti_con_prov_dyn_reg_params_info'));
944  $this->addCommandButton("addDynReg", $DIC->language()->txt('lti_dyn_reg_add_tool'));
945  $this->addItem($regParamsInp);
946  }
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:22
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('conf_privacy_ident'), 'privacy_ident');
234  $op = new ilRadioOption(
235  $lng->txt('conf_privacy_ident_il_uuid_user_id'),
237  );
238  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_user_id_info'));
239  $item->addOption($op);
240  $op = new ilRadioOption(
241  $lng->txt('conf_privacy_ident_il_uuid_login'),
243  );
244  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_login_info'));
245  $item->addOption($op);
246  $op = new ilRadioOption(
247  $lng->txt('conf_privacy_ident_il_uuid_ext_account'),
249  );
250  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_ext_account_info'));
251  $item->addOption($op);
252  $op = new ilRadioOption(
253  $lng->txt('conf_privacy_ident_il_uuid_sha256'),
255  );
256  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_sha256_info'));
257  $item->addOption($op);
258  $op = new ilRadioOption(
259  $lng->txt('conf_privacy_ident_il_uuid_sha256url'),
261  );
262  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_sha256url_info'));
263  $item->addOption($op);
264 
265  $op = new ilRadioOption(
266  $lng->txt('conf_privacy_ident_il_uuid_random'),
268  );
269  $op->setInfo($lng->txt('conf_privacy_ident_il_uuid_random_info'));
270  $item->addOption($op);
271 
272  $op = new ilRadioOption(
273  $lng->txt('conf_privacy_ident_real_email'),
275  );
276  $op->setInfo($lng->txt('conf_privacy_ident_real_email_info'));
277  $item->addOption($op);
278  $item->setValue((string) $this->provider->getPrivacyIdent());
279  $item->setInfo(
280  $lng->txt('conf_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('conf_privacy_name'), 'privacy_name');
294  $op = new ilRadioOption($lng->txt('conf_privacy_name_none'), (string) ilLTIConsumeProvider::PRIVACY_NAME_NONE);
295  $op->setInfo($lng->txt('conf_privacy_name_none_info'));
296  $item->addOption($op);
297  $op = new ilRadioOption($lng->txt('conf_privacy_name_firstname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FIRSTNAME);
298  $op->setInfo($lng->txt('conf_privacy_name_firstname_info'));
299  $item->addOption($op);
300  $op = new ilRadioOption($lng->txt('conf_privacy_name_lastname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_LASTNAME);
301  $op->setInfo($lng->txt('conf_privacy_name_lastname_info'));
302  $item->addOption($op);
303  $op = new ilRadioOption($lng->txt('conf_privacy_name_fullname'), (string) ilLTIConsumeProvider::PRIVACY_NAME_FULLNAME);
304  $op->setInfo($lng->txt('conf_privacy_name_fullname_info'));
305  $item->addOption($op);
306  $item->setValue((string) $this->provider->getPrivacyName());
307  $item->setInfo($lng->txt('conf_privacy_name_info'));
308  $item->setRequired(false);
309  $this->addItem($item);
310 
311  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_instructor_name'), 'instructor_name');
312  $item->setValue("1");
313  if ($this->provider->isInstructorSendName()) {
314  $item->setChecked(true);
315  }
316  $item->setInfo($lng->txt('lti_con_prov_instructor_name_info'));
317  $this->addItem($item);
318 
319  $includeUserImage = new ilCheckboxInputGUI($lng->txt('lti_con_prov_inc_usr_pic'), 'inc_usr_pic');
320  $includeUserImage->setInfo($lng->txt('lti_con_prov_inc_usr_pic_info'));
321  $includeUserImage->setChecked($this->provider->getIncludeUserPicture());
322  $this->addItem($includeUserImage);
323 
324  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_external_provider'), 'is_external_provider');
325  $item->setValue("1");
326  if ($this->provider->IsExternalProvider()) {
327  $item->setChecked(true);
328  }
329  $item->setInfo($lng->txt('lti_con_prov_external_provider_info'));
330  $this->addItem($item);
331 
332 
333  $sectionHeader = new ilFormSectionHeaderGUI();
334  $sectionHeader->setTitle($lng->txt('lti_con_prov_learning_progress_options'));
335  $this->addItem($sectionHeader);
336  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_has_outcome_service'), 'has_outcome_service');
337  $item->setValue("1");
338  if ($this->provider->getHasOutcome()) {
339  $item->setChecked(true);
340  }
341  $item->setInfo($lng->txt('lti_con_prov_has_outcome_service_info'));
342  $masteryScore = new ilNumberInputGUI($lng->txt('lti_con_prov_mastery_score_default'), 'mastery_score');
343  $masteryScore->setInfo($lng->txt('lti_con_prov_mastery_score_default_info'));
344  $masteryScore->setSuffix('%');
345  $masteryScore->allowDecimals(true);
346  $masteryScore->setDecimals(2);
347  $masteryScore->setMinvalueShouldBeGreater(false);
348  $masteryScore->setMinValue(0);
349  $masteryScore->setMaxvalueShouldBeLess(false);
350  $masteryScore->setMaxValue(100);
351  $masteryScore->setSize(4);
352  $masteryScore->setValue((string) $this->provider->getMasteryScorePercent());
353  $item->addSubItem($masteryScore);
354  $this->addItem($item);
355 
356  $sectionHeader = new ilFormSectionHeaderGUI();
357  $sectionHeader->setTitle($lng->txt('lti_con_prov_launch_options'));
358  $this->addItem($sectionHeader);
359 
360  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_provider_id'), 'use_provider_id');
361  $item->setValue("1");
362  if ($this->provider->getUseProviderId()) {
363  $item->setChecked(true);
364  }
365  $item->setInfo($lng->txt('lti_con_prov_use_provider_id_info'));
366 
367  $this->addItem($item);
368 
369  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_always_learner'), 'always_learner');
370  $item->setValue("1");
371  if ($this->provider->getAlwaysLearner()) {
372  $item->setChecked(true);
373  }
374  $item->setInfo($lng->txt('lti_con_prov_always_learner_info'));
375  $this->addItem($item);
376 
377  $item = new ilCheckboxInputGUI($lng->txt('lti_con_prov_use_xapi'), 'use_xapi');
378  $item->setValue("1");
379  if ($this->provider->getUseXapi()) {
380  $item->setChecked(true);
381  }
382  $item->setInfo($lng->txt('lti_con_prov_use_xapi_info'));
383 
384  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_url'), 'xapi_launch_url');
385  $subitem->setValue($this->provider->getXapiLaunchUrl());
386  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_url_info'));
387  $subitem->setRequired(true);
388  $subitem->setMaxLength(255);
389  $item->addSubItem($subitem);
390 
391  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_key'), 'xapi_launch_key');
392  $subitem->setValue($this->provider->getXapiLaunchKey());
393  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_key_info'));
394  $subitem->setRequired(true);
395  $subitem->setMaxLength(64);
396  $item->addSubItem($subitem);
397 
398  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_launch_secret'), 'xapi_launch_secret');
399  $subitem->setValue($this->provider->getXapiLaunchSecret());
400  $subitem->setInfo($lng->txt('lti_con_prov_xapi_launch_secret_info'));
401  $subitem->setRequired(true);
402  $subitem->setMaxLength(64);
403  $item->addSubItem($subitem);
404 
405  $subitem = new ilTextInputGUI($lng->txt('lti_con_prov_xapi_activity_id'), 'xapi_activity_id');
406  $subitem->setValue($this->provider->getXapiActivityId());
407  $subitem->setInfo($lng->txt('lti_con_prov_xapi_activity_id_info'));
408  $subitem->setMaxLength(128);
409  $item->addSubItem($subitem);
410 
411  $this->addItem($item);
412 
413  $item = new ilTextAreaInputGUI($lng->txt('lti_con_prov_custom_params'), 'custom_params');
414  $item->setValue($this->provider->getCustomParams());
415 
416  $item->setRows(6);
417  $item->setInfo($lng->txt('lti_con_prov_custom_params_info'));
418  $this->addItem($item);
419 
420  $sectionHeader = new ilFormSectionHeaderGUI();
421  $sectionHeader->setTitle($lng->txt('lti_con_prov_group_options'));
422  $this->addItem($sectionHeader);
423 
424  $item = new ilTextInputGUI($lng->txt('lti_con_prov_keywords'), 'keywords');
425  $item->setValue($this->provider->getKeywords());
426  $item->setInfo($lng->txt('lti_con_prov_keywords_info'));
427  $item->setMaxLength(1000);
428  $this->addItem($item);
429 
430  $category = new ilRadioGroupInputGUI($lng->txt('lti_con_prov_category'), 'category');
431  $category->setInfo($lng->txt('lti_con_prov_category_info'));
432  $category->setValue($this->provider->getCategory());
433  $category->setRequired(true);
434  foreach (ilLTIConsumeProvider::getCategoriesSelectOptions() as $value => $label) {
435  $category->addOption(new ilRadioOption($label, $value));
436  }
437  $this->addItem($category);
438 
439  $sectionHeader = new ilFormSectionHeaderGUI();
440  $sectionHeader->setTitle($lng->txt('lti_con_prov_hints'));
441  $this->addItem($sectionHeader);
442 
443  $remarksInp = new ilTextAreaInputGUI($lng->txt('lti_con_prov_remarks'), 'remarks');
444  $remarksInp->setValue($this->provider->getRemarks());
445  $remarksInp->setRows(6);
446  $this->addItem($remarksInp);
447  }
This class represents an option in a radio group.
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)
This class represents a number property in a property form.
global $DIC
Definition: shib_login.php:22
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 849 of file class.ilLTIConsumeProviderFormGUI.php.

References ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilLTIConsumeProvider\getKeyType(), ilLTIConsumeProvider\getLtiVersion(), isAdminContext(), ilLTIConsumeProvider\isContentItem(), ilLTIConsumeProvider\isProviderKeyCustomizable(), ilLTIConsumeProvider\isValidCategory(), null, 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().

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

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