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

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 getType ()
 Functions that must be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initCustomCreateForm ($a_new_type)
 
 saveCustom ()
 
 afterSave (ilObject $newObject)
 Post (successful) object creation hook. More...
 
 initMetadata (ilObjLTIConsumer $object)
 
 executeCommand ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. 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...
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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...
 

Static Public Member Functions

static _goto ($a_target)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- 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

const CFORM_CUSTOM_NEW = 99
 
const TAB_ID_INFO = 'tab_info'
 
const TAB_ID_CONTENT = 'tab_content'
 
const TAB_ID_SETTINGS = 'tab_settings'
 
const TAB_ID_STATEMENTS = 'tab_statements'
 
const TAB_ID_SCORING = 'tab_scoring'
 
const TAB_ID_METADATA = 'tab_metadata'
 
const TAB_ID_LEARNING_PROGRESS = 'learning_progress'
 
const TAB_ID_PERMISSIONS = 'perm_settings'
 
const DEFAULT_CMD = 'infoScreen'
 
 $object
 
- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- 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 Member Functions

 buildProviderSelectionForm ($a_new_type)
 
 applyProviderFilter ()
 
 resetProviderFilter ()
 
 createNewObject ($newType, $title, $description)
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 debug ()
 
 trackObjectReadEvent ()
 
 infoScreen ()
 
 infoScreenForward ()
 
 initInfoScreenToolbar ()
 
 handleAvailablityMessage ()
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 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...
 
 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...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 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...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- 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...
 

Protected Attributes

 $ltiAccess
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- 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

Definition at line 25 of file class.ilObjLTIConsumerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjLTIConsumerGUI::__construct (   $a_id = 0,
  $a_id_type = self::REPOSITORY_NODE_ID,
  $a_parent_node_id = 0 
)

Constructor.

Parameters
int$a_id
int$a_id_type
int$a_parent_node_id

Reimplemented from ilObject2GUI.

Definition at line 50 of file class.ilObjLTIConsumerGUI.php.

51 {
52 global $DIC; /* @var \ILIAS\DI\Container $DIC */
53
54 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
55
56 if ($this->object instanceof ilObjLTIConsumer) {
57 $this->ltiAccess = new ilLTIConsumerAccess($this->object);
58 }
59
60 $DIC->language()->loadLanguageModule("lti");
61 $DIC->language()->loadLanguageModule("rep");
62 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjLTIConsumerGUI::_goto (   $a_target)
static

Definition at line 353 of file class.ilObjLTIConsumerGUI.php.

354 {
355 global $DIC; /* @var \ILIAS\DI\Container $DIC */
356 $err = $DIC['ilErr']; /* @var ilErrorHandling $err */
357 $ctrl = $DIC->ctrl();
358 $request = $DIC->http()->request();
359 $access = $DIC->access();
360 $lng = $DIC->language();
361
362 $targetParameters = explode('_', $a_target);
363 $id = (int) $targetParameters[0];
364
365 if ($id <= 0) {
366 $err->raiseError($lng->txt('msg_no_perm_read'), $err->FATAL);
367 }
368
369 if ($access->checkAccess('read', '', $id)) {
370 $ctrl->setTargetScript('ilias.php');
371 $ctrl->initBaseClass(ilRepositoryGUI::class);
372 $ctrl->setParameterByClass(ilObjLTIConsumerGUI::class, 'ref_id', $id);
373 if (isset($request->getQueryParams()['gotolp'])) {
374 $ctrl->setParameterByClass(ilObjLTIConsumerGUI::class, 'gotolp', 1);
375 }
376 $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjLTIConsumerGUI::class]);
377 } elseif ($access->checkAccess('visible', '', $id)) {
378 ilObjectGUI::_gotoRepositoryNode($id, 'infoScreen');
379 } elseif ($access->checkAccess('read', '', ROOT_FOLDER_ID)) {
381 sprintf(
382 $DIC->language()->txt('msg_no_perm_read_item'),
384 ),
385 true
386 );
387
389 }
390
391 $err->raiseError($DIC->language()->txt("msg_no_perm_read_lm"), $err->FATAL);
392 }
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilObjectGUI\$access, ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjLTIConsumerGUI::addLocatorItems ( )

Functions to be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 637 of file class.ilObjLTIConsumerGUI.php.

638 {
639 global $DIC; /* @var \ILIAS\DI\Container $DIC */
640
641 $locator = $DIC['ilLocator']; /* @var ilLocatorGUI $locator */
642 $locator->addItem(
643 $this->object->getTitle(),
644 $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD),
645 "",
646 $_GET["ref_id"]
647 );
648 }
$_GET["client_id"]

References $_GET, $DIC, and ilObjectGUI\$locator.

◆ afterSave()

ilObjLTIConsumerGUI::afterSave ( ilObject  $a_new_object)

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

Definition at line 246 of file class.ilObjLTIConsumerGUI.php.

247 {
248 /* @var ilObjLTIConsumer $newObject */
249 global $DIC; /* @var \ILIAS\DI\Container $DIC */
250
251 if (isset($_GET['provider_id']) && (int) $_GET['provider_id']) {
252 $newObject->setProviderId((int) $_GET['provider_id']);
253 $newObject->initProvider();
254 $newObject->save();
255
256 $newObject->setTitle($newObject->getProvider()->getTitle());
257 $newObject->setMasteryScore($newObject->getProvider()->getMasteryScore());
258 $newObject->update();
259
260 $this->initMetadata($newObject);
261
262 $DIC->ctrl()->redirectByClass(ilLTIConsumerSettingsGUI::class);
263 }
264
266 throw new ilLtiConsumerException('permission denied!');
267 }
268
269 $form = $this->initCustomCreateForm($newObject->getType());
270
271 if ($form->checkInput()) {
272 $provider = new ilLTIConsumeProvider();
273 $form->initProvider($provider);
274 $provider->setAvailability(ilLTIConsumeProvider::AVAILABILITY_CREATE);
275 $provider->setIsGlobal(false);
276 $provider->setCreator($DIC->user()->getId());
277 $provider->save();
278
279 $newObject->setProviderId($provider->getId());
280 $newObject->setProvider($provider);
281 $newObject->save();
282
283 $newObject->setTitle($provider->getTitle());
284 $newObject->setMasteryScore($newObject->getProvider()->getMasteryScore());
285 $newObject->update();
286
287 $this->initMetadata($newObject);
288
289 $DIC->ctrl()->redirectByClass(ilObjLTIConsumerGUI::class);
290 }
291
292 throw new ilLtiConsumerException(
293 'form validation seems to not have worked in ilObjLTIConsumer::saveCustom()!'
294 );
295 }
initMetadata(ilObjLTIConsumer $object)

References $_GET, $DIC, ilLTIConsumeProvider\AVAILABILITY_CREATE, ilObject\getTitle(), ilObject\getType(), ilLTIConsumerAccess\hasCustomProviderCreationAccess(), initCustomCreateForm(), initMetadata(), ilObject\setTitle(), and ilObject\update().

Referenced by saveCustom().

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

◆ applyProviderFilter()

ilObjLTIConsumerGUI::applyProviderFilter ( )
protected

Definition at line 173 of file class.ilObjLTIConsumerGUI.php.

174 {
175 $form = $this->buildProviderSelectionForm('');
176 $form->applyFilter();
177 $this->createObject();
178 }
createObject()
create new object form

References buildProviderSelectionForm(), and ilObjectGUI\createObject().

+ Here is the call graph for this function:

◆ buildProviderSelectionForm()

ilObjLTIConsumerGUI::buildProviderSelectionForm (   $a_new_type)
protected

Definition at line 162 of file class.ilObjLTIConsumerGUI.php.

163 {
165 $a_new_type,
166 $this,
167 'create',
168 'applyProviderFilter',
169 'resetProviderFilter'
170 );
171 }

Referenced by applyProviderFilter(), initCreateForm(), and resetProviderFilter().

+ Here is the caller graph for this function:

◆ createNewObject()

ilObjLTIConsumerGUI::createNewObject (   $newType,
  $title,
  $description 
)
protected

Definition at line 187 of file class.ilObjLTIConsumerGUI.php.

188 {
189 $classname = "ilObj" . $this->objDefinition->getClassName($newType);
190
191 $newObj = new $classname();
192 $newObj->setType($newType);
193 $newObj->setTitle($title);
194 $newObj->setDescription($description);
195 $newObj->create();
196
197 $this->putObjectInTree($newObj);
198
199 return $newObj;
200 }
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.

References ilObject2GUI\putObjectInTree().

Referenced by saveCustom().

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

◆ debug()

ilObjLTIConsumerGUI::debug ( )
protected

Definition at line 591 of file class.ilObjLTIConsumerGUI.php.

592 {
593 global $DIC; /* @var \ILIAS\DI\Container $DIC */
594
595 $DIC->tabs()->activateTab('debug');
596
597 $filter = new ilCmiXapiStatementsReportFilter();
598 $filter->setActivityId($this->object->getActivityId());
599
600 $aggregateEndPointUrl = str_replace(
601 'data/xAPI',
602 'api/statements/aggregate',
603 $this->object->getProvider()->getXapiLaunchUrl() // should be named endpoint not launch url
604 );
605
606 $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
607 $this->object,
608 $aggregateEndPointUrl,
609 $filter
610 );
611
613 $this->object->getProvider()->getXapiLaunchKey(),
614 $this->object->getProvider()->getXapiLaunchSecret()
615 );
616
617 $request = new ilCmiXapiHighscoreReportRequest(
618 $basicAuth,
619 $linkBuilder
620 );
621
622 try {
623 $report = $request->queryReport($this->object);
624
625 $DIC->ui()->mainTemplate()->setContent(
626 $report->getResponseDebug()
627 );
628
629 //ilUtil::sendSuccess('Object ID: '.$this->object->getId());
630 ilUtil::sendInfo($linkBuilder->getPipelineDebug());
631 ilUtil::sendQuestion('<pre>' . print_r($report->getTableData(), 1) . '</pre>');
632 } catch (Exception $e) {
633 ilUtil::sendFailure($e->getMessage());
634 }
635 }
static buildBasicAuth($lrsKey, $lrsSecret)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $DIC, Vendor\Package\$e, ilCmiXapiLrsType\buildBasicAuth(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendQuestion().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLTIConsumerGUI::executeCommand ( )
Exceptions
ilCtrlException

Reimplemented from ilObject2GUI.

Definition at line 397 of file class.ilObjLTIConsumerGUI.php.

398 {
399 global $DIC; /* @var \ILIAS\DI\Container $DIC */
400
401 // TODO: general access checks (!)
402
404 $this->prepareOutput();
405 $this->addHeaderAction();
406 }
407
408 if (!$this->creation_mode) {
409 $this->trackObjectReadEvent();
410
411 if ($this->object->getProvider()->hasProviderIcon()) {
412 $DIC->ui()->mainTemplate()->setTitleIcon(
413 $this->object->getProvider()->getProviderIcon()->getAbsoluteFilePath(),
414 'Icon ' . $this->object->getProvider()->getTitle()
415 );
416 }
417
418 $link = ilLink::_getLink($this->object->getRefId(), $this->object->getType());
419 $navigationHistory = $DIC['ilNavigationHistory']; /* @var ilNavigationHistory $navigationHistory */
420 $navigationHistory->addItem($this->object->getRefId(), $link, $this->object->getType());
421 }
422
423 switch ($DIC->ctrl()->getNextClass()) {
424 case strtolower(ilObjectCopyGUI::class):
425
426 $gui = new ilObjectCopyGUI($this);
427 $gui->setType($this->getType());
428 $DIC->ctrl()->forwardCommand($gui);
429 break;
430
431 case strtolower(ilCommonActionDispatcherGUI::class):
432
433 $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
434 $DIC->ctrl()->forwardCommand($gui);
435 break;
436
437 case strtolower(ilLearningProgressGUI::class):
438
439 $DIC->tabs()->activateTab(self::TAB_ID_LEARNING_PROGRESS);
440
441 $gui = new ilLearningProgressGUI(
443 $this->object->getRefId()
444 );
445
446 $DIC->ctrl()->forwardCommand($gui);
447
448 break;
449
450 case strtolower(ilObjectMetaDataGUI::class):
451
452 $DIC->tabs()->activateTab(self::TAB_ID_METADATA);
453
454 $gui = new ilObjectMetaDataGUI($this->object);
455 $DIC->ctrl()->forwardCommand($gui);
456 break;
457
458 case strtolower(ilPermissionGUI::class):
459
460 $DIC->tabs()->activateTab(self::TAB_ID_PERMISSIONS);
461
462 $gui = new ilPermissionGUI($this);
463 $DIC->ctrl()->forwardCommand($gui);
464 break;
465
466 case strtolower(ilLTIConsumerSettingsGUI::class):
467
468 $DIC->tabs()->activateTab(self::TAB_ID_SETTINGS);
469
470 $gui = new ilLTIConsumerSettingsGUI($this->object, $this->ltiAccess);
471 $DIC->ctrl()->forwardCommand($gui);
472 break;
473
474 case strtolower(ilLTIConsumerXapiStatementsGUI::class):
475
476 $DIC->tabs()->activateTab(self::TAB_ID_STATEMENTS);
477
478 $gui = new ilLTIConsumerXapiStatementsGUI($this->object);
479 $DIC->ctrl()->forwardCommand($gui);
480
481 break;
482
483 case strtolower(ilLTIConsumerScoringGUI::class):
484
485 $DIC->tabs()->activateTab(self::TAB_ID_SCORING);
486
487 $gui = new ilLTIConsumerScoringGUI($this->object);
488 $DIC->ctrl()->forwardCommand($gui);
489
490 break;
491
492 case strtolower(ilLTIConsumerEmbeddedContentGUI::class):
493
494 $DIC->tabs()->activateTab(self::TAB_ID_CONTENT);
495
496 $gui = new ilLTIConsumerEmbeddedContentGUI($this->object);
497 $DIC->ctrl()->forwardCommand($gui);
498
499 break;
500
501 default:
502 $command = $DIC->ctrl()->getCmd(self::DEFAULT_CMD);
503 $this->{$command}();
504 }
505 }
Class ilCommonActionDispatcherGUI.
Class ilObjUserTrackingGUI.
getType()
Functions that must be overwritten.
prepareOutput($a_show_subobjects=true)
prepare output
GUI class for the workflow of copying objects.
setType($type)
Sets $type.
addHeaderAction()
Add header action menu.
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References $DIC, ilLink\_getLink(), ilObjectGUI\addHeaderAction(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getType(), ilLTIConsumerEmbeddedContentGUI\isEmbeddedLaunchRequest(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObject2GUI\prepareOutput(), and trackObjectReadEvent().

+ Here is the call graph for this function:

◆ getType()

ilObjLTIConsumerGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 64 of file class.ilObjLTIConsumerGUI.php.

65 {
66 return 'lti';
67 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ handleAvailablityMessage()

ilObjLTIConsumerGUI::handleAvailablityMessage ( )
protected

Definition at line 829 of file class.ilObjLTIConsumerGUI.php.

830 {
831 global $DIC; /* @var \ILIAS\DI\Container $DIC */
832 if ($this->object->getProvider()->getProviderUrl() == '') {
833 ilUtil::sendFailure($DIC->language()->txt('lti_provider_not_set_msg'));
834 } elseif ($this->object->getProvider()->getAvailability() == ilLTIConsumeProvider::AVAILABILITY_NONE) {
835 ilUtil::sendFailure($DIC->language()->txt('lti_provider_not_avail_msg'));
836 }
837 }

References $DIC, ilLTIConsumeProvider\AVAILABILITY_NONE, and ilUtil\sendFailure().

Referenced by infoScreenForward().

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

◆ infoScreen()

ilObjLTIConsumerGUI::infoScreen ( )
protected

Definition at line 664 of file class.ilObjLTIConsumerGUI.php.

665 {
666 global $DIC; /* @var \ILIAS\DI\Container $DIC */
667
668 $DIC->tabs()->activateTab(self::TAB_ID_INFO);
669
670 $DIC->ctrl()->setCmd("showSummary");
671 $DIC->ctrl()->setCmdClass("ilinfoscreengui");
672 $this->infoScreenForward();
673 }

References $DIC, and infoScreenForward().

+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjLTIConsumerGUI::infoScreenForward ( )
protected

Definition at line 675 of file class.ilObjLTIConsumerGUI.php.

676 {
677 global $DIC; /* @var \ILIAS\DI\Container $DIC */
678 $ilErr = $DIC['ilErr']; /* @var ilErrorHandling $ilErr */
679
680 if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
681 $ilErr->raiseError($DIC->language()->txt("msg_no_perm_read"));
682 }
683
685 $this->initInfoScreenToolbar();
686
687 $info = new ilInfoScreenGUI($this);
688
689 $info->enablePrivateNotes();
690
691 if ($this->checkPermissionBool("read")) {
692 $info->enableNews();
693 }
694
695 $info->enableNewsEditing(false);
696
697 if ($this->checkPermissionBool("write")) {
698 $news_set = new ilSetting("news");
699 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
700
701 if ($enable_internal_rss) {
702 $info->setBlockProperty("news", "settings", true);
703 $info->setBlockProperty("news", "public_notifications_option", true);
704 }
705 }
706
707 // standard meta data
708 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
709
710 if (DEVMODE) {
711 // Development Info
712 $info->addSection('DEVMODE Info');
713 $info->addProperty('Local Object ID', $this->object->getId());
714 $info->addProperty('Current User ID', $DIC->user()->getId());
715 }
716
717 require_once('Services/Tracking/classes/class.ilLPObjSettings.php');
718 if ($this->object->getProvider()->getHasOutcome() && ilLPObjSettings::_lookupDBMode($this->object->getId()) != 0) {
719 $info->addSection($DIC->language()->txt("lti_info_learning_progress_section"));
720 $info->addProperty(
721 $DIC->language()->txt("mastery_score"),
722 ($this->object->getMasteryScorePercent()) . ' %'
723 );
724 }
725
726 // LTI Ressource Info about privacy
727 $info->addSection($DIC->language()->txt("lti_info_privacy_section"));
728
729 $info->addProperty(
730 $DIC->language()->txt("lti_con_prov_url"),
731 $this->object->getProvider()->getProviderUrl()
732 );
733
734 $info->addProperty(
735 $DIC->language()->txt("conf_privacy_name"),
736 $DIC->language()->txt('conf_privacy_name_' . ilObjCmiXapiGUI::getPrivacyNameString($this->object->getProvider()->getPrivacyName()))
737 );
738
739 $info->addProperty(
740 $DIC->language()->txt("conf_privacy_ident"),
741 $DIC->language()->txt('conf_privacy_ident_' . ilObjCmiXapiGUI::getPrivacyIdentString($this->object->getProvider()->getPrivacyIdent()))
742 );
743 if ($this->object->getProvider()->isExternalProvider()) {
744 $info->addProperty(
745 $DIC->language()->txt("lti_info_external_provider_label"),
746 $DIC->language()->txt('lti_info_external_provider_info')
747 );
748 }
749
750 if ($this->object->getProvider()->getUseXapi()) {
751 $info->addProperty(
752 $DIC->language()->txt("lti_con_prov_xapi_launch_url"),
753 $this->object->getProvider()->getXapiLaunchUrl()
754 );
755 }
756
757 // FINISHED INFO SCREEN, NOW FORWARD
758 $this->ctrl->forwardCommand($info);
759 }
Class ilInfoScreenGUI.
static _lookupDBMode($a_obj_id)
static getPrivacyNameString(int $ident)
static getPrivacyIdentString(int $ident)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
ILIAS Setting Class.

References $DIC, ilObjectGUI\$ilErr, ilLPObjSettings\_lookupDBMode(), ilObject2GUI\checkPermissionBool(), ilObjCmiXapiGUI\getPrivacyIdentString(), ilObjCmiXapiGUI\getPrivacyNameString(), handleAvailablityMessage(), and initInfoScreenToolbar().

Referenced by infoScreen().

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

◆ initCreateForm()

ilObjLTIConsumerGUI::initCreateForm (   $a_new_type)

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

Definition at line 87 of file class.ilObjLTIConsumerGUI.php.

88 {
89 global $DIC; /* @var \ILIAS\DI\Container $DIC */
90
91 $form = $this->buildProviderSelectionForm($a_new_type);
92
93 $globalProviderList = new ilLTIConsumeProviderList();
94 $globalProviderList->setAvailabilityFilter(ilLTIConsumeProvider::AVAILABILITY_CREATE);
95 $globalProviderList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_GLOBAL);
96
97 $userProviderList = new ilLTIConsumeProviderList();
98 $userProviderList->setAvailabilityFilter(ilLTIConsumeProvider::AVAILABILITY_CREATE);
99 $userProviderList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_USER);
100 $userProviderList->setCreatorFilter($DIC->user()->getId());
101
102 if ($form->getFilter('title')) {
103 $globalProviderList->setTitleFilter($form->getFilter('title'));
104 $userProviderList->setTitleFilter($form->getFilter('title'));
105 }
106
107 if ($form->getFilter('category')) {
108 $globalProviderList->setCategoryFilter($form->getFilter('category'));
109 $userProviderList->setCategoryFilter($form->getFilter('category'));
110 }
111
112 if ($form->getFilter('keyword')) {
113 $globalProviderList->setKeywordFilter($form->getFilter('keyword'));
114 $userProviderList->setKeywordFilter($form->getFilter('keyword'));
115 }
116
117 if ($form->getFilter('outcome')) {
118 $globalProviderList->setHasOutcomeFilter(true);
119 $userProviderList->setHasOutcomeFilter(true);
120 }
121
122 if ($form->getFilter('internal')) {
123 $globalProviderList->setIsExternalFilter(false);
124 $userProviderList->setIsExternalFilter(false);
125 }
126
127 if ($form->getFilter('with_key')) {
128 $globalProviderList->setIsProviderKeyCustomizableFilter(false);
129 $userProviderList->setIsProviderKeyCustomizableFilter(false);
130 }
131
132 $globalProviderList->load();
133 $userProviderList->load();
134
135 $form->setData(array_merge(
136 $globalProviderList->getTableData(),
137 $userProviderList->getTableData()
138 ));
139
140 return $form;
141 }

References $DIC, ilLTIConsumeProvider\AVAILABILITY_CREATE, buildProviderSelectionForm(), ilLTIConsumeProviderList\SCOPE_GLOBAL, and ilLTIConsumeProviderList\SCOPE_USER.

Referenced by initCreationForms().

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

◆ initCreationForms()

ilObjLTIConsumerGUI::initCreationForms (   $a_new_type)

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

Definition at line 69 of file class.ilObjLTIConsumerGUI.php.

70 {
71 global $DIC; /* @var \ILIAS\DI\Container $DIC */
72
73 $forms = array(
74 self::CFORM_NEW => $this->initCreateForm($a_new_type)
75 );
76
78 $forms[self::CFORM_CUSTOM_NEW] = $this->initCustomCreateForm($a_new_type);
79 }
80
81 //$forms[self::CFORM_IMPORT] = $this->initImportForm($a_new_type), // no import yet
82 $forms[self::CFORM_CLONE] = $this->fillCloneTemplate(null, $a_new_type);
83
84 return $forms;
85 }
initCreateForm($a_new_type)
Init object creation form.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...

References $DIC, ilObjectGUI\CFORM_CLONE, CFORM_CUSTOM_NEW, ilObject2GUI\fillCloneTemplate(), ilLTIConsumerAccess\hasCustomProviderCreationAccess(), initCreateForm(), and initCustomCreateForm().

+ Here is the call graph for this function:

◆ initCustomCreateForm()

ilObjLTIConsumerGUI::initCustomCreateForm (   $a_new_type)

Definition at line 143 of file class.ilObjLTIConsumerGUI.php.

144 {
145 global $DIC; /* @var \ILIAS\DI\Container $DIC */
146
147 $provider = new ilLTIConsumeProvider();
148
149 $form = new ilLTIConsumeProviderFormGUI($provider);
150
151 $form->initForm($this->ctrl->getFormAction($this, "save"), '', '');
152
153 $form->clearCommandButtons();
154 $form->addCommandButton("saveCustom", $this->lng->txt($a_new_type . "_add_own_provider"));
155 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
156
157 $form->setTitle($DIC->language()->txt($a_new_type . '_custom_new'));
158
159 return $form;
160 }

References $DIC.

Referenced by afterSave(), initCreationForms(), and saveCustom().

+ Here is the caller graph for this function:

◆ initHeaderAction()

ilObjLTIConsumerGUI::initHeaderAction (   $a_sub_type = null,
  $a_sub_id = null 
)
protected

Add header action menu.

Parameters
string$a_sub_type
int$a_sub_id
Returns
ilObjectListGUI

Reimplemented from ilObject2GUI.

Definition at line 319 of file class.ilObjLTIConsumerGUI.php.

320 {
321 global $DIC; /* @var \ILIAS\DI\Container $DIC */
322
323 $return = parent::initHeaderAction($a_sub_type, $a_sub_id);
324
325 if ($this->creation_mode) {
326 return $return;
327 }
328
329 $validator = new ilCertificateDownloadValidator();
330 if ($validator->isCertificateDownloadable((int) $DIC->user()->getId(), (int) $this->object->getId())) {
331 $certLink = $DIC->ctrl()->getLinkTargetByClass(
332 [ilObjLTIConsumerGUI::class, ilLTIConsumerSettingsGUI::class],
334 );
335
336 $DIC->language()->loadLanguageModule('certificate');
337
338 $return->addCustomCommand($certLink, 'download_certificate');
339
340 $return->addHeaderIcon(
341 'cert_icon',
342 ilUtil::getImagePath('icon_cert.svg'),
343 $DIC->language()->txt('download_certificate'),
344 null,
345 null,
346 $certLink
347 );
348 }
349
350 return $return;
351 }
Validates if an active certificate is stored in the database and can be downloaded by the user.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $DIC, ilLTIConsumerSettingsGUI\CMD_DELIVER_CERTIFICATE, and ilUtil\getImagePath().

+ Here is the call graph for this function:

◆ initInfoScreenToolbar()

ilObjLTIConsumerGUI::initInfoScreenToolbar ( )
protected

Definition at line 761 of file class.ilObjLTIConsumerGUI.php.

762 {
763 global $DIC; /* @var \ILIAS\DI\Container $DIC */
764
765 if ($this->object->getOfflineStatus() ||
766 $this->object->isLaunchMethodEmbedded() ||
767 $this->object->getProvider()->getAvailability() == ilLTIConsumeProvider::AVAILABILITY_NONE) {
768 return;
769 }
770
771 $cmixUser = new ilCmiXapiUser($this->object->getId(), $this->user->getId(), $this->object->getProvider()->getPrivacyIdent());
772 $user_ident = $cmixUser->getUsrIdent();
773 if ($user_ident == '' || $user_ident == null) {
774 $user_ident = ilCmiXapiUser::getIdent($this->object->getProvider()->getPrivacyIdent(), $DIC->user());
775 $cmixUser->setUsrIdent($user_ident);
776 $cmixUser->save();
777 }
778
779 include_once("./Modules/LTIConsumer/classes/class.ilLTIConsumerLaunch.php");
780 $ilLTIConsumerLaunch = new ilLTIConsumerLaunch($this->object->getRefId());
781 $context = $ilLTIConsumerLaunch->getContext();
782 $contextType = $ilLTIConsumerLaunch::getLTIContextType($context["type"]);
783 $contextId = $context["id"];
784 $contextTitle = $context["title"];
785
786 require_once("Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
787 require_once('./Services/Link/classes/class.ilLink.php');
788
790 $DIC->user()->getId(),
791 $this->object->getRefId(),
792 $this->object->getId()
793 );
794
795 $returnUrl = !$this->object->isLaunchMethodOwnWin() ? '' : str_replace(
796 '&amp;',
797 '&',
798 ILIAS_HTTP_PATH . "/" . $DIC->ctrl()->getLinkTarget($this, "", "", false)
799 );
800
801 $launchParameters = $this->object->buildLaunchParameters(
802 $cmixUser,
803 $token,
804 $contextType,
805 $contextId,
806 $contextTitle,
807 $returnUrl
808 );
809
810 $button = '<input class="btn btn-default ilPre" type="button" onClick="ltilaunch()" value = "' . $this->lng->txt("launch") . '" />';
811 $target = $this->object->getLaunchMethod() == "newWin" ? "_blank" : "_self";
812
813 $output = '<form id="lti_launch_form" name="lti_launch_form" action="' . $this->object->getProvider()->getProviderUrl() . '" method="post" target="' . $target . '" encType="application/x-www-form-urlencoded">';
814 foreach ($launchParameters as $field => $value) {
815 $output .= sprintf('<input type="hidden" name="%s" value="%s" />', $field, $value) . "\n";
816 }
817 $output .= $button;
818 $output .= '</form>';
819 $output .= '<span id ="lti_launched" style="display:none">' . $this->lng->txt("launched") . '</span>';
820 $output .= '<script type="text/javascript">
821 function ltilaunch() {
822 document.lti_launch_form.submit();
823 document.getElementById("lti_launch_form").style.display = "none";
824 document.getElementById("lti_launched").style.display = "inline";
825 }</script>';
826 $DIC->toolbar()->addText($output);
827 }
static fillToken($usrId, $refId, $objId, $lrsTypeId=0)
static getIdent($userIdentMode, ilObjUser $user)
$context
Definition: webdav.php:26
$token
Definition: xapitoken.php:57

References $context, $DIC, $token, ilLTIConsumeProvider\AVAILABILITY_NONE, ilCmiXapiAuthToken\fillToken(), ilCmiXapiUser\getIdent(), and ILIAS_HTTP_PATH.

Referenced by infoScreenForward().

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

◆ initMetadata()

ilObjLTIConsumerGUI::initMetadata ( ilObjLTIConsumer  $object)

Definition at line 297 of file class.ilObjLTIConsumerGUI.php.

298 {
299 $metadata = new ilMD($object->getId(), $object->getId(), $object->getType());
300
301 $generalMetadata = $metadata->getGeneral();
302
303 if (!$generalMetadata) {
304 $generalMetadata = $metadata->addGeneral();
305 }
306
307 $generalMetadata->setTitle($object->getTitle());
308 $generalMetadata->save();
309
310 $id = $generalMetadata->addIdentifier();
311 $id->setCatalog('ILIAS');
312 $id->setEntry('il__' . $object->getType() . '_' . $object->getId());
313 $id->save();
314
315 $keywords = $object->getProvider()->getKeywordsArray();
316 ilMDKeyword::updateKeywords($generalMetadata, $keywords);
317 }
static updateKeywords(ilMDGeneral $a_md_section, array $a_keywords)
Update keywords from input array.

References $object, and ilMDKeyword\updateKeywords().

Referenced by afterSave().

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

◆ resetProviderFilter()

ilObjLTIConsumerGUI::resetProviderFilter ( )
protected

Definition at line 180 of file class.ilObjLTIConsumerGUI.php.

181 {
182 $form = $this->buildProviderSelectionForm('');
183 $form->resetFilter();
184 $this->createObject();
185 }

References buildProviderSelectionForm(), and ilObjectGUI\createObject().

+ Here is the call graph for this function:

◆ saveCustom()

ilObjLTIConsumerGUI::saveCustom ( )

Definition at line 202 of file class.ilObjLTIConsumerGUI.php.

203 {
205 throw new ilLtiConsumerException('permission denied!');
206 }
207
208 global $DIC; /* @var \ILIAS\DI\Container $DIC */
209
210 $new_type = $_REQUEST["new_type"];
211 $DIC->ctrl()->setParameter($this, "new_type", $new_type);
212
213 $DIC->language()->loadLanguageModule($new_type);
214
215 $form = $this->initCustomCreateForm($new_type);
216
217 if ($form->checkInput()) {
218 $DIC->ctrl()->setParameter($this, "new_type", "");
219
220 // create object
221 $newObj = $this->createNewObject(
222 $new_type,
223 $form->getInput('title'),
224 $form->getInput('desc')
225 );
226
227 // apply didactic template?
228 $dtpl = $this->getDidacticTemplateVar("dtpl");
229 if ($dtpl) {
230 $newObj->applyDidacticTemplate($dtpl);
231 }
232
233 // auto rating
234 $this->handleAutoRating($newObj);
235
236 $this->afterSave($newObj);
237
238 return;
239 }
240
241 $form->setValuesByPost();
242
243 $DIC->ui()->mainTemplate()->setContent($form->getHtml());
244 }
createNewObject($newType, $title, $description)
afterSave(ilObject $newObject)
Post (successful) object creation hook.
handleAutoRating(ilObject $a_new_obj)
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.

References $DIC, afterSave(), createNewObject(), ilObjectGUI\getDidacticTemplateVar(), ilObject2GUI\handleAutoRating(), ilLTIConsumerAccess\hasCustomProviderCreationAccess(), and initCustomCreateForm().

+ Here is the call graph for this function:

◆ setTabs()

ilObjLTIConsumerGUI::setTabs ( )

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 507 of file class.ilObjLTIConsumerGUI.php.

508 {
509 global $DIC; /* @var \ILIAS\DI\Container $DIC */
510 $DIC->language()->loadLanguageModule('lti');
511
512 $DIC->tabs()->addTab(
513 self::TAB_ID_INFO,
514 $DIC->language()->txt(self::TAB_ID_INFO),
515 $DIC->ctrl()->getLinkTargetByClass(self::class)
516 );
517
518 if (!$this->object->getOfflineStatus() && $this->object->isLaunchMethodEmbedded() &&
519 $this->object->getProvider()->getAvailability() != ilLTIConsumeProvider::AVAILABILITY_NONE
520 ) {
521 $DIC->tabs()->addTab(
522 self::TAB_ID_CONTENT,
523 $DIC->language()->txt(self::TAB_ID_CONTENT),
524 $DIC->ctrl()->getLinkTargetByClass(ilLTIConsumerEmbeddedContentGUI::class)
525 );
526 }
527
528 if ($this->ltiAccess->hasWriteAccess()) {
529 $DIC->tabs()->addTab(
530 self::TAB_ID_SETTINGS,
531 $DIC->language()->txt(self::TAB_ID_SETTINGS),
532 $DIC->ctrl()->getLinkTargetByClass(ilLTIConsumerSettingsGUI::class)
533 );
534 }
535
536 if ($this->ltiAccess->hasStatementsAccess()) {
537 $DIC->tabs()->addTab(
538 self::TAB_ID_STATEMENTS,
539 $DIC->language()->txt(self::TAB_ID_STATEMENTS),
540 $DIC->ctrl()->getLinkTargetByClass(ilLTIConsumerXapiStatementsGUI::class)
541 );
542 }
543
544 if ($this->ltiAccess->hasHighscoreAccess()) {
545 $DIC->language()->loadLanguageModule('lti');
546 $DIC->tabs()->addTab(
547 self::TAB_ID_SCORING,
548 $DIC->language()->txt(self::TAB_ID_SCORING),
549 $DIC->ctrl()->getLinkTargetByClass(ilLTIConsumerScoringGUI::class)
550 );
551 }
552
553 if ($this->ltiAccess->hasLearningProgressAccess() && $this->object->getProvider()->getHasOutcome()) {
554 $DIC->tabs()->addTab(
555 self::TAB_ID_LEARNING_PROGRESS,
556 $DIC->language()->txt(self::TAB_ID_LEARNING_PROGRESS),
557 $DIC->ctrl()->getLinkTargetByClass(ilLearningProgressGUI::class)
558 );
559 }
560
561 if ($this->ltiAccess->hasWriteAccess()) {
562 $gui = new ilObjectMetaDataGUI($this->object);
563 $link = $gui->getTab();
564
565 if (strlen($link)) {
566 $DIC->tabs()->addTab(
567 self::TAB_ID_METADATA,
568 $DIC->language()->txt('meta_data'),
569 $link
570 );
571 }
572 }
573
574 if ($this->ltiAccess->hasEditPermissionsAccess()) {
575 $DIC->tabs()->addTab(
576 self::TAB_ID_PERMISSIONS,
577 $DIC->language()->txt(self::TAB_ID_PERMISSIONS),
578 $DIC->ctrl()->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
579 );
580 }
581
582 if (defined('DEVMODE') && DEVMODE) {
583 $DIC->tabs()->addTab(
584 'debug',
585 'DEBUG',
586 $DIC->ctrl()->getLinkTarget($this, 'debug')
587 );
588 }
589 }

References $DIC, and ilLTIConsumeProvider\AVAILABILITY_NONE.

◆ trackObjectReadEvent()

ilObjLTIConsumerGUI::trackObjectReadEvent ( )
protected

Definition at line 650 of file class.ilObjLTIConsumerGUI.php.

651 {
652 global $DIC; /* @var \ILIAS\DI\Container $DIC */
653
655 $this->object->getType(),
656 $this->object->getRefId(),
657 $this->object->getId(),
658 $DIC->user()->getId()
659 );
660
661 ilLPStatusWrapper::_updateStatus($this->object->getId(), $DIC->user()->getId());
662 }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.

References $DIC, ilChangeEvent\_recordReadEvent(), and ilLPStatusWrapper\_updateStatus().

Referenced by executeCommand().

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

Field Documentation

◆ $ltiAccess

ilObjLTIConsumerGUI::$ltiAccess
protected

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

◆ $object

ilObjLTIConsumerGUI::$object

Definition at line 43 of file class.ilObjLTIConsumerGUI.php.

Referenced by initMetadata().

◆ CFORM_CUSTOM_NEW

const ilObjLTIConsumerGUI::CFORM_CUSTOM_NEW = 99

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

Referenced by initCreationForms().

◆ DEFAULT_CMD

const ilObjLTIConsumerGUI::DEFAULT_CMD = 'infoScreen'

◆ TAB_ID_CONTENT

const ilObjLTIConsumerGUI::TAB_ID_CONTENT = 'tab_content'

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

◆ TAB_ID_INFO

const ilObjLTIConsumerGUI::TAB_ID_INFO = 'tab_info'

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

◆ TAB_ID_LEARNING_PROGRESS

const ilObjLTIConsumerGUI::TAB_ID_LEARNING_PROGRESS = 'learning_progress'

Definition at line 35 of file class.ilObjLTIConsumerGUI.php.

◆ TAB_ID_METADATA

const ilObjLTIConsumerGUI::TAB_ID_METADATA = 'tab_metadata'

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

◆ TAB_ID_PERMISSIONS

const ilObjLTIConsumerGUI::TAB_ID_PERMISSIONS = 'perm_settings'

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

◆ TAB_ID_SCORING

const ilObjLTIConsumerGUI::TAB_ID_SCORING = 'tab_scoring'

Definition at line 33 of file class.ilObjLTIConsumerGUI.php.

◆ TAB_ID_SETTINGS

const ilObjLTIConsumerGUI::TAB_ID_SETTINGS = 'tab_settings'

Definition at line 31 of file class.ilObjLTIConsumerGUI.php.

◆ TAB_ID_STATEMENTS

const ilObjLTIConsumerGUI::TAB_ID_STATEMENTS = 'tab_statements'

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


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