ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
- 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 ($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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

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

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

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

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

References $GLOBALS, and ilLTIToolConsumer\fromExternalConsumerId().

+ Here is the call graph for this function:

◆ createLTIConsumer()

ilObjLTIAdministrationGUI::createLTIConsumer ( )
protected

Create new lti consumer.

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

352 {
353 $this->checkPermission("write");
354
355 $form = $this->getConsumerForm();
356
357 if ($form->checkInput()) {
358 // $consumer = new ilLTIExternalConsumer();
359 // $dataConnector = new ilLTIDataConnector();
360 $consumer = new ilLTIToolConsumer(null, $this->dataConnector);
361 $consumer->setTitle($form->getInput('title'));
362 $consumer->setDescription($form->getInput('description'));
363 $consumer->setPrefix($form->getInput('prefix'));
364 $consumer->setLanguage($form->getInput('language'));
365 $consumer->setActive($form->getInput('active'));
366 $consumer->setRole($form->getInput('role'));
367 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
368
369 $this->object->saveConsumerObjectTypes(
370 $consumer->getExtConsumerId(),
371 $form->getInput('types')
372 );
373 ilUtil::sendSuccess($this->lng->txt("lti_consumer_created"), true);
374 $GLOBALS['DIC']->ctrl()->redirect($this, 'listConsumers');
375 }
376
377 $form->setValuesByPost();
378 $this->listConsumers();
379 return;
380 }
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 208 of file class.ilObjLTIAdministrationGUI.php.

209 {
210 global $DIC;
211 $rbacadmin = $DIC['rbacadmin'];
212 // include_once './Services/AccessControl/classes/class.ilObjRole.php';
213 $role = new ilObjRole();
214 $role->setTitle("il_lti_global_role");
215 $role->setDescription("This global role should only contain the permission 'read' for repository and categories.");
216 $role->create();
217 $rbacadmin->assignRoleToFolder($role->getId(), 8, 'y');
218 $rbacadmin->setProtected(8, $role->getId(), 'y');
219 $rbacadmin->setRolePermission($role->getId(), 'root', [3], 8);
220 $rbacadmin->setRolePermission($role->getId(), 'cat', [3], 8);
221 $rbacadmin->grantPermission($role->getId(), [3], ROOT_FOLDER_ID);
222 $role->changeExistingObjects(
225 array('cat'),
226 array()
227 );
228
229 ilUtil::sendSuccess($this->lng->txt("lti_user_role_created"), true);
230 $this->listConsumers();
231 }
Class ilObjRole.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
const ROOT_FOLDER_ID
Definition: constants.php:30

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

+ Here is the call graph for this function:

◆ deleteLTIConsumer()

ilObjLTIAdministrationGUI::deleteLTIConsumer ( )
protected

Delete consumers @global type $ilCtrl.

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

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

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

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

References 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 $DIC->help()->setScreenIdComponent("ltis");
82
83 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
84 $this->tabs_gui->addTab(
85 'lti_providing',
86 $this->lng->txt("lti_providing_tab"),
87 $this->ctrl->getLinkTarget($this, "listConsumers")
88 );
89
90 $this->tabs_gui->addTab(
91 'lti_consuming',
92 $this->lng->txt("lti_consuming_tab"),
93 $this->ctrl->getLinkTargetByClass('ilLTIConsumerAdministrationGUI')
94 );
95
96 if ($DIC->ctrl()->getCmdClass() == 'ilobjltiadministrationgui') {
97 $this->addProvidingSubtabs();
98 }
99 }
100
101 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
102 $this->tabs_gui->addTab(
103 "perm_settings",
104 $this->lng->txt("perm_settings"),
105 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
106 );
107 }
108 }

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

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

147 {
148 require_once("Services/Form/classes/class.ilPropertyFormGUI.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 71 of file class.ilObjLTIAdministrationGUI.php.

72 {
73 return "ltis";
74 }

◆ initConsumerForm()

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

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

237 {
238 if (!($form instanceof ilPropertyFormGUI)) {
239 $form = $this->getConsumerForm();
240 }
241 $this->tpl->setContent($form->getHTML());
242 }

References getConsumerForm().

+ Here is the call graph for this function:

◆ initSettingsForm()

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

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

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

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

442 {
443 global $ilAccess, $ilToolbar;
444
445 if ($this->checkPermissionBool('write')) {
446 $ilToolbar->addButton(
447 $this->lng->txt('lti_create_consumer'),
448 $this->ctrl->getLinkTarget($this, 'createconsumer')
449 );
450 if (ilObject::_getIdsForTitle("il_lti_global_role", "role", false) == false) {
451 $ilToolbar->addButton(
452 $this->lng->txt('lti_create_lti_user_role'),
453 $this->ctrl->getLinkTarget($this, 'createLtiUserRole')
454 );
455 $ilToolbar->addText($this->lng->txt('lti_user_role_info'));
456 }
457 }
458
459 $this->tabs_gui->activateSubTab("consumers");
460
461 include_once "Services/LTI/classes/Consumer/class.ilLTIConsumerTableGUI.php";
462 $tbl = new ilObjectConsumerTableGUI(
463 $this,
464 "listConsumers"
465 );
466 $tbl->setEditable($this->checkPermissionBool('write'));
467 $this->tpl->setContent($tbl->getHTML());
468 }
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 501 of file class.ilObjLTIAdministrationGUI.php.

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

References $GLOBALS.

◆ updateLTIConsumer()

ilObjLTIAdministrationGUI::updateLTIConsumer ( )
protected

Update lti consumer settings @global ilCtrl $ilCtrl.

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

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

References 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: