ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLTIConsumerSettingsFormGUI Class Reference
+ Inheritance diagram for ilLTIConsumerSettingsFormGUI:
+ Collaboration diagram for ilLTIConsumerSettingsFormGUI:

Public Member Functions

 __construct (ilObjLTIConsumer $object, $formaction, $saveCommand, $cancelCommand)
 ilLTIConsumerSettingsFormGUI constructor. More...
 
 initObject (ilObjLTIConsumer $object)
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 setForceTopButtons ($a_val)
 Set force top buttons. More...
 
 getForceTopButtons ()
 Get force top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var, $a_remove_unused_headers=false)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ( $a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Protected Member Functions

 initForm ($formaction, $saveCommand, $cancelCommand)
 
- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Protected Attributes

 $object
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
 $force_top_buttons = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

ilLTIConsumerSettingsFormGUI constructor.

Parameters
ilObjLTIConsumer$object
$formaction
$saveCommand
$cancelCommand

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

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

29  {
30  $this->object = $object;
31 
33 
34  $this->initForm($formaction, $saveCommand, $cancelCommand);
35  }
initForm($formaction, $saveCommand, $cancelCommand)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ initForm()

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

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

References $DIC, ilFormGUI\$formaction, 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, ilFormGUI\setFormAction(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setSize(), ilPropertyFormGUI\setTitle(), ilCheckboxInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by __construct().

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

◆ initObject()

ilLTIConsumerSettingsFormGUI::initObject ( ilObjLTIConsumer  $object)
Parameters
ilObjLTIConsumer$object

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

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

217  {
218  $object->setTitle($this->getInput('title'));
219  $object->setDescription($this->getInput('description'));
220  $object->setOfflineStatus(!(bool) $this->getInput('online'));
221 
222  if ($object->getProvider()->isProviderKeyCustomizable()) {
223  $object->setCustomLaunchKey($this->getInput('provider_key'));
224  $object->setCustomLaunchSecret($this->getInput('provider_secret'));
225  }
226 
227  if ($object->getProvider()->getHasOutcome()) {
228  $object->setMasteryScorePercent($this->getInput('mastery_score'));
229  }
230 
231  $object->setLaunchMethod($this->getInput('launch_method'));
232  $object->setUseXapi((bool) $this->getInput('use_xapi'));
233  if ($object->getUseXapi()) {
234  if (!strlen($this->object->getProvider()->getXapiActivityId())) {
235  $object->setCustomActivityId($this->getInput('activity_id'));
236  }
237  $object->setStatementsReportEnabled((bool) $this->getInput('show_statements'));
238  $object->setHighscoreEnabled((bool) $this->getInput('highscore_enabled'));
239  if ($object->getHighscoreEnabled()) {
240  // highscore settings
241  $object->setHighscoreEnabled((bool) $this->getInput('highscore_enabled'));
242  $object->setHighscoreAchievedTS((bool) $this->getInput('highscore_achieved_ts'));
243  $object->setHighscorePercentage((bool) $this->getInput('highscore_percentage'));
244  $object->setHighscoreWTime((bool) $this->getInput('highscore_wtime'));
245  $object->setHighscoreMode((int) $this->getInput('highscore_mode'));
246  $object->setHighscoreTopNum((int) $this->getInput('highscore_top_num'));
247  }
248  }
249  }
setUseXapi(bool $use_xapi)
setHighscoreEnabled($a_enabled)
Sets if the highscore feature should be enabled.
setCustomActivityId(string $custom_activity_id)
setDescription($a_desc)
setStatementsReportEnabled($statementsReportEnabled)
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
setHighscorePercentage($a_percentage)
Sets if the percentages of the scores pass should be shown.
setMasteryScorePercent(float $mastery_score_percent)
setCustomLaunchSecret(string $customLaunchSecret)
setHighscoreAchievedTS($a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setLaunchMethod(string $launchMethod)
setTitle($a_title)
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
setHighscoreWTime($a_wtime)
Sets if the workingtime of the scores should be shown.
setOfflineStatus($a_status)
Set offline status.
setHighscoreTopNum($a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setCustomLaunchKey(string $customLaunchKey)
+ Here is the call graph for this function:

Field Documentation

◆ $object

ilLTIConsumerSettingsFormGUI::$object
protected

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

Referenced by __construct().


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