ILIAS  release_8 Revision v8.23
ilLTIConsumerSettingsFormGUI Class Reference
+ Inheritance diagram for ilLTIConsumerSettingsFormGUI:
+ Collaboration diagram for ilLTIConsumerSettingsFormGUI:

Public Member Functions

 __construct (ilObjLTIConsumer $object, string $formaction, string $saveCommand, string $cancelCommand)
 ilLTIConsumerSettingsFormGUI constructor. More...
 
 initObject (ilObjLTIConsumer $object)
 
- 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 Member Functions

 initForm (string $formaction, string $saveCommand, string $cancelCommand)
 
- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 

Protected Attributes

ilObjLTIConsumer $object
 
- 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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerSettingsFormGUI::__construct ( ilObjLTIConsumer  $object,
string  $formaction,
string  $saveCommand,
string  $cancelCommand 
)

ilLTIConsumerSettingsFormGUI constructor.

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

References $object, ILIAS\GlobalScreen\Provider\__construct(), and initForm().

40  {
41  $this->object = $object;
42 
44 
45  $this->initForm($formaction, $saveCommand, $cancelCommand);
46  }
initForm(string $formaction, string $saveCommand, string $cancelCommand)
__construct(Container $dic, ilPlugin $plugin)
string $formaction
+ Here is the call graph for this function:

Member Function Documentation

◆ initForm()

ilLTIConsumerSettingsFormGUI::initForm ( string  $formaction,
string  $saveCommand,
string  $cancelCommand 
)
protected

Definition at line 48 of file class.ilLTIConsumerSettingsFormGUI.php.

References $DIC, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilObjLTIConsumer\HIGHSCORE_SHOW_ALL_TABLES, ilObjLTIConsumer\HIGHSCORE_SHOW_OWN_TABLE, ilObjLTIConsumer\HIGHSCORE_SHOW_TOP_TABLE, ilObjLTIConsumer\LAUNCH_METHOD_EMBEDDED, ilObjLTIConsumer\LAUNCH_METHOD_NEW_WIN, ilObjLTIConsumer\LAUNCH_METHOD_OWN_WIN, ILIAS\Repository\object(), ilFormGUI\setFormAction(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilTextAreaInputGUI\setRows(), ilNumberInputGUI\setSize(), ilPropertyFormGUI\setTitle(), ilCheckboxInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by __construct().

48  : void
49  {
50  global $DIC; /* @var \ILIAS\DI\Container $DIC */
51  $DIC->language()->loadLanguageModule('lti');
52  $this->setFormAction($formaction);
53  $this->addCommandButton($saveCommand, $DIC->language()->txt('save'));
54  $this->addCommandButton($cancelCommand, $DIC->language()->txt('cancel'));
55 
56  $this->setTitle($DIC->language()->txt('lti_settings_form'));
57 
58  $item = new ilNonEditableValueGUI($DIC->language()->txt('provider_info'));
59  $item->setValue($this->object->getProvider()->getTitle());
60  $item->setInfo(htmlspecialchars($this->object->getProvider()->getDescription()));
61  $this->addItem($item);
62 
63  $item = new ilTextInputGUI($DIC->language()->txt('title'), 'title');
64  $item->setSize(40);
65  $item->setMaxLength(128);
66  $item->setRequired(true);
67  $item->setInfo($DIC->language()->txt('title_info'));
68  $item->setValue($this->object->getTitle());
69  $this->addItem($item);
70 
71  $item = new ilTextAreaInputGUI($DIC->language()->txt('description'), 'description');
72  $item->setInfo($DIC->language()->txt('description_info'));
73  $item->setRows(2);
74  $item->setValue($this->object->getDescription());
75  $this->addItem($item);
76 
77  $item = new ilCheckboxInputGUI($DIC->language()->txt('online'), 'online');
78  $item->setInfo($DIC->language()->txt("online_info"));
79  $item->setValue("1");
80  if (!$this->object->getOfflineStatus()) {
81  $item->setChecked(true);
82  }
83  $this->addItem($item);
84 
85  if ($this->object->getProvider()->getLtiVersion() == 'LTI-1p0' && $this->object->getProvider()->isProviderKeyCustomizable()) {
86  $sectionHeader = new ilFormSectionHeaderGUI();
87  $sectionHeader->setTitle($DIC->language()->txt('lti_con_prov_authentication'));
88  $this->addItem($sectionHeader);
89 
90  $providerKeyInp = new ilTextInputGUI($DIC->language()->txt('lti_con_prov_key'), 'provider_key');
91  $providerKeyInp->setValue($this->object->getCustomLaunchKey());
92  $providerKeyInp->setRequired(true);
93  $this->addItem($providerKeyInp);
94 
95  $providerSecretInp = new ilTextInputGUI($DIC->language()->txt('lti_con_prov_secret'), 'provider_secret');
96  $providerSecretInp->setValue($this->object->getCustomLaunchSecret());
97  $providerSecretInp->setRequired(true);
98  $this->addItem($providerSecretInp);
99  }
100 
101  if ($this->object->getProvider()->getHasOutcome()) {
102  $sectionHeader = new ilFormSectionHeaderGUI();
103  $sectionHeader->setTitle($DIC->language()->txt('learning_progress_options'));
104  $this->addItem($sectionHeader);
105  $masteryScore = new ilNumberInputGUI($DIC->language()->txt('mastery_score'), 'mastery_score');
106  $masteryScore->setInfo($DIC->language()->txt('mastery_score_info'));
107  $masteryScore->setSuffix('%');
108  $masteryScore->allowDecimals(true);
109  $masteryScore->setDecimals(2);
110  $masteryScore->setMinvalueShouldBeGreater(false);
111  $masteryScore->setMinValue(0);
112  $masteryScore->setMaxvalueShouldBeLess(false);
113  $masteryScore->setMaxValue(100);
114  $masteryScore->setSize(4);
115  $masteryScore->setValue((string) $this->object->getMasteryScorePercent());
116  $this->addItem($masteryScore);
117  }
118 
119  $item = new ilFormSectionHeaderGUI();
120  $item->setTitle($DIC->language()->txt('lti_form_section_appearance'));
121  $this->addItem($item);
122 
123  $item = new ilRadioGroupInputGUI($DIC->language()->txt('launch_method'), 'launch_method');
124  $item->setRequired(true);
125  $item->setValue($this->object->getLaunchMethod());
126  $optOwnWindow = new ilRadioOption(
127  $DIC->language()->txt('launch_method_own_win'),
129  );
130  $optOwnWindow->setInfo($DIC->language()->txt('launch_method_own_win_info'));
131  $item->addOption($optOwnWindow);
132  $optAnyWindow = new ilRadioOption(
133  $DIC->language()->txt('launch_method_new_win'),
135  );
136  $optAnyWindow->setInfo($DIC->language()->txt('launch_method_new_win_info'));
137  $item->addOption($optAnyWindow);
138  $optEmbedded = new ilRadioOption(
139  $DIC->language()->txt('launch_method_embedded'),
141  );
142  $optEmbedded->setInfo($DIC->language()->txt('launch_method_embedded_info'));
143  $item->addOption($optEmbedded);
144  $this->addItem($item);
145 
146  $customParams = new ilTextAreaInputGUI($DIC->language()->txt('launch_custom_params'), 'custom_params');
147  $customParams->setRows(6);
148  $customParams->setValue($this->object->getCustomParams());
149  $customParams->setInfo($DIC->language()->txt('lti_con_prov_custom_params_info'));
150  $this->addItem($customParams);
151 
152  if ($this->object->getProvider()->getUseXapi()) {
153  $item = new ilCheckboxInputGUI($DIC->language()->txt('use_xapi'), 'use_xapi');
154  $item->setInfo($DIC->language()->txt("use_xapi_info"));
155  $item->setValue("1");
156  if ($this->object->getUseXapi()) {
157  $item->setChecked(true);
158  }
159 
160  if (!strlen($this->object->getProvider()->getXapiActivityId())) {
161  $subitem = new ilTextInputGUI($DIC->language()->txt('activity_id'), 'activity_id');
162  $subitem->setSize(40);
163  $subitem->setMaxLength(128);
164  $subitem->setRequired(true);
165  $subitem->setInfo($DIC->language()->txt('activity_id_info'));
166  $subitem->setValue($this->object->getCustomActivityId());
167  $item->addSubItem($subitem);
168  }
169 
170  $subitem = new ilCheckboxInputGUI($DIC->language()->txt('show_statements'), 'show_statements');
171  $subitem->setInfo($DIC->language()->txt("show_statements_info"));
172  $subitem->setValue("1");
173  if ($this->object->isStatementsReportEnabled()) {
174  $subitem->setChecked(true);
175  }
176  $item->addSubItem($subitem);
177 
178  $highscore = new ilCheckboxInputGUI($DIC->language()->txt("highscore_enabled"), "highscore_enabled");
179  $highscore->setValue("1");
180  $highscore->setChecked($this->object->getHighscoreEnabled());
181  $highscore->setInfo($DIC->language()->txt("highscore_description"));
182  $highscore_tables = new ilRadioGroupInputGUI($DIC->language()->txt('highscore_mode'), 'highscore_mode');
183  $highscore_tables->setRequired(true);
184  $highscore_tables->setValue((string) $this->object->getHighscoreMode());
185  $highscore_table_own = new ilRadioOption($DIC->language()->txt('highscore_own_table'), (string) ilObjLTIConsumer::HIGHSCORE_SHOW_OWN_TABLE);
186  $highscore_table_own->setInfo($DIC->language()->txt('highscore_own_table_description'));
187  $highscore_tables->addOption($highscore_table_own);
188  $highscore_table_other = new ilRadioOption($DIC->language()->txt('highscore_top_table'), (string) ilObjLTIConsumer::HIGHSCORE_SHOW_TOP_TABLE);
189  $highscore_table_other->setInfo($DIC->language()->txt('highscore_top_table_description'));
190  $highscore_tables->addOption($highscore_table_other);
191  $highscore_table_other = new ilRadioOption($DIC->language()->txt('highscore_all_tables'), (string) ilObjLTIConsumer::HIGHSCORE_SHOW_ALL_TABLES);
192  $highscore_table_other->setInfo($DIC->language()->txt('highscore_all_tables_description'));
193  $highscore_tables->addOption($highscore_table_other);
194  $highscore->addSubItem($highscore_tables);
195  $highscore_top_num = new ilNumberInputGUI($DIC->language()->txt("highscore_top_num"), "highscore_top_num");
196  $highscore_top_num->setSize(4);
197  $highscore_top_num->setRequired(true);
198  $highscore_top_num->setMinValue(1);
199  $highscore_top_num->setSuffix($DIC->language()->txt("highscore_top_num_unit"));
200  $highscore_top_num->setValue((string) $this->object->getHighscoreTopNum(0));
201  $highscore_top_num->setInfo($DIC->language()->txt("highscore_top_num_description"));
202  $highscore->addSubItem($highscore_top_num);
203  $highscore_achieved_ts = new ilCheckboxInputGUI($DIC->language()->txt("highscore_achieved_ts"), "highscore_achieved_ts");
204  $highscore_achieved_ts->setValue("1");
205  $highscore_achieved_ts->setChecked($this->object->getHighscoreAchievedTS());
206  $highscore_achieved_ts->setInfo($DIC->language()->txt("highscore_achieved_ts_description"));
207  $highscore->addSubItem($highscore_achieved_ts);
208  $highscore_percentage = new ilCheckboxInputGUI($DIC->language()->txt("highscore_percentage"), "highscore_percentage");
209  $highscore_percentage->setValue("1");
210  $highscore_percentage->setChecked($this->object->getHighscorePercentage());
211  $highscore_percentage->setInfo($DIC->language()->txt("highscore_percentage_description"));
212  $highscore->addSubItem($highscore_percentage);
213  $highscore_wtime = new ilCheckboxInputGUI($DIC->language()->txt("highscore_wtime"), "highscore_wtime");
214  $highscore_wtime->setValue("1");
215  $highscore_wtime->setChecked($this->object->getHighscoreWTime());
216  $highscore_wtime->setInfo($DIC->language()->txt("highscore_wtime_description"));
217  $highscore->addSubItem($highscore_wtime);
218 
219  $item->addSubItem($highscore);
220  $this->addItem($item);
221  }
222  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
This class represents a checkbox property in a property form.
global $DIC
Definition: feed.php:28
This class represents a property in a property form.
setFormAction(string $a_formaction)
This class represents a number property in a property form.
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
string $formaction
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initObject()

ilLTIConsumerSettingsFormGUI::initObject ( ilObjLTIConsumer  $object)

Definition at line 224 of file class.ilLTIConsumerSettingsFormGUI.php.

References ilObjLTIConsumer\getHighscoreEnabled(), ilPropertyFormGUI\getInput(), ilObjLTIConsumer\getProvider(), ilObjLTIConsumer\getUseXapi(), ILIAS\Repository\object(), ilObjLTIConsumer\setCustomActivityId(), ilObjLTIConsumer\setCustomLaunchKey(), ilObjLTIConsumer\setCustomLaunchSecret(), ilObjLTIConsumer\setCustomParams(), ilObject\setDescription(), ilObjLTIConsumer\setHighscoreAchievedTS(), ilObjLTIConsumer\setHighscoreEnabled(), ilObjLTIConsumer\setHighscoreMode(), ilObjLTIConsumer\setHighscorePercentage(), ilObjLTIConsumer\setHighscoreTopNum(), ilObjLTIConsumer\setHighscoreWTime(), ilObjLTIConsumer\setLaunchMethod(), ilObjLTIConsumer\setMasteryScorePercent(), ilObject\setOfflineStatus(), ilObjLTIConsumer\setStatementsReportEnabled(), ilObject\setTitle(), and ilObjLTIConsumer\setUseXapi().

224  : void
225  {
226  $object->setTitle($this->getInput('title'));
227  $object->setDescription($this->getInput('description'));
228  $object->setOfflineStatus(!(bool) $this->getInput('online'));
229 
230  if ($object->getProvider()->getLtiVersion() == 'LTI-1p0' && $object->getProvider()->isProviderKeyCustomizable()) {
231  $object->setCustomLaunchKey($this->getInput('provider_key'));
232  $object->setCustomLaunchSecret($this->getInput('provider_secret'));
233  }
234 
235  if ($object->getProvider()->getHasOutcome()) {
236  $object->setMasteryScorePercent($this->getInput('mastery_score'));
237  }
238 
239  $object->setLaunchMethod($this->getInput('launch_method'));
240  $object->setCustomParams($this->getInput('custom_params'));
241  $object->setUseXapi((bool) $this->getInput('use_xapi'));
242  if ($object->getUseXapi()) {
243  if (!strlen($this->object->getProvider()->getXapiActivityId())) {
244  $object->setCustomActivityId($this->getInput('activity_id'));
245  }
246  $object->setStatementsReportEnabled((bool) $this->getInput('show_statements'));
247  $object->setHighscoreEnabled((bool) $this->getInput('highscore_enabled'));
248  if ($object->getHighscoreEnabled()) {
249  // highscore settings
250  $object->setHighscoreEnabled((bool) $this->getInput('highscore_enabled'));
251  $object->setHighscoreAchievedTS((bool) $this->getInput('highscore_achieved_ts'));
252  $object->setHighscorePercentage((bool) $this->getInput('highscore_percentage'));
253  $object->setHighscoreWTime((bool) $this->getInput('highscore_wtime'));
254  $object->setHighscoreMode((int) $this->getInput('highscore_mode'));
255  $object->setHighscoreTopNum((int) $this->getInput('highscore_top_num'));
256  }
257  }
258  }
setUseXapi(bool $use_xapi)
setCustomActivityId(string $custom_activity_id)
setCustomParams(string $customParams)
setHighscoreEnabled(bool $a_enabled)
HIGHSCORE.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
setStatementsReportEnabled(bool $statementsReportEnabled)
setMasteryScorePercent(float $mastery_score_percent)
setHighscoreWTime(bool $a_wtime)
Sets if the workingtime of the scores should be shown.
setHighscoreAchievedTS(bool $a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setCustomLaunchSecret(string $customLaunchSecret)
setTitle(string $title)
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-...
setDescription(string $desc)
setLaunchMethod(string $launchMethod)
setOfflineStatus(bool $status)
setHighscorePercentage(bool $a_percentage)
Sets if the percentages of the scores pass should be shown.
setCustomLaunchKey(string $customLaunchKey)
setHighscoreTopNum(int $a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
+ Here is the call graph for this function:

Field Documentation

◆ $object

ilObjLTIConsumer ilLTIConsumerSettingsFormGUI::$object
protected

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

Referenced by __construct().


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