ILIAS  release_8 Revision v8.24
ilObjLTIAdministrationGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjLTIAdministrationGUI:
+ Collaboration diagram for ilObjLTIAdministrationGUI:

Public Member Functions

 __construct (?array $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getType ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 addProvidingSubtabs ()
 
 initSettingsForm (ilPropertyFormGUI $form=null)
 
 getSettingsForm ()
 
 createLtiUserRole ()
 
 initConsumerForm (ilPropertyFormGUI $form=null)
 
 getConsumerForm (string $a_mode='')
 
 editConsumer (ilPropertyFormGUI $a_form=null)
 Edit consumer. More...
 
 createLTIConsumer ()
 Create new lti consumer. More...
 
 updateLTIConsumer ()
 Update lti consumer settings. More...
 
 deleteLTIConsumer ()
 Delete consumers. More...
 
 listConsumers ()
 List consumers. More...
 
 changeStatusLTIConsumer ()
 Change activation status. More...
 
 releasedObjects ()
 Show relases objects. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Private Attributes

ilLTIDataConnector $dataConnector = null
 
int $consumer_id = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjLTIAdministrationGUI

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

@ilCtrl_Calls ilObjLTIAdministrationGUI: ilPermissionGUI @ilCtrl_Calls ilObjLTIAdministrationGUI: ilLTIConsumerAdministrationGUI @ilCtrl_isCalledBy ilObjLTIAdministrationGUI: ilAdministrationGUI

Definition at line 30 of file class.ilObjLTIAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjLTIAdministrationGUI::__construct ( ?array  $a_data,
int  $a_id,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)

Definition at line 36 of file class.ilObjLTIAdministrationGUI.php.

37 {
38 global $DIC;
39 $DIC->language()->loadLanguageModule('lti'); //&ltis
40 $this->type = "ltis";
41 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
42 $this->dataConnector = new ilLTIDataConnector();
43
44 if ($DIC->http()->wrapper()->query()->has("cid")) {
45 $this->consumer_id = (int) $DIC->http()->wrapper()->query()->retrieve("cid", $DIC->refinery()->kindlyTo()->int());
46 }
47 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

Member Function Documentation

◆ addProvidingSubtabs()

ilObjLTIAdministrationGUI::addProvidingSubtabs ( )
protected

Definition at line 115 of file class.ilObjLTIAdministrationGUI.php.

115 : void
116 {
117 if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
118 // currently no general settings.
119 // $this->tabs_gui->addTab("settings",
120 // $this->lng->txt("settings"),
121 // $this->ctrl->getLinkTarget($this, "initSettingsForm"));
122
123 $this->tabs_gui->addSubTab(
124 "consumers",
125 $this->lng->txt("consumers"),
126 $this->ctrl->getLinkTarget($this, "listConsumers")
127 );
128 }
129 if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
130 $this->tabs_gui->addSubTab(
131 "releasedObjects",
132 $this->lng->txt("lti_released_objects"),
133 $this->ctrl->getLinkTarget($this, "releasedObjects")
134 );
135 }
136 }

References ILIAS\Repository\lng().

Referenced by getAdminTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeStatusLTIConsumer()

ilObjLTIAdministrationGUI::changeStatusLTIConsumer ( )
protected

Change activation status.

Definition at line 450 of file class.ilObjLTIAdministrationGUI.php.

450 : void
451 {
452 if (!$this->consumer_id) {
453 $this->ctrl->redirect($this, "listConsumers");
454 }
455
456 $consumer = ilLTIPlatform::fromExternalConsumerId($this->consumer_id, $this->dataConnector);
457 if ($consumer->getActive()) {
458 $consumer->setActive(false);
459 $msg = "lti_consumer_set_inactive";
460 } else {
461 $consumer->setActive(true);
462 $msg = "lti_consumer_set_active";
463 }
464 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
465 $this->tpl->setOnScreenMessage('success', $this->lng->txt($msg), true);
466
467 $this->ctrl->redirect($this, 'listConsumers');
468 }
static fromExternalConsumerId(int $id, ilLTIDataConnector $dataConnector)

References ILIAS\Repository\ctrl(), ilLTIPlatform\fromExternalConsumerId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ createLTIConsumer()

ilObjLTIAdministrationGUI::createLTIConsumer ( )
protected

Create new lti consumer.

Definition at line 338 of file class.ilObjLTIAdministrationGUI.php.

338 : void
339 {
340 $this->checkPermission("write");
341
342 $form = $this->getConsumerForm();
343
344 if ($form->checkInput()) {
345 // $consumer = new ilLTIExternalConsumer();
346 // $dataConnector = new ilLTIDataConnector();
347 $consumer = new ilLTIPlatform(null, $this->dataConnector);
348 $consumer->setTitle($form->getInput('title'));
349 $consumer->setDescription($form->getInput('description'));
350 $consumer->setPrefix($form->getInput('prefix'));
351 $consumer->setLanguage($form->getInput('language'));
352 $consumer->setActive((bool) $form->getInput('active'));
353 $consumer->setRole((int) $form->getInput('role'));
354 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
355
356 $this->object->saveConsumerObjectTypes(
357 $consumer->getExtConsumerId(),
358 $form->getInput('types')
359 );
360 $this->tpl->setOnScreenMessage('success', $this->lng->txt("lti_consumer_created"), true);
361 $this->ctrl->redirect($this, 'listConsumers');
362 }
363
364 $form->setValuesByPost();
365 $this->listConsumers();
366 return;
367 }
LTI provider for LTI launch.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getConsumerForm(), listConsumers(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ createLtiUserRole()

ilObjLTIAdministrationGUI::createLtiUserRole ( )
protected

Definition at line 208 of file class.ilObjLTIAdministrationGUI.php.

208 : void
209 {
210 // include_once './Services/AccessControl/classes/class.ilObjRole.php';
211 $role = new ilObjRole();
212 $role->setTitle("il_lti_global_role");
213 $role->setDescription("This global role should only contain the permission 'read' for repository and categories. Do not rename this role.");
214 $role->create();
215 $this->rbac_admin->assignRoleToFolder($role->getId(), 8, 'y');
216 $this->rbac_admin->setProtected(8, $role->getId(), 'y');
217 $this->rbac_admin->setRolePermission($role->getId(), 'root', [3], 8);
218 $this->rbac_admin->setRolePermission($role->getId(), 'cat', [3], 8);
219 $this->rbac_admin->grantPermission($role->getId(), [3], ROOT_FOLDER_ID);
220 $role->changeExistingObjects(
223 array('cat'),
224 array()
225 );
226
227 $this->tpl->setOnScreenMessage('success', $this->lng->txt("lti_user_role_created"), true);
228 $this->listConsumers();
229 }
Class ilObjRole.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
const ROOT_FOLDER_ID
Definition: constants.php:32

References listConsumers(), ILIAS\Repository\lng(), ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

◆ deleteLTIConsumer()

ilObjLTIAdministrationGUI::deleteLTIConsumer ( )
protected

Delete consumers.

Definition at line 402 of file class.ilObjLTIAdministrationGUI.php.

402 : void
403 {
404 $consumer_id = 0;
405 if ($this->request_wrapper->has('cid')) {
406 $consumer_id = (int) $this->request_wrapper->retrieve('cid', $this->refinery->kindlyTo()->int());
407 }
408
409 if ($consumer_id == 0) {
410 $this->ctrl->redirect($this, "listConsumers");
411 }
412 $consumer = ilLTIPlatform::fromExternalConsumerId($consumer_id, $this->dataConnector);
413 $consumer->deleteGlobalToolConsumerSettings($this->dataConnector);
414 $this->tpl->setOnScreenMessage('success', $this->lng->txt("lti_consumer_deleted"), true);
415 $this->ctrl->redirect($this, 'listConsumers');
416 }

References $consumer_id, ILIAS\Repository\ctrl(), ilLTIPlatform\fromExternalConsumerId(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ editConsumer()

ilObjLTIAdministrationGUI::editConsumer ( ilPropertyFormGUI  $a_form = null)
protected

Edit consumer.

Parameters
ilPropertyFormGUI$a_form

Definition at line 313 of file class.ilObjLTIAdministrationGUI.php.

313 : void
314 {
315 $this->ctrl->setParameter($this, "cid", $this->consumer_id);
316
317 if (!$this->consumer_id) {
318 $this->ctrl->redirect($this, "listConsumers");
319 }
320
321 $consumer = ilLTIPlatform::fromExternalConsumerId($this->consumer_id, $this->dataConnector);
322 if (!$a_form instanceof ilPropertyFormGUI) {
323 $a_form = $this->getConsumerForm('edit');
324 $a_form->getItemByPostVar("title")->setValue($consumer->getTitle());
325 $a_form->getItemByPostVar("description")->setValue($consumer->getDescription());
326 $a_form->getItemByPostVar("prefix")->setValue($consumer->getPrefix());
327 $a_form->getItemByPostVar("language")->setValue($consumer->getLanguage());
328 $a_form->getItemByPostVar("active")->setChecked($consumer->getActive());
329 $a_form->getItemByPostVar("role")->setValue($consumer->getRole());
330 $a_form->getItemByPostVar("types")->setValue($this->object->getActiveObjectTypes($this->consumer_id));
331 }
332 $this->tpl->setContent($a_form->getHTML());
333 }
This class represents a property form user interface.
getItemByPostVar(string $a_post_var)

References ILIAS\Repository\ctrl(), ilLTIPlatform\fromExternalConsumerId(), getConsumerForm(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLTIAdministrationGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 49 of file class.ilObjLTIAdministrationGUI.php.

49 : void
50 {
51 $next_class = $this->ctrl->getNextClass($this);
52 $cmd = $this->ctrl->getCmd();
53
54 $this->prepareOutput();
55
56 switch ($next_class) {
57 case 'ilpermissiongui':
58 $GLOBALS['ilTabs']->activateTab('perm_settings');
59 $perm_gui = new ilPermissionGUI($this);
60 $this->ctrl->forwardCommand($perm_gui);
61 break;
62
63 case 'illticonsumeradministrationgui':
64 $this->tabs_gui->activateTab('lti_consuming');
66 $this->ctrl->forwardCommand($gui);
67 break;
68
69 default:
70 $this->tabs_gui->activateTab('lti_providing');
71 if (!$cmd || $cmd == 'view') {
72 $cmd = 'listConsumers';
73 } elseif ($cmd == 'createconsumer') {
74 $cmd = "initConsumerForm";
75 }
76 $this->$cmd();
77 break;
78 }
79 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References $GLOBALS, ILIAS\Repository\ctrl(), and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjLTIAdministrationGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 86 of file class.ilObjLTIAdministrationGUI.php.

86 : void
87 {
88 if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
89 $this->tabs_gui->addTab(
90 'lti_providing',
91 $this->lng->txt("lti_providing_tab"),
92 $this->ctrl->getLinkTarget($this, "listConsumers")
93 );
94
95 $this->tabs_gui->addTab(
96 'lti_consuming',
97 $this->lng->txt("lti_consuming_tab"),
98 $this->ctrl->getLinkTargetByClass('ilLTIConsumerAdministrationGUI')
99 );
100
101 if ($this->ctrl->getCmdClass() == 'ilobjltiadministrationgui') {
102 $this->addProvidingSubtabs();
103 }
104 }
105
106 if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
107 $this->tabs_gui->addTab(
108 "perm_settings",
109 $this->lng->txt("perm_settings"),
110 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
111 );
112 }
113 }

References addProvidingSubtabs(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getConsumerForm()

ilObjLTIAdministrationGUI::getConsumerForm ( string  $a_mode = '')
protected

Definition at line 242 of file class.ilObjLTIAdministrationGUI.php.

243 {
244 $this->tabs_gui->activateSubTab("consumers");
245
246 $form = new ilPropertyFormGUI();
247
248 $ti_title = new ilTextInputGUI($this->lng->txt("title"), 'title');
249 $ti_title->setRequired(true);
250 $form->addItem($ti_title);
251 $ti_description = new ilTextInputGUI($this->lng->txt("description"), 'description');
252 $form->addItem($ti_description);
253 $ti_prefix = new ilTextInputGUI($this->lng->txt("prefix"), 'prefix');
254 $ti_prefix->setInfo($this->lng->txt("prefix_info"));
255 $ti_prefix->setRequired(true);
256 $form->addItem($ti_prefix);
257 #$ti_key = new ilTextInputGUI($this->lng->txt("lti_consumer_key"), 'key');
258 #$ti_key->setRequired(true);
259 #$ti_secret = new ilTextInputGUI($this->lng->txt("lti_consumer_secret"), 'secret');
260 #$ti_secret->setRequired(true);
261
262 $languages = $this->lng->getInstalledLanguages();
263 $array_lang = [];
264 $options = [];
265 foreach ($languages as $lang_key) {
266 $array_lang[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key);
267 }
268
269 $si_language = new ilSelectInputGUI($this->lng->txt("language"), "language");
270 $si_language->setOptions($array_lang);
271 $form->addItem($si_language);
272
273 // object types
274 $cb_obj_types = new ilCheckboxGroupInputGUI($this->lng->txt("act_lti_for_obj_type"), 'types');
275
276 $valid_obj_types = $this->object->getLTIObjectTypes();
277 foreach ($valid_obj_types as $obj_type) {
278 $object_name = $this->lng->txt('objs_' . $obj_type);
279 $cb_obj_types->addOption(new ilCheckboxOption($object_name, $obj_type));
280 }
281 $form->addItem($cb_obj_types);
282
283 // test roles
284 $roles = $this->object->getLTIRoles();
285 foreach ($roles as $role_id => $role_name) {
286 $options[$role_id] = $role_name;
287 }
288 $si_roles = new ilSelectInputGUI($this->lng->txt("gbl_roles_to_users"), 'role');
289 $si_roles->setOptions($options);
290 $form->addItem($si_roles);
291
292 $cb_active = new ilCheckboxInputGUI($this->lng->txt('active'), 'active');
293 $form->addItem($cb_active);
294
295 if ($a_mode == 'edit') {
296 $form->setFormAction($this->ctrl->getFormAction($this, 'editLTIConsumer'));
297 $form->setTitle($this->lng->txt("lti_edit_consumer"));
298 $form->addCommandButton("updateLTIConsumer", $this->lng->txt("save"));
299 } else {
300 $form->setFormAction($this->ctrl->getFormAction($this, 'createLTIConsumer'));
301 $form->setTitle($this->lng->txt("lti_create_consumer"));
302 $form->addCommandButton("createLTIConsumer", $this->lng->txt("save"));
303 $form->addCommandButton('listConsumers', $this->lng->txt('cancel'));
304 }
305
306 return $form;
307 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupEntry(string $a_lang_key, string $a_mod, string $a_id)
This class represents a selection list property in a property form.
This class represents a text property in a property form.

References ilLanguage\_lookupEntry(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by createLTIConsumer(), editConsumer(), initConsumerForm(), and updateLTIConsumer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSettingsForm()

ilObjLTIAdministrationGUI::getSettingsForm ( )
protected

Definition at line 148 of file class.ilObjLTIAdministrationGUI.php.

149 {
150 $form = new ilPropertyFormGUI();
151 /*
152 $form->setFormAction($this->ctrl->getFormAction($this,'saveSettingsForm'));
153 $form->setTitle($this->lng->txt("lti_settings"));
154
155 // object types
156 $cb_obj_types = new ilCheckboxGroupInputGUI($this->lng->txt("act_lti_for_obj_type"), 'types');
157
158 $valid_obj_types = $this->object->getLTIObjectTypes();
159 foreach($valid_obj_types as $obj_type_id => $obj_name)
160 {
161 $cb_obj_types->addOption(new ilCheckboxOption($obj_name, $obj_type_id));
162 }
163 $objs_active = $this->object->getActiveObjectTypes();
164 $cb_obj_types->setValue($objs_active);
165 $form->addItem($cb_obj_types);
166
167 // test roles
168 $roles = $this->object->getLTIRoles();
169 foreach($roles as $role_id => $role_name)
170 {
171 $options[$role_id] = $role_name;
172 }
173 $si_roles = new ilSelectInputGUI($this->lng->txt("gbl_roles_to_users"), 'roles');
174 $si_roles->setOptions($options);
175 $si_roles->setValue($this->object->getCurrentRole());
176 $form->addItem($si_roles);
177
178 $form->addCommandButton("saveSettingsForm", $this->lng->txt("save"));
179 */
180 return $form;
181 }

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ getType()

ilObjLTIAdministrationGUI::getType ( )

Definition at line 81 of file class.ilObjLTIAdministrationGUI.php.

81 : string
82 {
83 return "ltis";
84 }

◆ initConsumerForm()

ilObjLTIAdministrationGUI::initConsumerForm ( ilPropertyFormGUI  $form = null)
protected

Definition at line 234 of file class.ilObjLTIAdministrationGUI.php.

234 : void
235 {
236 if (!($form instanceof ilPropertyFormGUI)) {
237 $form = $this->getConsumerForm();
238 }
239 $this->tpl->setContent($form->getHTML());
240 }

References getConsumerForm().

+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjLTIAdministrationGUI::initSettingsForm ( ilPropertyFormGUI  $form = null)
protected

Definition at line 138 of file class.ilObjLTIAdministrationGUI.php.

138 : void
139 {
140 if (!($form instanceof ilPropertyFormGUI)) {
141 $form = $this->getSettingsForm();
142 }
143 $this->tabs_gui->activateSubTab("settings");
144 $this->tpl->setContent($form->getHTML());
145 }

References getSettingsForm().

+ Here is the call graph for this function:

◆ listConsumers()

ilObjLTIAdministrationGUI::listConsumers ( )
protected

List consumers.

Definition at line 422 of file class.ilObjLTIAdministrationGUI.php.

422 : void
423 {
424 if ($this->checkPermissionBool('write')) {
425 $this->toolbar->addButton(
426 $this->lng->txt('lti_create_consumer'),
427 $this->ctrl->getLinkTarget($this, 'createconsumer')
428 );
429 if (ilObject::_getIdsForTitle("il_lti_global_role", "role", false) == []) {
430 $this->toolbar->addButton(
431 $this->lng->txt('lti_create_lti_user_role'),
432 $this->ctrl->getLinkTarget($this, 'createLtiUserRole')
433 );
434 $this->toolbar->addText($this->lng->txt('lti_user_role_info'));
435 }
436 }
437
438 $this->tabs_gui->activateSubTab("consumers");
439 $tbl = new ilObjectConsumerTableGUI(
440 $this,
441 "listConsumers"
442 );
443 $tbl->setEditable($this->checkPermissionBool('write'));
444 $this->tpl->setContent($tbl->getHTML());
445 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static _getIdsForTitle(string $title, string $type='', bool $partial_match=false)

References ilObject\_getIdsForTitle(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by createLTIConsumer(), createLtiUserRole(), and updateLTIConsumer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ releasedObjects()

ilObjLTIAdministrationGUI::releasedObjects ( )
protected

Show relases objects.

Definition at line 473 of file class.ilObjLTIAdministrationGUI.php.

473 : void
474 {
475 $this->tabs_gui->activateSubTab('releasedObjects');
476
477 $table = new ilLTIProviderReleasedObjectsTableGUI($this, 'releasedObjects', 'ltireleases');
478 $table->init();
479 $table->parse();
480
481 $this->tpl->setContent($table->getHTML());
482 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ updateLTIConsumer()

ilObjLTIAdministrationGUI::updateLTIConsumer ( )
protected

Update lti consumer settings.

Definition at line 372 of file class.ilObjLTIAdministrationGUI.php.

372 : void
373 {
374 $this->checkPermission("write");
375
376 if (!$this->consumer_id) {
377 $this->ctrl->redirect($this, "listConsumers");
378 }
379
380 $this->ctrl->setParameter($this, "cid", $this->consumer_id);
381
382 $consumer = ilLTIPlatform::fromExternalConsumerId($this->consumer_id, $this->dataConnector);
383 $form = $this->getConsumerForm('edit');
384 if ($form->checkInput()) {
385 $consumer->setTitle($form->getInput('title'));
386 $consumer->setDescription($form->getInput('description'));
387 $consumer->setPrefix($form->getInput('prefix'));
388 $consumer->setLanguage($form->getInput('language'));
389 $consumer->setActive((bool) $form->getInput('active'));
390 $consumer->setRole((int) $form->getInput('role'));
391 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
392 $this->object->saveConsumerObjectTypes($this->consumer_id, $form->getInput('types'));
393
394 $this->tpl->setOnScreenMessage('success', $this->lng->txt("lti_consumer_updated"), true);
395 }
396 $this->listConsumers();
397 }

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilLTIPlatform\fromExternalConsumerId(), getConsumerForm(), listConsumers(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $consumer_id

int ilObjLTIAdministrationGUI::$consumer_id = null
private

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

Referenced by deleteLTIConsumer().

◆ $dataConnector

ilLTIDataConnector ilObjLTIAdministrationGUI::$dataConnector = null
private

Definition at line 32 of file class.ilObjLTIAdministrationGUI.php.


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