ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjLTIAdministrationGUI Class Reference

Class ilObjLTIAdministrationGUI. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 
 executeCommand ()
 execute command More...
 
 getType ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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 @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 

Protected Member Functions

 addProvidingSubtabs ()
 
 initSettingsForm (ilPropertyFormGUI $form=null)
 
 getSettingsForm ()
 
 createLtiUserRole ()
 
 initConsumerForm (ilPropertyFormGUI $form=null)
 
 getConsumerForm ($a_mode='')
 
 editConsumer (ilPropertyFormGUI $a_form=null)
 Edit consumer @global type $ilCtrl @global type $tpl. More...
 
 createLTIConsumer ()
 Create new lti consumer. More...
 
 updateLTIConsumer ()
 Update lti consumer settings @global ilCtrl $ilCtrl. More...
 
 deleteLTIConsumer ()
 Delete consumers @global type $ilCtrl. More...
 
 listConsumers ()
 List consumers @global type $ilAccess @global type $ilToolbar. More...
 
 changeStatusLTIConsumer ()
 Change activation status @global type $ilCtrl. More...
 
 releasedObjects ()
 Show relases objects. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_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...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Attributes

 $dataConnector = null
 Data connector object or string. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjLTIAdministrationGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

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

30 {
31 $this->type = "ltis";
32 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
33 $this->dataConnector = new ilLTIDataConnector();
34
35 $GLOBALS['DIC']->language()->loadLanguageModule('lti');
36 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Class to represent an LTI Data Connector for ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addProvidingSubtabs()

ilObjLTIAdministrationGUI::addProvidingSubtabs ( )
protected

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

109 {
110 global $DIC; /* @var \ILIAS\DI\Container $DIC */
111 $rbacsystem = $DIC->rbac()->system();
112
113 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
114 // currently no general settings.
115 // $this->tabs_gui->addTab("settings",
116 // $this->lng->txt("settings"),
117 // $this->ctrl->getLinkTarget($this, "initSettingsForm"));
118
119 $this->tabs_gui->addSubTab(
120 "consumers",
121 $this->lng->txt("consumers"),
122 $this->ctrl->getLinkTarget($this, "listConsumers")
123 );
124 }
125 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
126 $this->tabs_gui->addSubTab(
127 "releasedObjects",
128 $this->lng->txt("lti_released_objects"),
129 $this->ctrl->getLinkTarget($this, "releasedObjects")
130 );
131 }
132 }
$DIC
Definition: xapitoken.php:46

References $DIC, and ilObjectGUI\$rbacsystem.

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ changeStatusLTIConsumer()

ilObjLTIAdministrationGUI::changeStatusLTIConsumer ( )
protected

Change activation status @global type $ilCtrl.

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

473 {
474 global $ilCtrl;
475
476 $consumer_id = $_REQUEST["cid"];
477
478 if (!$consumer_id) {
479 $ilCtrl->redirect($this, "listConsumers");
480 }
481
482 $consumer = ilLTIToolConsumer::fromExternalConsumerId($consumer_id, $this->dataConnector);
483 if ($consumer->getActive()) {
484 $consumer->setActive(0);
485 $msg = "lti_consumer_set_inactive";
486 } else {
487 $consumer->setActive(1);
488 $msg = "lti_consumer_set_active";
489 }
490 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
491 ilUtil::sendSuccess($this->lng->txt($msg), true);
492
493 $GLOBALS['DIC']->ctrl()->redirect($this, 'listConsumers');
494 }
static fromExternalConsumerId($id, $dataConnector)
global $ilCtrl
Definition: ilias.php:18

References $GLOBALS, $ilCtrl, and ilLTIToolConsumer\fromExternalConsumerId().

+ Here is the call graph for this function:

◆ createLTIConsumer()

ilObjLTIAdministrationGUI::createLTIConsumer ( )
protected

Create new lti consumer.

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

349 {
350 $this->checkPermission("write");
351
352 $form = $this->getConsumerForm();
353
354 if ($form->checkInput()) {
355 // $consumer = new ilLTIExternalConsumer();
356 // $dataConnector = new ilLTIDataConnector();
357 $consumer = new ilLTIToolConsumer(null, $this->dataConnector);
358 $consumer->setTitle($form->getInput('title'));
359 $consumer->setDescription($form->getInput('description'));
360 $consumer->setPrefix($form->getInput('prefix'));
361 $consumer->setLanguage($form->getInput('language'));
362 $consumer->setActive($form->getInput('active'));
363 $consumer->setRole($form->getInput('role'));
364 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
365
366 $this->object->saveConsumerObjectTypes(
367 $consumer->getExtConsumerId(),
368 $form->getInput('types')
369 );
370 ilUtil::sendSuccess($this->lng->txt("lti_consumer_created"), true);
371 $GLOBALS['DIC']->ctrl()->redirect($this, 'listConsumers');
372 }
373
374 $form->setValuesByPost();
375 $this->listConsumers();
376 return;
377 }
LTI provider for LTI launch.
listConsumers()
List consumers @global type $ilAccess @global type $ilToolbar.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

References $GLOBALS, ilObjectGUI\checkPermission(), getConsumerForm(), and listConsumers().

+ Here is the call graph for this function:

◆ createLtiUserRole()

ilObjLTIAdministrationGUI::createLtiUserRole ( )
protected

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

207 {
208 global $DIC;
209 $rbacadmin = $DIC['rbacadmin'];
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.");
214 $role->create();
215 $rbacadmin->assignRoleToFolder($role->getId(), 8, 'y');
216 $rbacadmin->setProtected(8, $role->getId(), 'y');
217 $rbacadmin->setRolePermission($role->getId(), 'root', [3], 8);
218 $rbacadmin->setRolePermission($role->getId(), 'cat', [3], 8);
219 $rbacadmin->grantPermission($role->getId(), [3], ROOT_FOLDER_ID);
220 $role->changeExistingObjects(
221 ROOT_FOLDER_ID,
223 array('cat'),
224 array());
225
226 ilUtil::sendSuccess($this->lng->txt("lti_user_role_created"), true);
227 $this->listConsumers();
228 }
Class ilObjRole.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES

References $DIC, listConsumers(), and ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES.

+ Here is the call graph for this function:

◆ deleteLTIConsumer()

ilObjLTIAdministrationGUI::deleteLTIConsumer ( )
protected

Delete consumers @global type $ilCtrl.

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

418 {
419 global $ilCtrl;
420
421 $consumer_id = $_REQUEST['cid'];
422
423 if (!$consumer_id) {
424 $ilCtrl->redirect($this, "listConsumers");
425 }
426 $consumer = ilLTIToolConsumer::fromExternalConsumerId($consumer_id, $this->dataConnector);
427 $consumer->deleteGlobalToolConsumerSettings($this->dataConnector);
428 ilUtil::sendSuccess($this->lng->txt("lti_consumer_deleted"), true);
429 $GLOBALS['DIC']->ctrl()->redirect($this, 'listConsumers');
430 }

References $GLOBALS, $ilCtrl, and ilLTIToolConsumer\fromExternalConsumerId().

+ Here is the call graph for this function:

◆ editConsumer()

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

Edit consumer @global type $ilCtrl @global type $tpl.

Parameters
ilPropertyFormGUI$a_form

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

322 {
323 global $ilCtrl, $tpl;
324 $consumer_id = $_REQUEST["cid"];
325 $ilCtrl->setParameter($this, "cid", $consumer_id);
326
327 if (!$consumer_id) {
328 $ilCtrl->redirect($this, "listConsumers");
329 }
330
331 $consumer = ilLTIToolConsumer::fromExternalConsumerId($consumer_id, $this->dataConnector);
332 if (!$a_form instanceof ilPropertyFormGUI) {
333 $a_form = $this->getConsumerForm('edit');
334 $a_form->getItemByPostVar("title")->setValue($consumer->getTitle());
335 $a_form->getItemByPostVar("description")->setValue($consumer->getDescription());
336 $a_form->getItemByPostVar("prefix")->setValue($consumer->getPrefix());
337 $a_form->getItemByPostVar("language")->setValue($consumer->getLanguage());
338 $a_form->getItemByPostVar("active")->setChecked($consumer->getActive());
339 $a_form->getItemByPostVar("role")->setValue($consumer->getRole());
340 $a_form->getItemByPostVar("types")->setValue($this->object->getActiveObjectTypes($consumer_id));
341 }
342 $tpl->setContent($a_form->getHTML());
343 }
This class represents a property form user interface.
getItemByPostVar($a_post_var)
Get Item by POST variable.

References $ilCtrl, ilObjectGUI\$tpl, ilLTIToolConsumer\fromExternalConsumerId(), and getConsumerForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLTIAdministrationGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

39 {
40 $next_class = $this->ctrl->getNextClass($this);
41 $cmd = $this->ctrl->getCmd();
42
43 $this->prepareOutput();
44
45 switch ($next_class) {
46 case 'ilpermissiongui':
47 $GLOBALS['ilTabs']->activateTab('perm_settings');
48 require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
49 $perm_gui = new ilPermissionGUI($this);
50 $this->ctrl->forwardCommand($perm_gui);
51 break;
52
53 case 'illticonsumeradministrationgui':
54 $this->tabs_gui->activateTab('lti_consuming');
56 $this->ctrl->forwardCommand($gui);
57 break;
58
59 default:
60 $this->tabs_gui->activateTab('lti_providing');
61 if (!$cmd || $cmd == 'view') {
62 $cmd = 'listConsumers';
63 } elseif ($cmd == 'createconsumer') {
64 $cmd = "initConsumerForm";
65 }
66 $this->$cmd();
67 break;
68 }
69 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References $GLOBALS, 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 76 of file class.ilObjLTIAdministrationGUI.php.

77 {
78 global $DIC; /* @var \ILIAS\DI\Container $DIC */
79 global $rbacsystem;
80
81 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
82 $this->tabs_gui->addTab(
83 'lti_providing',
84 $this->lng->txt("lti_providing_tab"),
85 $this->ctrl->getLinkTarget($this, "listConsumers")
86 );
87
88 $this->tabs_gui->addTab(
89 'lti_consuming',
90 $this->lng->txt("lti_consuming_tab"),
91 $this->ctrl->getLinkTargetByClass('ilLTIConsumerAdministrationGUI')
92 );
93
94 if ($DIC->ctrl()->getCmdClass() == 'ilobjltiadministrationgui') {
95 $this->addProvidingSubtabs();
96 }
97 }
98
99 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
100 $this->tabs_gui->addTab(
101 "perm_settings",
102 $this->lng->txt("perm_settings"),
103 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
104 );
105 }
106 }

References $DIC, ilObjectGUI\$rbacsystem, and addProvidingSubtabs().

+ Here is the call graph for this function:

◆ getConsumerForm()

ilObjLTIAdministrationGUI::getConsumerForm (   $a_mode = '')
protected
Parameters
string$a_mode
Returns
ilPropertyFormGUI

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

246 {
247 $this->tabs_gui->activateSubTab("consumers");
248
249 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
250
251 $form = new ilPropertyFormGUI();
252
253 $ti_title = new ilTextInputGUI($this->lng->txt("title"), 'title');
254 $ti_title->setRequired(true);
255 $ti_description = new ilTextInputGUI($this->lng->txt("description"), 'description');
256 $ti_prefix = new ilTextInputGUI($this->lng->txt("prefix"), 'prefix');
257 $ti_prefix->setRequired(true);
258 #$ti_key = new ilTextInputGUI($this->lng->txt("lti_consumer_key"), 'key');
259 #$ti_key->setRequired(true);
260 #$ti_secret = new ilTextInputGUI($this->lng->txt("lti_consumer_secret"), 'secret');
261 #$ti_secret->setRequired(true);
262
263 $languages = $this->lng->getInstalledLanguages();
264 $array_lang = array();
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
272 $cb_active = new ilCheckboxInputGUI($this->lng->txt('active'), 'active');
273
274 $form->addItem($cb_active);
275 $form->addItem($ti_title);
276 $form->addItem($ti_description);
277 $form->addItem($ti_prefix);
278 #$form->addItem($ti_key);
279 #$form->addItem($ti_secret);
280 $form->addItem($si_language);
281
282 // object types
283 $cb_obj_types = new ilCheckboxGroupInputGUI($this->lng->txt("act_lti_for_obj_type"), 'types');
284
285 $valid_obj_types = $this->object->getLTIObjectTypes();
286 foreach ($valid_obj_types as $obj_type) {
287 $object_name = $GLOBALS['DIC']->language()->txt('objs_' . $obj_type);
288 $cb_obj_types->addOption(new ilCheckboxOption($object_name, $obj_type));
289 }
290 $form->addItem($cb_obj_types);
291
292 // test roles
293 $roles = $this->object->getLTIRoles();
294 foreach ($roles as $role_id => $role_name) {
295 $options[$role_id] = $role_name;
296 }
297 $si_roles = new ilSelectInputGUI($this->lng->txt("gbl_roles_to_users"), 'role');
298 $si_roles->setOptions($options);
299 $form->addItem($si_roles);
300
301 if ($a_mode == 'edit') {
302 $form->setFormAction($this->ctrl->getFormAction($this, 'editLTIConsumer'));
303 $form->setTitle($this->lng->txt("lti_edit_consumer"));
304 $form->addCommandButton("updateLTIConsumer", $this->lng->txt("save"));
305 } else {
306 $form->setFormAction($this->ctrl->getFormAction($this, 'createLTIConsumer'));
307 $form->setTitle($this->lng->txt("lti_create_consumer"));
308 $form->addCommandButton("createLTIConsumer", $this->lng->txt("save"));
309 $form->addCommandButton('listConsumers', $this->lng->txt('cancel'));
310 }
311
312 return $form;
313 }
This class represents a property in a property form.
This class represents a checkbox property in a property form.
This class represents an option in a checkbox group.
static _lookupEntry($a_lang_key, $a_mod, $a_id)
This class represents a selection list property in a property form.
This class represents a text property in a property form.

References $GLOBALS, and ilLanguage\_lookupEntry().

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 144 of file class.ilObjLTIAdministrationGUI.php.

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

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ getType()

ilObjLTIAdministrationGUI::getType ( )

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

72 {
73 return "ltis";
74 }

◆ initConsumerForm()

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

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

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

References getConsumerForm().

+ Here is the call graph for this function:

◆ initSettingsForm()

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

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

135 {
136 if (!($form instanceof ilPropertyFormGUI)) {
137 $form = $this->getSettingsForm();
138 }
139 $this->tabs_gui->activateSubTab("settings");
140 $this->tpl->setContent($form->getHTML());
141 }

References getSettingsForm().

+ Here is the call graph for this function:

◆ listConsumers()

ilObjLTIAdministrationGUI::listConsumers ( )
protected

List consumers @global type $ilAccess @global type $ilToolbar.

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

439 {
440 global $ilAccess, $ilToolbar;
441
442 if ($this->checkPermissionBool('write')) {
443 $ilToolbar->addButton(
444 $this->lng->txt('lti_create_consumer'),
445 $this->ctrl->getLinkTarget($this, 'createconsumer')
446 );
447 if (ilObject::_getIdsForTitle("il_lti_global_role", "role", false) == false) {
448 $ilToolbar->addButton(
449 $this->lng->txt('lti_create_lti_user_role'),
450 $this->ctrl->getLinkTarget($this, 'createLtiUserRole')
451 );
452 $ilToolbar->addText($this->lng->txt('lti_user_role_info'));
453 }
454
455 }
456
457 $this->tabs_gui->activateSubTab("consumers");
458
459 include_once "Services/LTI/classes/Consumer/class.ilLTIConsumerTableGUI.php";
460 $tbl = new ilObjectConsumerTableGUI(
461 $this,
462 "listConsumers"
463 );
464 $tbl->setEditable($this->checkPermissionBool('write'));
465 $this->tpl->setContent($tbl->getHTML());
466 }
TableGUI class for LTI consumer listing.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
static _getIdsForTitle($title, $type='', $partialmatch=false)

References ilObject\_getIdsForTitle(), and ilObjectGUI\checkPermissionBool().

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 499 of file class.ilObjLTIAdministrationGUI.php.

500 {
501 $GLOBALS['DIC']->tabs()->activateSubTab('releasedObjects');
502
503 $table = new ilLTIProviderReleasedObjectsTableGUI($this, 'releasedObjects', 'ltireleases');
504 $table->init();
505 $table->parse();
506
507 $GLOBALS['DIC']->ui()->mainTemplate()->setContent($table->getHTML());
508 }

References $GLOBALS.

◆ updateLTIConsumer()

ilObjLTIAdministrationGUI::updateLTIConsumer ( )
protected

Update lti consumer settings @global ilCtrl $ilCtrl.

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

384 {
385 global $ilCtrl;
386
387 $this->checkPermission("write");
388
389 $consumer_id = $_REQUEST["cid"];
390 if (!$consumer_id) {
391 $ilCtrl->redirect($this, "listConsumers");
392 }
393
394 $ilCtrl->setParameter($this, "cid", $consumer_id);
395
396 $consumer = ilLTIToolConsumer::fromExternalConsumerId($consumer_id, $this->dataConnector);
397 $form = $this->getConsumerForm('edit');
398 if ($form->checkInput()) {
399 $consumer->setTitle($form->getInput('title'));
400 $consumer->setDescription($form->getInput('description'));
401 $consumer->setPrefix($form->getInput('prefix'));
402 $consumer->setLanguage($form->getInput('language'));
403 $consumer->setActive($form->getInput('active'));
404 $consumer->setRole($form->getInput('role'));
405 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
406 $this->object->saveConsumerObjectTypes($consumer_id, $form->getInput('types'));
407
408 ilUtil::sendSuccess($this->lng->txt("lti_consumer_updated"), true);
409 }
410 $this->listConsumers();
411 }

References $ilCtrl, ilObjectGUI\checkPermission(), ilLTIToolConsumer\fromExternalConsumerId(), getConsumerForm(), and listConsumers().

+ Here is the call graph for this function:

Field Documentation

◆ $dataConnector

mixed ilObjLTIAdministrationGUI::$dataConnector = null
private

Data connector object or string.

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


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