ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjLTIToolGUI Class Reference

Screens of the repository object type lti. More...

+ Inheritance diagram for ilObjLTIToolGUI:
+ Collaboration diagram for ilObjLTIToolGUI:

Public Member Functions

 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 
 create ()
 Offers the tools the user may pick and, with the permission to define tools, a form for one of their own. More...
 
 save ()
 Creates the object for the tool of the request. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 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 (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 Permanent link of an object: it opens with the permission to read, its info screen with the permission to see it only. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

const string CMD_LAUNCH = 'launch'
 
const string CMD_DELIVER_CERTIFICATE = 'deliverCertificate'
 
const string CMD_SELECT_CONTENT = 'selectContent'
 
const string ORIGIN_PARAM = 'origin_ref_id'
 
- Data Fields inherited from ilObject2GUI
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 ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 setTabs ()
 
 saveOwnTool ()
 Stores a tool of the user and creates the object for it. More...
 
 registerTool ()
 Registers a tool of the user through LTI Advantage Dynamic Registration: the registration page of the tool opens in an iframe, and the object is created once the tool says it is done. More...
 
 finishRegistration ()
 Creates the object for the tool a registration of the user stored. More...
 
 selectContent ()
 Picks the content of new objects in a tool that offers Deep Linking, from an object of the tool: the objects are created next to it, as earlier releases did. More...
 
 startDeepLinking ()
 Content of the iframe: starts the Deep Linking request at the tool. More...
 
 finishDeepLinking ()
 Where the tool posts the content the user picked, inside the iframe: an object is created for each resource link, and the whole window goes on to the settings of the object, or to the container when there are several. More...
 
 deliverCertificate ()
 The certificate of the current user, once they have one. More...
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 The header offers the certificate of the current user, once they have one. More...
 
 infoScreen ()
 The command the info action of the listing calls. More...
 
 launch ()
 
- 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 ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 addAdminLocatorItems (bool $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 (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Private Member Functions

 addReportTabs ()
 The reports on what users did in the tool, each one only where the tool provides its data. More...
 
 getReports ()
 The reports, by tab, with their GUI and whether the user may see them. More...
 
 assertReportAccess (string $tab)
 
 trackReadEvent ()
 Opening an object counts as reading it, which the learning progress takes into account. More...
 
 renderCreation (?Form $own_form=null, ?Form $registration_form=null)
 The ways of creating an object, one section each, with the first one open. More...
 
 showDeepLinking (ilLTITool $tool, string $custom_params='')
 The iframe the tool shows its content in for the user to pick. More...
 
 buildRegistrationForm ()
 
 buildToolSelection ()
 
 buildOwnTool (?Form $form)
 Each LTI version has its own form, because they authenticate the tool differently. More...
 
 buildVersionControl (string $active)
 
 buildOwnToolForm ()
 
 getOwnToolAction ()
 
 getRequestedVersion ()
 
 createOrSelectContent (ilLTITool $tool, string $custom_params='')
 A tool that offers Deep Linking lets the user pick the content of the objects first. More...
 
 createToolObject (ilLTITool $tool, string $title, string $description, string $custom_params)
 
 getSettingsLink (ilObjLTITool $object)
 
 getStaticLink (int $ref_id)
 
 getContainerRefId ()
 The container a new object is created in. More...
 
 assertCreationAccess ()
 
 getDeepLinkingState ()
 
 getOriginRefId ()
 The object whose tool settings the content is picked from, 0 on the creation screen. More...
 
 isContentAvailable ()
 Launching needs the object online and a tool that is still available. More...
 
 configureInfoScreen (ilInfoScreenGUI $info)
 What the info screen tells about the tool is what a user needs to judge the data it receives. More...
 
 getToolIdParameter ()
 
 getStringParameter (string $name)
 
 getIntParameter (string $name)
 
 assertOwnToolCreationAccess ()
 
 getLTIObject ()
 

Private Attributes

const string CMD_SAVE_OWN_TOOL = 'saveOwnTool'
 
const string CMD_REGISTER_TOOL = 'registerTool'
 
const string CMD_FINISH_REGISTRATION = 'finishRegistration'
 
const string REGISTRATION_PARAM = 'registration'
 
const string REGISTRATION_FRAME_ID = 'il_lti_registration_frame'
 
const string CMD_START_DEEP_LINKING = 'startDeepLinking'
 
const string CMD_FINISH_DEEP_LINKING = 'finishDeepLinking'
 
const string DEEP_LINKING_PARAM = 'deep_linking'
 
const string VERSION_PARAM = 'version'
 
const string TAB_CONTENT = 'tab_content'
 
const string TAB_INFO = 'tab_info'
 
const string TAB_SETTINGS = 'tab_settings'
 
const string TAB_STATEMENTS = 'tab_statements'
 
const string TAB_RANKING = 'tab_scoring'
 
const string TAB_GRADEBOOK = 'tab_grade_synchronization'
 
const string TAB_LEARNING_PROGRESS = 'learning_progress'
 
const string TAB_METADATA = 'meta_data'
 
const string TAB_PERMISSIONS = 'id_permissions'
 

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Screens of the repository object type lti.

The object is created for one tool, which cannot be changed afterwards, and opening it launches that tool.

Author
Saúl Díaz sdiaz.nosp@m.@sur.nosp@m.labs..nosp@m.com

@ilCtrl_Calls ilObjLTIToolGUI: ilCommonActionDispatcherGUI @ilCtrl_Calls ilObjLTIToolGUI: ilInfoScreenGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLearningProgressGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLTIToolXapiStatementsGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLTIObjectGradebookGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLTIObjectRankingGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLTIObjectSettingsGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLTIToolLaunchGUI @ilCtrl_Calls ilObjLTIToolGUI: ilLTIToolSettingsGUI @ilCtrl_Calls ilObjLTIToolGUI: ilObjectMetaDataGUI @ilCtrl_Calls ilObjLTIToolGUI: ilPermissionGUI

Definition at line 45 of file class.ilObjLTIToolGUI.php.

Member Function Documentation

◆ _goto()

static ilObjLTIToolGUI::_goto ( string  $a_target)
static

Permanent link of an object: it opens with the permission to read, its info screen with the permission to see it only.

Exceptions
ilCtrlException

Definition at line 82 of file class.ilObjLTIToolGUI.php.

82 : void
83 {
84 global $DIC;
85
86 $access = $DIC->access();
87 $lng = $DIC->language();
88 $error = $DIC['ilErr'];
89 $ref_id = (int) explode('_', $a_target)[0];
90
91 if ($ref_id > 0 && $access->checkAccess('read', '', $ref_id)) {
92 // a link to the object may open in an iframe of another site, an embedded LTI 1.1 launch for one,
93 // which only keeps the session with a SameSite=None cookie, as in earlier releases
95 $DIC->ctrl()->setTargetScript('ilias.php');
96 $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', $ref_id);
97 $DIC->ctrl()->redirectByClass([ilRepositoryGUI::class, self::class]);
98 }
99
100 if ($ref_id > 0 && $access->checkAccess('visible', '', $ref_id)) {
102 }
103
104 if ($ref_id > 0 && $access->checkAccess('read', '', ROOT_FOLDER_ID)) {
105 $DIC->ui()->mainTemplate()->setOnScreenMessage(
106 'info',
107 sprintf($lng->txt('msg_no_perm_read_item'), ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id))),
108 true
109 );
111 }
112
113 $error->raiseError($lng->txt('msg_no_perm_read_lm'), $error->FATAL);
114 }
raiseError(string $message, ?int $code=null)
static allowCrossSite()
Sends the session cookie again as SameSite=None, with the path and the domain of the one PHP sends so...
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilAccessHandler $access
ilErrorHandling $error
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
global $DIC
Definition: shib_login.php:26

References ilObject2GUI\$access, $DIC, ilObject2GUI\$error, ilObject2GUI\$lng, ilObjectGUI\$ref_id, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilLTISessionCookie\allowCrossSite(), ilRBACAccessHandler\checkAccess(), ILIAS\Repository\int(), ilErrorHandling\raiseError(), ROOT_FOLDER_ID, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ addReportTabs()

ilObjLTIToolGUI::addReportTabs ( )
private

The reports on what users did in the tool, each one only where the tool provides its data.

Exceptions
ilCtrlException
ilObjectException

Definition at line 273 of file class.ilObjLTIToolGUI.php.

273 : void
274 {
275 foreach ($this->getReports() as $tab => [$class, $available]) {
276 if ($available) {
277 $this->tabs_gui->addTab($tab, $this->lng->txt($tab), $this->ctrl->getLinkTargetByClass($class));
278 }
279 }
280 }
getReports()
The reports, by tab, with their GUI and whether the user may see them.

References getReports(), and ILIAS\Repository\lng().

Referenced by setTabs().

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

◆ assertCreationAccess()

ilObjLTIToolGUI::assertCreationAccess ( )
private

Definition at line 935 of file class.ilObjLTIToolGUI.php.

935 : void
936 {
937 if (!$this->checkPermissionBool('create', '', $this->getType())) {
938 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->MESSAGE);
939 }
940 }
getType()
Functions that must be overwritten.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)

References ilObject2GUI\checkPermissionBool(), getType(), and ILIAS\Repository\lng().

Referenced by finishDeepLinking(), selectContent(), and startDeepLinking().

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

◆ assertOwnToolCreationAccess()

ilObjLTIToolGUI::assertOwnToolCreationAccess ( )
private

Definition at line 1043 of file class.ilObjLTIToolGUI.php.

1043 : void
1044 {
1046 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
1047 }
1048 }
static hasOwnToolCreationAccess()
True when the user may define tools of their own, which is what allows creating an LTI object for a t...

References ilObjLTIAdministrationAccess\hasOwnToolCreationAccess(), and ILIAS\Repository\lng().

Referenced by finishRegistration(), registerTool(), and saveOwnTool().

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

◆ assertReportAccess()

ilObjLTIToolGUI::assertReportAccess ( string  $tab)
private
Exceptions
ilObjectException

Definition at line 305 of file class.ilObjLTIToolGUI.php.

305 : void
306 {
307 if (!$this->getReports()[$tab][1]) {
308 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
309 }
310 }

References getReports(), and ILIAS\Repository\lng().

Referenced by executeCommand().

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

◆ buildOwnTool()

ilObjLTIToolGUI::buildOwnTool ( ?Form  $form)
private

Each LTI version has its own form, because they authenticate the tool differently.

The control on top switches between them.

Parameters
Form | null$form
Returns
array
Exceptions
ilCtrlException

Definition at line 785 of file class.ilObjLTIToolGUI.php.

785 : array
786 {
787 $version = $this->getRequestedVersion();
788 $content = [$this->buildVersionControl($version)];
789
790 $notice = ilLTIToolForm::getDeprecationNotice($this->ui_factory, $this->lng, $version);
791 if ($notice !== null) {
792 $content[] = $notice;
793 }
794
795 $content[] = $form ?? $this->buildOwnToolForm()->getForm(
796 $this->getOwnToolAction(),
797 $this->lng->txt('lti_add_own_provider')
798 );
799
800 return $content;
801 }
$version
Definition: plugin.php:24
static getDeprecationNotice(ILIAS\UI\Factory $ui_factory, ilLanguage $lng, string $version)
The warning an LTI 1.1 tool carries, which its form shows above itself.
buildVersionControl(string $active)

References $version, buildOwnToolForm(), buildVersionControl(), ilLTIToolForm\getDeprecationNotice(), getOwnToolAction(), getRequestedVersion(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildOwnToolForm()

ilObjLTIToolGUI::buildOwnToolForm ( )
private

Definition at line 824 of file class.ilObjLTIToolGUI.php.

825 {
826 return new ilLTIToolForm(
827 $this->lng,
828 $this->ui_factory,
829 $this->refinery,
830 $this->user,
831 0,
832 $this->getRequestedVersion()
833 );
834 }
Create and edit form of an external tool ILIAS may launch, stored in lti_ext_provider.

References getRequestedVersion(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

Referenced by buildOwnTool(), and saveOwnTool().

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

◆ buildRegistrationForm()

ilObjLTIToolGUI::buildRegistrationForm ( )
private
Exceptions
ilCtrlException

Definition at line 681 of file class.ilObjLTIToolGUI.php.

681 : Form
682 {
683 $field = $this->ui_factory->input()->field();
684 // the tool of the last row of the selection must not end up in the action of this form
685 $this->ctrl->setParameter($this, 'tool_id', null);
686
687 return $this->ui_factory->input()->container()->form()->standard(
688 $this->ctrl->getFormAction($this, self::CMD_REGISTER_TOOL),
689 [
690 'url' => $field->url($this->lng->txt('lti_con_prov_dyn_reg_url'), $this->lng->txt('lti_con_prov_dyn_reg_url_info'))
691 ->withRequired(true),
692 'params' => $field->text($this->lng->txt('lti_con_prov_dyn_reg_params'), $this->lng->txt('lti_con_prov_dyn_reg_params_info')),
693 ]
694 )->withSubmitLabel($this->lng->txt('add'));
695 }

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

Referenced by finishRegistration(), and registerTool().

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

◆ buildToolSelection()

ilObjLTIToolGUI::buildToolSelection ( )
private
Exceptions
ilCtrlException

Definition at line 769 of file class.ilObjLTIToolGUI.php.

769 : array
770 {
771 $table = ilLTIToolTable::forSelection($this, 'save');
772 $filter = $table->getFilter($this->ctrl->getLinkTarget($this, 'create'));
773
774 return [$filter, $table->getTable($filter)];
775 }
static forSelection(object $gui, string $cmd)
Lists the tools the user may create an object for.

References ILIAS\Repository\ctrl(), and ilLTIToolTable\forSelection().

+ Here is the call graph for this function:

◆ buildVersionControl()

ilObjLTIToolGUI::buildVersionControl ( string  $active)
private
Exceptions
ilCtrlException

Definition at line 806 of file class.ilObjLTIToolGUI.php.

806 : Component
807 {
808 // the tool of the last row of the selection must not end up in the links of this control
809 $this->ctrl->setParameter($this, 'tool_id', null);
810
811 $labels = ilLTITool::getVersionLabels($this->lng);
812 $actions = [];
813 foreach ($labels as $version => $label) {
814 $this->ctrl->setParameter($this, self::VERSION_PARAM, $version);
815 $actions[$label] = $this->ctrl->getLinkTarget($this, 'create');
816 }
817 $this->ctrl->setParameter($this, self::VERSION_PARAM, $active);
818
819 return $this->ui_factory->viewControl()
820 ->mode($actions, $this->lng->txt('lti_con_version'))
821 ->withActive($labels[$active]);
822 }
static getVersionLabels(ilLanguage $lng)
The names of the LTI versions, the current one first.

References $version, ILIAS\Repository\ctrl(), ilLTITool\getVersionLabels(), and ILIAS\Repository\lng().

Referenced by buildOwnTool().

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

◆ configureInfoScreen()

ilObjLTIToolGUI::configureInfoScreen ( ilInfoScreenGUI  $info)
private

What the info screen tells about the tool is what a user needs to judge the data it receives.

Exceptions
ilObjectException

Definition at line 973 of file class.ilObjLTIToolGUI.php.

973 : void
974 {
975 if (!$this->checkPermissionBool('visible') && !$this->checkPermissionBool('read')) {
976 $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->MESSAGE);
977 }
978
979 $object = $this->getLTIObject();
980 $tool = $object->getTool();
981
982 if ($tool->getUrl() === '') {
983 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('lti_provider_not_set_msg'));
984 } elseif ($tool->getAvailability() === ilLTITool::AVAILABILITY_NONE) {
985 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('lti_provider_not_avail_msg'));
986 }
987
988 $info->enablePrivateNotes();
989 $info->enableNews($this->checkPermissionBool('read'));
990 $info->enableNewsEditing(false);
991 if ($this->checkPermissionBool('write') && new ilSetting('news')->get('enable_rss_for_internal')) {
992 $info->setBlockProperty('news', 'settings', 'true');
993 $info->setBlockProperty('news', 'public_notifications_option', 'true');
994 }
995
996 $info->addMetaDataSections($object->getId(), 0, $object->getType());
997
999 $info->addSection($this->lng->txt('lti_info_learning_progress_section'));
1000 $info->addProperty($this->lng->txt('mastery_score'), round(100 * $object->getMasteryScore(), 2) . ' %');
1001 }
1002
1003 $info->addSection($this->lng->txt('lti_info_privacy_section'));
1004 $info->addProperty($this->lng->txt('lti_con_prov_url'), $tool->getUrl());
1005 $info->addProperty(
1006 $this->lng->txt('conf_privacy_name'),
1007 $this->lng->txt('conf_privacy_name_' . ilObjCmiXapiGUI::getPrivacyNameString($tool->getPrivacyName()))
1008 );
1009 $info->addProperty(
1010 $this->lng->txt('conf_privacy_ident'),
1011 $this->lng->txt('conf_privacy_ident_' . ilObjCmiXapiGUI::getPrivacyIdentString($tool->getPrivacyIdent()))
1012 );
1013 if ($tool->isExternal()) {
1014 $info->addProperty(
1015 $this->lng->txt('lti_info_external_provider_label'),
1016 $this->lng->txt('lti_info_external_provider_info')
1017 );
1018 }
1019 if ($tool->getUseXapi()) {
1020 $info->addProperty($this->lng->txt('lti_con_prov_xapi_launch_url'), $tool->getXapiLaunchUrl());
1021 }
1022 }
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
enableNewsEditing(bool $a_enable=true)
enablePrivateNotes(bool $a_enable=true)
static _lookupDBMode(int $a_obj_id)
const int AVAILABILITY_NONE
The tool is no longer available, neither for new nor for existing objects.
static getPrivacyNameString(int $ident)
static getPrivacyIdentString(int $ident)
ILIAS Setting Class.
$info
Definition: entry_point.php:21

References $info, ilObjectGUI\$object, ilLPObjSettings\_lookupDBMode(), ilInfoScreenGUI\addProperty(), ilLTITool\AVAILABILITY_NONE, ilObject2GUI\checkPermissionBool(), ilInfoScreenGUI\enableNewsEditing(), ilInfoScreenGUI\enablePrivateNotes(), ilObject\getId(), getLTIObject(), ilObjCmiXapiGUI\getPrivacyIdentString(), ilObjCmiXapiGUI\getPrivacyNameString(), ilObject\getType(), ILIAS\Repository\lng(), and ilLPObjSettings\LP_MODE_DEACTIVATED.

Referenced by executeCommand().

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

◆ create()

ilObjLTIToolGUI::create ( )

Offers the tools the user may pick and, with the permission to define tools, a form for one of their own.

There is no title to fill in: an object is named after its tool.

Exceptions
ilCtrlException

Reimplemented from ilObject2GUI.

Definition at line 336 of file class.ilObjLTIToolGUI.php.

336 : void
337 {
338 if (!$this->checkPermissionBool('create', '', $this->getType())) {
339 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
340 }
341
342 $this->renderCreation();
343 }
renderCreation(?Form $own_form=null, ?Form $registration_form=null)
The ways of creating an object, one section each, with the first one open.

References ilObject2GUI\checkPermissionBool(), getType(), ILIAS\Repository\lng(), and renderCreation().

Referenced by executeCommand(), and save().

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

◆ createOrSelectContent()

ilObjLTIToolGUI::createOrSelectContent ( ilLTITool  $tool,
string  $custom_params = '' 
)
private

A tool that offers Deep Linking lets the user pick the content of the objects first.

Otherwise the object carries the title and the description of its tool, as there is nothing else to name it after.

Parameters
string$custom_paramsthe custom parameters of the object, in the format of its settings
Exceptions
ilCtrlException
ilMDServicesException
RandomException

Definition at line 863 of file class.ilObjLTIToolGUI.php.

863 : void
864 {
865 if ($tool->offersDeepLinking()) {
866 $this->showDeepLinking($tool, $custom_params);
867 return;
868 }
869
870 $object = $this->createToolObject($tool, '', '', $custom_params);
871
872 // a new object is offline and named after its tool, so its settings are where it is finished
873 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
874 $this->ctrl->redirectToURL($this->getSettingsLink($object));
875 }
offersDeepLinking()
True when a user may pick the content of new objects in the tool, which only LTI Advantage offers.
createToolObject(ilLTITool $tool, string $title, string $description, string $custom_params)
showDeepLinking(ilLTITool $tool, string $custom_params='')
The iframe the tool shows its content in for the user to pick.
getSettingsLink(ilObjLTITool $object)

References ilObjectGUI\$object, createToolObject(), ILIAS\Repository\ctrl(), getSettingsLink(), ILIAS\Repository\lng(), ilLTITool\offersDeepLinking(), and showDeepLinking().

Referenced by finishRegistration(), save(), and saveOwnTool().

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

◆ createToolObject()

ilObjLTIToolGUI::createToolObject ( ilLTITool  $tool,
string  $title,
string  $description,
string  $custom_params 
)
private
Parameters
string$titlethe title of the object, the one of the tool when empty
string$descriptionthe description of the object, used with its title only
Exceptions
ilMDServicesException

Definition at line 882 of file class.ilObjLTIToolGUI.php.

883 {
884 $object = new ilObjLTITool();
885 $object->setType($this->getType());
887 $object->setTitle($title !== '' ? $title : $tool->getTitle());
888 $object->setDescription($title !== '' ? $description : $tool->getDescription());
889 $object->setToolId($tool->getId());
890 $object->setMasteryScore($tool->getMasteryScore());
891 $object->setCustomParams($custom_params);
892 $object->create();
894 $object->syncKeywordsFromTool();
895
896 $this->ctrl->setParameter($this, 'new_type', '');
897 // putObjectInTree() places the one object of a creation screen and keeps its node, Deep Linking creates several
898 $this->node_id = 0;
899 $this->putObjectInTree($object);
900
901 return $object;
902 }
getMasteryScore()
The share of the maximum result, between 0 and 1, a new object requires by default.
A repository object of type lti: one external tool made available at one place of the repository.
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
setType(string $type)
setTitle(string $title)
create()
note: title, description and type should be set when this function is called
setDescription(string $description)

References ilObjectGUI\$object, ilObject\create(), ilObject\createMetaData(), ILIAS\Repository\ctrl(), ilLTITool\getDescription(), ilLTITool\getId(), ilLTITool\getMasteryScore(), ilLTITool\getTitle(), getType(), ilObject\processAutoRating(), ilObject2GUI\putObjectInTree(), ilObject\setDescription(), ilObject\setTitle(), and ilObject\setType().

Referenced by createOrSelectContent(), and finishDeepLinking().

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

◆ deliverCertificate()

ilObjLTIToolGUI::deliverCertificate ( )
protected

The certificate of the current user, once they have one.

Exceptions
ilCtrlException

Definition at line 702 of file class.ilObjLTIToolGUI.php.

702 : void
703 {
704 if (!new ilCertificateDownloadValidator()->isCertificateDownloadable($this->user->getId(), $this->object->getId())) {
705 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
706 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
707 }
708
709 $this->lng->loadLanguageModule('cert');
713 $this->lng->txt('error_creating_certificate_pdf')
714 )->downloadPdf($this->user->getId(), $this->object->getId());
715 }
Validates if an active certificate is stored in the database and can be downloaded by the user.
downloadPdf(int $userId, int $objectId)
Just a wrapper class to create Unit Test for other classes.

References ILIAS\Repository\ctrl(), ilCertificatePdfAction\downloadPdf(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ executeCommand()

ilObjLTIToolGUI::executeCommand ( )
Exceptions
ilCtrlException
ilObjectException

Reimplemented from ilObject2GUI.

Definition at line 120 of file class.ilObjLTIToolGUI.php.

120 : void
121 {
122 $this->lng->loadLanguageModule('lti');
123 $this->prepareOutput();
124 $this->trackReadEvent();
125
126 switch ($this->ctrl->getNextClass($this)) {
127 case strtolower(ilCommonActionDispatcherGUI::class):
128 $this->ctrl->forwardCommand(ilCommonActionDispatcherGUI::getInstanceFromAjaxCall());
129 break;
130
131 case strtolower(ilLTIToolLaunchGUI::class):
132 $this->checkPermission('read');
133 $this->tabs_gui->activateTab(self::TAB_CONTENT);
134 $this->ctrl->forwardCommand(new ilLTIToolLaunchGUI($this->getLTIObject()));
135 break;
136
137 case strtolower(ilInfoScreenGUI::class):
138 $this->tabs_gui->activateTab(self::TAB_INFO);
139 $info = new ilInfoScreenGUI($this);
141 $this->ctrl->forwardCommand($info);
142 break;
143
144 case strtolower(ilLTIToolXapiStatementsGUI::class):
146 $this->tabs_gui->activateTab(self::TAB_STATEMENTS);
147 $this->ctrl->forwardCommand(new ilLTIToolXapiStatementsGUI($this->getLTIObject()));
148 break;
149
150 case strtolower(ilLTIObjectRankingGUI::class):
151 $this->assertReportAccess(self::TAB_RANKING);
152 $this->tabs_gui->activateTab(self::TAB_RANKING);
153 $this->ctrl->forwardCommand(new ilLTIObjectRankingGUI($this->getLTIObject()));
154 break;
155
156 case strtolower(ilLTIObjectGradebookGUI::class):
157 $this->assertReportAccess(self::TAB_GRADEBOOK);
158 $this->tabs_gui->activateTab(self::TAB_GRADEBOOK);
159 $this->ctrl->forwardCommand(new ilLTIObjectGradebookGUI($this->getLTIObject()));
160 break;
161
162 case strtolower(ilLearningProgressGUI::class):
163 if (!ilObjLTIToolAccess::hasLearningProgressAccess($this->getLTIObject())) {
164 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
165 }
166 $this->tabs_gui->activateTab(self::TAB_LEARNING_PROGRESS);
167 $this->ctrl->forwardCommand(new ilLearningProgressGUI(
169 $this->object->getRefId()
170 ));
171 break;
172
173 case strtolower(ilObjectMetaDataGUI::class):
174 $this->checkPermission('write');
175 $this->tabs_gui->activateTab(self::TAB_METADATA);
176 $this->ctrl->forwardCommand(new ilObjectMetaDataGUI($this->getLTIObject()));
177 break;
178
179 case strtolower(ilLTIObjectSettingsGUI::class):
180 $this->checkPermission('write');
181 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
182 $this->ctrl->forwardCommand(new ilLTIObjectSettingsGUI($this->getLTIObject()));
183 break;
184
185 case strtolower(ilLTIToolSettingsGUI::class):
186 $this->checkPermission('write');
187 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
189 $this->ctrl->forwardCommand(new ilLTIToolSettingsGUI($this->getLTIObject()));
190 break;
191
192 case strtolower(ilPermissionGUI::class):
193 $this->tabs_gui->activateTab(self::TAB_PERMISSIONS);
194 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
195 break;
196
197 default:
198 $cmd = $this->ctrl->getCmd(self::CMD_LAUNCH);
199 // an object without content to launch opens on its info screen
200 if ($cmd === self::CMD_LAUNCH && $this->object instanceof ilObjLTITool && !$this->isContentAvailable()) {
201 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
202 }
203 match ($cmd) {
204 self::CMD_LAUNCH => $this->launch(),
205 'create' => $this->create(),
206 'save' => $this->save(),
207 'cancel' => $this->cancelCreation(),
208 'infoScreen' => $this->infoScreen(),
209 'redrawHeaderAction' => $this->redrawHeaderActionObject(),
210 self::CMD_DELIVER_CERTIFICATE => $this->deliverCertificate(),
211 self::CMD_SAVE_OWN_TOOL => $this->saveOwnTool(),
212 self::CMD_REGISTER_TOOL => $this->registerTool(),
213 self::CMD_FINISH_REGISTRATION => $this->finishRegistration(),
214 self::CMD_SELECT_CONTENT => $this->selectContent(),
215 self::CMD_START_DEEP_LINKING => $this->startDeepLinking(),
216 self::CMD_FINISH_DEEP_LINKING => $this->finishDeepLinking(),
217 default => $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE),
218 };
219 }
220 }
Class ilCommonActionDispatcherGUI.
Class ilInfoScreenGUI.
The latest grade of each user that the tool of an LTI object sent through LTI Advantage Assignment an...
Ranking of the users of an LTI object by the score its tool sent as xAPI statements: the best users,...
Settings of an LTI object: what it is called, whether it is online, how it launches its tool and the ...
addSubTabs()
The tool of an object only has settings of its own when it belongs to the user reading them.
Content screen of an LTI object: it launches the tool the object points to.
Settings of the tool an object launches, reachable from the object for the user who defined the tool.
The xAPI statements the tool of an LTI object sent to its LRS, queried page by page through the state...
Class ilObjUserTrackingGUI.
Access checks of the repository object type lti.
const string TAB_STATEMENTS
const string TAB_PERMISSIONS
registerTool()
Registers a tool of the user through LTI Advantage Dynamic Registration: the registration page of the...
saveOwnTool()
Stores a tool of the user and creates the object for it.
configureInfoScreen(ilInfoScreenGUI $info)
What the info screen tells about the tool is what a user needs to judge the data it receives.
create()
Offers the tools the user may pick and, with the permission to define tools, a form for one of their ...
infoScreen()
The command the info action of the listing calls.
startDeepLinking()
Content of the iframe: starts the Deep Linking request at the tool.
selectContent()
Picks the content of new objects in a tool that offers Deep Linking, from an object of the tool: the ...
assertReportAccess(string $tab)
trackReadEvent()
Opening an object counts as reading it, which the learning progress takes into account.
isContentAvailable()
Launching needs the object online and a tool that is still available.
save()
Creates the object for the tool of the request.
deliverCertificate()
The certificate of the current user, once they have one.
finishRegistration()
Creates the object for the tool a registration of the user stored.
finishDeepLinking()
Where the tool posts the content the user picked, inside the iframe: an object is created for each re...
const string TAB_GRADEBOOK
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
cancelCreation()
cancel create action and go back to repository parent
redrawHeaderActionObject()
Ajax call: redraw action header only.
Class ilObjectMetaDataGUI.
if(!file_exists('../ilias.ini.php'))

References $info, ilLTIObjectSettingsGUI\addSubTabs(), assertReportAccess(), ilObjectGUI\cancelCreation(), ilObject2GUI\checkPermission(), configureInfoScreen(), create(), ILIAS\Repository\ctrl(), deliverCertificate(), finishDeepLinking(), finishRegistration(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getLTIObject(), ilObjLTIToolAccess\hasLearningProgressAccess(), infoScreen(), isContentAvailable(), launch(), ILIAS\Repository\lng(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), ilObject2GUI\prepareOutput(), ilObjectGUI\redrawHeaderActionObject(), registerTool(), save(), saveOwnTool(), selectContent(), startDeepLinking(), and trackReadEvent().

+ Here is the call graph for this function:

◆ finishDeepLinking()

ilObjLTIToolGUI::finishDeepLinking ( )
protected

Where the tool posts the content the user picked, inside the iframe: an object is created for each resource link, and the whole window goes on to the settings of the object, or to the container when there are several.

Exceptions
ilCtrlException
ilMDServicesException
RandomException
ResponseSendingException

Definition at line 620 of file class.ilObjLTIToolGUI.php.

620 : never
621 {
622 global $DIC;
623
624 $this->assertCreationAccess();
625
627 $this->getDeepLinkingState(),
628 $this->user->getId(),
629 $this->getContainerRefId(),
630 $DIC
631 );
632 $this->ctrl->setParameter($this, 'new_type', $this->getType());
633 $create_url = $this->ctrl->getLinkTarget($this, 'create');
634
635 if ($response === null) {
636 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('lti_deep_linking_failed'), true);
638 }
639
640 // what the tool tells the user, as the LTI standard defines it
641 foreach (['message' => 'info', 'error' => 'failure'] as $key => $type) {
642 if ($response[$key] !== '') {
643 $this->tpl->setOnScreenMessage($type, htmlspecialchars($response[$key], ENT_QUOTES), true);
644 }
645 }
646 if ($response['items'] === []) {
647 if ($response['error'] === '') {
648 $message = $this->lng->txt('lti_deep_linking_no_content');
649 if ($response['message'] !== '') {
650 $message = htmlspecialchars($response['message'], ENT_QUOTES) . ' ' . $message;
651 }
652 $this->tpl->setOnScreenMessage('info', $message, true);
653 }
655 }
656
657 $objects = [];
658 foreach ($response['items'] as $item) {
659 $objects[] = $this->createToolObject(
660 $response['tool'],
661 $item['title'],
662 $item['description'],
663 implode(';', array_filter([$response['custom_params'], $item['custom_params']]))
664 );
665 }
666
667 $DIC->logger()->forComponent('lti')->info('LTI Deep Linking of the tool {tool_id}: {count} objects created in {ref_id}', [
668 'tool_id' => $response['tool']->getId(),
669 'count' => count($objects),
670 'ref_id' => $this->getContainerRefId(),
671 ]);
672 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
674 count($objects) > 1 ? $this->getStaticLink($this->getContainerRefId()) : $this->getSettingsLink($objects[0])
675 );
676 }
static receive(string $state, int $user_id, int $ref_id, Container $dic)
Checks the response of the tool to the request, which is used up with it.
static sendTopRedirect(string $url)
Ends the request with a page that opens the given URL in the whole window, as the response of the too...
getContainerRefId()
The container a new object is created in.
$response
Definition: xapitoken.php:92

References $DIC, $message, $response, ilObject2GUI\$type, assertCreationAccess(), createToolObject(), ILIAS\Repository\ctrl(), getContainerRefId(), getDeepLinkingState(), ILIAS\Survey\Mode\getId(), getSettingsLink(), getStaticLink(), getType(), ILIAS\Repository\lng(), ilLTIAdvantagePlatformDeepLinking\receive(), ilLTIAdvantagePlatformDeepLinking\sendTopRedirect(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ finishRegistration()

ilObjLTIToolGUI::finishRegistration ( )
protected

Creates the object for the tool a registration of the user stored.

Exceptions
ilCtrlException
ilMDServicesException

Definition at line 505 of file class.ilObjLTIToolGUI.php.

505 : void
506 {
507 global $DIC;
508
510
512 $this->getStringParameter(self::REGISTRATION_PARAM),
513 $this->user->getId()
514 );
515 if ($registered === null) {
516 $DIC->logger()->forComponent('lti')->warning('LTI Advantage Dynamic Registration of a tool not finished: the tool did not register, or not for the user {usr_id}', [
517 'usr_id' => $this->user->getId(),
518 ]);
519 $this->ctrl->setParameter($this, 'new_type', $this->getType());
520 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('lti_dyn_reg_failed'));
521 $this->renderCreation(null, $this->buildRegistrationForm());
522 return;
523 }
524
525 [$tool, $custom_params] = $registered;
526 $this->createOrSelectContent($tool, $custom_params);
527 }
static finish(string $client_id, int $user_id)
Ends a registration the session started.
createOrSelectContent(ilLTITool $tool, string $custom_params='')
A tool that offers Deep Linking lets the user pick the content of the objects first.
getStringParameter(string $name)

References $DIC, assertOwnToolCreationAccess(), buildRegistrationForm(), createOrSelectContent(), ILIAS\Repository\ctrl(), ilLTIAdvantagePlatformRegistration\finish(), getStringParameter(), getType(), ILIAS\Repository\lng(), renderCreation(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ getContainerRefId()

ilObjLTIToolGUI::getContainerRefId ( )
private

The container a new object is created in.

Definition at line 930 of file class.ilObjLTIToolGUI.php.

930 : int
931 {
932 return (int) $this->parent_id;
933 }

References ilObject2GUI\$parent_id.

Referenced by finishDeepLinking(), and showDeepLinking().

+ Here is the caller graph for this function:

◆ getDeepLinkingState()

ilObjLTIToolGUI::getDeepLinkingState ( )
private

Definition at line 942 of file class.ilObjLTIToolGUI.php.

942 : string
943 {
944 return $this->getStringParameter(self::DEEP_LINKING_PARAM);
945 }

References getStringParameter().

Referenced by finishDeepLinking(), and startDeepLinking().

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

◆ getIntParameter()

ilObjLTIToolGUI::getIntParameter ( string  $name)
private

Definition at line 1036 of file class.ilObjLTIToolGUI.php.

1036 : int
1037 {
1038 return $this->request_wrapper->has($name)
1039 ? $this->request_wrapper->retrieve($name, $this->refinery->kindlyTo()->int())
1040 : 0;
1041 }

References ILIAS\Repository\refinery().

Referenced by getOriginRefId(), and getToolIdParameter().

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

◆ getLTIObject()

ilObjLTIToolGUI::getLTIObject ( )
private
Exceptions
ilObjectException

Definition at line 1053 of file class.ilObjLTIToolGUI.php.

1053 : ilObjLTITool
1054 {
1055 if (!$this->object instanceof ilObjLTITool) {
1056 throw new ilObjectException('no LTI object given');
1057 }
1058
1059 return $this->object;
1060 }
Base exception class for object service.

References ilObjectGUI\$object.

Referenced by configureInfoScreen(), executeCommand(), getReports(), isContentAvailable(), and launch().

+ Here is the caller graph for this function:

◆ getOriginRefId()

ilObjLTIToolGUI::getOriginRefId ( )
private

The object whose tool settings the content is picked from, 0 on the creation screen.

Definition at line 950 of file class.ilObjLTIToolGUI.php.

950 : int
951 {
952 return $this->getIntParameter(self::ORIGIN_PARAM);
953 }
getIntParameter(string $name)

References getIntParameter().

Referenced by showDeepLinking().

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

◆ getOwnToolAction()

ilObjLTIToolGUI::getOwnToolAction ( )
private
Exceptions
ilCtrlException

Definition at line 839 of file class.ilObjLTIToolGUI.php.

839 : string
840 {
841 $this->ctrl->setParameter($this, self::VERSION_PARAM, $this->getRequestedVersion());
842
843 return $this->ctrl->getFormAction($this, self::CMD_SAVE_OWN_TOOL);
844 }

References ILIAS\Repository\ctrl(), and getRequestedVersion().

Referenced by buildOwnTool(), and saveOwnTool().

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

◆ getReports()

ilObjLTIToolGUI::getReports ( )
private

The reports, by tab, with their GUI and whether the user may see them.

The reports on what users did need the permission to read the object.

Returns
array
Exceptions
ilObjectException

Definition at line 289 of file class.ilObjLTIToolGUI.php.

289 : array
290 {
291 $object = $this->getLTIObject();
292 $read = $this->checkPermissionBool('read');
293
294 return [
295 self::TAB_STATEMENTS => [ilLTIToolXapiStatementsGUI::class, $read && ilObjLTIToolAccess::hasStatementsAccess($object)],
296 self::TAB_RANKING => [ilLTIObjectRankingGUI::class, $read && ilObjLTIToolAccess::hasRankingAccess($object)],
297 self::TAB_GRADEBOOK => [ilLTIObjectGradebookGUI::class, $read && $object->getTool()->isGradeSynchronization()],
298 self::TAB_LEARNING_PROGRESS => [ilLearningProgressGUI::class, ilObjLTIToolAccess::hasLearningProgressAccess($object)],
299 ];
300 }
static hasRankingAccess(ilObjLTITool $object)
The ranking is shown to everybody when the object enables it, otherwise to who may read the outcomes.
static hasLearningProgressAccess(ilObjLTITool $object)
The learning progress only exists for a tool that reports results.
static hasStatementsAccess(ilObjLTITool $object)
The statements are shown to everybody when the object says so, otherwise to who may read the outcomes...

References ilObjectGUI\$object, ilObject2GUI\checkPermissionBool(), getLTIObject(), ilObjLTIToolAccess\hasLearningProgressAccess(), ilObjLTIToolAccess\hasRankingAccess(), and ilObjLTIToolAccess\hasStatementsAccess().

Referenced by addReportTabs(), and assertReportAccess().

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

◆ getRequestedVersion()

ilObjLTIToolGUI::getRequestedVersion ( )
private

Definition at line 846 of file class.ilObjLTIToolGUI.php.

846 : string
847 {
848 $version = $this->getStringParameter(self::VERSION_PARAM);
849
851 }
const string VERSION_ADVANTAGE
const string VERSION_1P1

References $version, getStringParameter(), ilLTITool\VERSION_1P1, and ilLTITool\VERSION_ADVANTAGE.

Referenced by buildOwnTool(), buildOwnToolForm(), and getOwnToolAction().

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

◆ getSettingsLink()

ilObjLTIToolGUI::getSettingsLink ( ilObjLTITool  $object)
private
Exceptions
ilCtrlException

Definition at line 907 of file class.ilObjLTIToolGUI.php.

907 : string
908 {
909 $this->ctrl->setParameterByClass(ilLTIObjectSettingsGUI::class, 'ref_id', $object->getRefId());
910
911 return $this->ctrl->getLinkTargetByClass(
912 [ilObjLTIToolGUI::class, ilLTIObjectSettingsGUI::class],
914 );
915 }

References ilObjectGUI\$object, ilLTIObjectSettingsGUI\CMD_SHOW, ILIAS\Repository\ctrl(), and ilObject\getRefId().

Referenced by createOrSelectContent(), and finishDeepLinking().

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

◆ getStaticLink()

ilObjLTIToolGUI::getStaticLink ( int  $ref_id)
private

Definition at line 917 of file class.ilObjLTIToolGUI.php.

917 : string
918 {
919 global $DIC;
920
921 return (string) $DIC['static_url']->builder()->build(
924 );
925 }
static _lookupType(int $id, bool $reference=false)

References $DIC, ilObjectGUI\$ref_id, and ilObject\_lookupType().

Referenced by finishDeepLinking(), and showDeepLinking().

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

◆ getStringParameter()

ilObjLTIToolGUI::getStringParameter ( string  $name)
private

Definition at line 1029 of file class.ilObjLTIToolGUI.php.

1029 : string
1030 {
1031 return $this->request_wrapper->has($name)
1032 ? $this->request_wrapper->retrieve($name, $this->refinery->kindlyTo()->string())
1033 : '';
1034 }

References ILIAS\Repository\refinery().

Referenced by finishRegistration(), getDeepLinkingState(), and getRequestedVersion().

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

◆ getToolIdParameter()

ilObjLTIToolGUI::getToolIdParameter ( )
private

Definition at line 1024 of file class.ilObjLTIToolGUI.php.

1024 : int
1025 {
1026 return $this->getIntParameter('tool_id');
1027 }

References getIntParameter().

Referenced by save(), and selectContent().

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

◆ getType()

ilObjLTIToolGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

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

71 : string
72 {
73 return 'lti';
74 }

Referenced by assertCreationAccess(), create(), createToolObject(), finishDeepLinking(), finishRegistration(), registerTool(), renderCreation(), save(), saveOwnTool(), showDeepLinking(), and startDeepLinking().

+ Here is the caller graph for this function:

◆ infoScreen()

ilObjLTIToolGUI::infoScreen ( )
protected

The command the info action of the listing calls.

Exceptions
ilCtrlException

Definition at line 750 of file class.ilObjLTIToolGUI.php.

750 : void
751 {
752 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
753 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

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

◆ initHeaderAction()

ilObjLTIToolGUI::initHeaderAction ( ?string  $sub_type = null,
?int  $sub_id = null 
)
protected

The header offers the certificate of the current user, once they have one.

Exceptions
ilCtrlException

Reimplemented from ilObject2GUI.

Definition at line 722 of file class.ilObjLTIToolGUI.php.

723 {
724 $header_action = parent::initHeaderAction($sub_type, $sub_id);
725 if ($header_action === null || $this->creation_mode
726 || !new ilCertificateDownloadValidator()->isCertificateDownloadable($this->user->getId(), $this->object->getId())) {
727 return $header_action;
728 }
729
730 $this->lng->loadLanguageModule('certificate');
731 $link = $this->ctrl->getLinkTarget($this, self::CMD_DELIVER_CERTIFICATE);
732 $header_action->addCustomCommand($link, 'download_certificate');
733 $header_action->addHeaderIcon(
734 'cert_icon',
735 ilUtil::getImagePath('standard/icon_cert.svg'),
736 $this->lng->txt('download_certificate'),
737 null,
738 null,
739 $link
740 );
741
742 return $header_action;
743 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isContentAvailable()

ilObjLTIToolGUI::isContentAvailable ( )
private

Launching needs the object online and a tool that is still available.

Exceptions
ilObjectException

Definition at line 960 of file class.ilObjLTIToolGUI.php.

960 : bool
961 {
962 $object = $this->getLTIObject();
963
964 return !$object->getOfflineStatus()
965 && $object->getTool()->getAvailability() !== ilLTITool::AVAILABILITY_NONE;
966 }

References ilObjectGUI\$object, ilLTITool\AVAILABILITY_NONE, getLTIObject(), and ilObject\getOfflineStatus().

Referenced by executeCommand(), and setTabs().

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

◆ launch()

ilObjLTIToolGUI::launch ( )
protected
Exceptions
ilCtrlException
ilObjectException

Definition at line 759 of file class.ilObjLTIToolGUI.php.

759 : void
760 {
761 $this->checkPermission('read');
762 $this->tabs_gui->activateTab(self::TAB_CONTENT);
763 $this->ctrl->forwardCommand(new ilLTIToolLaunchGUI($this->getLTIObject()));
764 }

References ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), and getLTIObject().

Referenced by executeCommand().

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

◆ registerTool()

ilObjLTIToolGUI::registerTool ( )
protected

Registers a tool of the user through LTI Advantage Dynamic Registration: the registration page of the tool opens in an iframe, and the object is created once the tool says it is done.

A tool that does not say so is taken as done when the user says it is.

Exceptions
ilCtrlException
RandomException

Definition at line 441 of file class.ilObjLTIToolGUI.php.

441 : void
442 {
444
445 $this->ctrl->setParameter($this, 'new_type', $this->getType());
446 $form = $this->buildRegistrationForm()->withRequest($this->request);
447 $data = $form->getData();
448 if ($data === null) {
449 $this->renderCreation(null, $form);
450 return;
451 }
452
453 global $DIC;
454
455 try {
456 [$registration, $url] = ilLTIAdvantagePlatformRegistration::start(
457 (string) $data['url'],
458 trim((string) $data['params']),
459 $this->user->getId()
460 );
461 } catch (ilException $e) {
462 $DIC->logger()->forComponent('lti')->error($e->getMessage());
463 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('lti_dyn_reg_failed'));
464 $this->renderCreation(null, $form);
465 return;
466 }
467
468 $DIC->logger()->forComponent('lti')->debug('LTI Advantage Dynamic Registration of the tool at {url} started', ['url' => (string) $data['url']]);
469 $this->ctrl->setParameter($this, self::REGISTRATION_PARAM, $registration);
470 $finish_url = $this->ctrl->getLinkTarget($this, self::CMD_FINISH_REGISTRATION);
471 $this->ctrl->setParameter($this, self::REGISTRATION_PARAM, null);
472
473 $this->tpl->setTitleIcon(ilObject::getIconForType($this->getType()));
474 $this->tpl->setTitle($this->lng->txt('lti_dynamic_registration'));
475 $this->tabs_gui->setBackTarget($this->lng->txt('cancel'), $this->ctrl->getLinkTarget($this, 'create'));
476 $this->tpl->addOnLoadCode(
477 'window.addEventListener("message", function (event) {'
478 . 'var frame = document.getElementById("' . self::REGISTRATION_FRAME_ID . '");'
479 . 'if (frame && event.source === frame.contentWindow && event.data'
480 . ' && event.data.subject === "org.imsglobal.lti.close") {'
481 . 'window.location.assign(' . json_encode($finish_url, JSON_UNESCAPED_SLASHES) . ');'
482 . '}});'
483 );
484 global $DIC;
485 $this->tpl->setContent($this->ui_renderer->render([
486 $this->ui_factory->messageBox()->info($this->lng->txt('lti_dyn_reg_running'))->withButtons([
487 $this->ui_factory->button()->standard($this->lng->txt('lti_dyn_reg_finish'), $finish_url),
488 ]),
490 self::REGISTRATION_FRAME_ID,
491 $url,
492 $this->lng->txt('lti_dynamic_registration'),
493 600,
494 $DIC
495 ),
496 ]));
497 }
Base class for ILIAS Exception handling.
static buildIframe(string $id, string $url, string $title, int $height, Container $dic)
An iframe of a page of the other side of LTI Advantage, which the page around it tells apart by its i...
static start(string $tool_url, string $custom_params, int $user_id)
Starts a registration of the user.
static getIconForType(string $type)

References ilObjectGUI\$data, $DIC, Vendor\Package\$e, assertOwnToolCreationAccess(), ilLTIAdvantagePlatformLaunchRenderer\buildIframe(), buildRegistrationForm(), ILIAS\Repository\ctrl(), ilObject\getIconForType(), getType(), ILIAS\Repository\lng(), renderCreation(), ilLTIAdvantagePlatformRegistration\start(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ renderCreation()

ilObjLTIToolGUI::renderCreation ( ?Form  $own_form = null,
?Form  $registration_form = null 
)
private

The ways of creating an object, one section each, with the first one open.

The section of an own tool opens instead once it has been used, that is when its form comes back with errors or when the LTI version has been switched.

Exceptions
ilCtrlException

Definition at line 352 of file class.ilObjLTIToolGUI.php.

352 : void
353 {
354 $this->ctrl->saveParameter($this, 'crtptrefid');
355 $this->ctrl->saveParameter($this, 'crtcb');
356 $this->ctrl->setParameter($this, 'new_type', $this->getType());
357 $this->tpl->setTitleIcon(ilObject::getIconForType($this->getType()));
358 $this->tpl->setTitle($this->lng->txt('obj_' . $this->getType()));
359 $this->tabs_gui->setBackTarget($this->lng->txt('cancel'), $this->ctrl->getLinkTargetByClass(static::class, 'cancel'));
360 $this->tpl->addCss('./assets/css/lti_creation.css');
361
362 $accordion = new ilAccordionGUI();
363 $accordion->setBehaviour(ilAccordionGUI::FIRST_OPEN);
364 $accordion->setContentClass('il-lti-creation');
365 // the section a user works in stays open, which is also what lets a section be forced open
366 $accordion->setId('lti_create');
367 $accordion->setUseSessionStorage(true);
368 $accordion->addItem(
369 $this->lng->txt($this->getType() . '_select_provider'),
370 $this->ui_renderer->render($this->buildToolSelection())
371 );
372
374 $accordion->addItem(
375 $this->lng->txt('lti_dynamic_registration'),
376 $this->ui_renderer->render($registration_form ?? $this->buildRegistrationForm()),
377 $registration_form !== null
378 );
379 $accordion->addItem(
380 $this->lng->txt('lti_custom_new'),
381 $this->ui_renderer->render($this->buildOwnTool($own_form)),
382 $own_form !== null || $this->request_wrapper->has(self::VERSION_PARAM)
383 );
384 }
385
386 $this->tpl->setContent($accordion->getHTML());
387 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ilAccordionGUI\FIRST_OPEN, ilObject\getIconForType(), getType(), ilObjLTIAdministrationAccess\hasOwnToolCreationAccess(), and ILIAS\Repository\lng().

Referenced by create(), finishRegistration(), registerTool(), and saveOwnTool().

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

◆ save()

ilObjLTIToolGUI::save ( )

Creates the object for the tool of the request.

Exceptions
ilCtrlException
ilMDServicesException

Reimplemented from ilObject2GUI.

Definition at line 395 of file class.ilObjLTIToolGUI.php.

395 : void
396 {
397 if (!$this->checkPermissionBool('create', '', $this->getType())) {
398 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->MESSAGE);
399 }
400
401 $tool = new ilLTITool($this->getToolIdParameter());
402 if (!$tool->isSelectableBy($this->user->getId())) {
403 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('lti_no_provider_selected'));
404 $this->create();
405 return;
406 }
407
408 $this->createOrSelectContent($tool);
409 }
An external tool ILIAS can launch, stored in lti_ext_provider.

References ilObject2GUI\checkPermissionBool(), create(), createOrSelectContent(), getToolIdParameter(), getType(), and ILIAS\Repository\lng().

Referenced by executeCommand().

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

◆ saveOwnTool()

ilObjLTIToolGUI::saveOwnTool ( )
protected

Stores a tool of the user and creates the object for it.

Exceptions
ilCtrlException
ilMDServicesException

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

417 : void
418 {
420
421 $this->ctrl->setParameter($this, 'new_type', $this->getType());
422 $form = $this->buildOwnToolForm();
423 $with_errors = $form->save($this->getOwnToolAction(), $this->request, true);
424
425 if ($with_errors !== null) {
426 $this->renderCreation($with_errors);
427 return;
428 }
429
430 $this->createOrSelectContent(new ilLTITool($form->getSavedId()));
431 }

References assertOwnToolCreationAccess(), buildOwnToolForm(), createOrSelectContent(), ILIAS\Repository\ctrl(), getOwnToolAction(), getType(), and renderCreation().

Referenced by executeCommand().

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

◆ selectContent()

ilObjLTIToolGUI::selectContent ( )
protected

Picks the content of new objects in a tool that offers Deep Linking, from an object of the tool: the objects are created next to it, as earlier releases did.

Exceptions
ilCtrlException
RandomException

Definition at line 536 of file class.ilObjLTIToolGUI.php.

536 : void
537 {
538 $this->assertCreationAccess();
539
540 $tool = new ilLTITool($this->getToolIdParameter());
541 if (!$tool->isSelectableBy($this->user->getId()) || !$tool->offersDeepLinking()) {
542 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
543 }
544
545 $this->showDeepLinking($tool);
546 }

References assertCreationAccess(), getToolIdParameter(), ILIAS\Repository\lng(), and showDeepLinking().

Referenced by executeCommand().

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

◆ setTabs()

ilObjLTIToolGUI::setTabs ( )
protected
Exceptions
ilCtrlException
ilObjectException

Reimplemented from ilObject2GUI.

Definition at line 226 of file class.ilObjLTIToolGUI.php.

226 : void
227 {
228 if (!$this->object instanceof ilObjLTITool) {
229 parent::setTabs();
230 return;
231 }
232
233 if ($this->checkPermissionBool('read') && $this->isContentAvailable()) {
234 $this->tabs_gui->addTab(
235 self::TAB_CONTENT,
236 $this->lng->txt(self::TAB_CONTENT),
237 $this->ctrl->getLinkTarget($this, self::CMD_LAUNCH)
238 );
239 }
240
241 $this->tabs_gui->addTab(
242 self::TAB_INFO,
243 $this->lng->txt(self::TAB_INFO),
244 $this->ctrl->getLinkTargetByClass(ilInfoScreenGUI::class, 'showSummary')
245 );
246
247 if ($this->checkPermissionBool('write')) {
248 $this->tabs_gui->addTab(
249 self::TAB_SETTINGS,
250 $this->lng->txt(self::TAB_SETTINGS),
251 $this->ctrl->getLinkTargetByClass(ilLTIObjectSettingsGUI::class, ilLTIObjectSettingsGUI::CMD_SHOW)
252 );
253 }
254
255 $this->addReportTabs();
256
257 if ($this->checkPermissionBool('write')) {
258 $metadata_link = new ilObjectMetaDataGUI($this->object)->getTab();
259 if ($metadata_link !== null && $metadata_link !== '') {
260 $this->tabs_gui->addTab(self::TAB_METADATA, $this->lng->txt(self::TAB_METADATA), $metadata_link);
261 }
262 }
263
264 parent::setTabs();
265 }
addReportTabs()
The reports on what users did in the tool, each one only where the tool provides its data.
getTab(?string $base_class=null)
Get tab link if available.

References addReportTabs(), ilObject2GUI\checkPermissionBool(), ilLTIObjectSettingsGUI\CMD_SHOW, ilObjectMetaDataGUI\getTab(), isContentAvailable(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showDeepLinking()

ilObjLTIToolGUI::showDeepLinking ( ilLTITool  $tool,
string  $custom_params = '' 
)
private

The iframe the tool shows its content in for the user to pick.

Exceptions
ilCtrlException
RandomException

Definition at line 554 of file class.ilObjLTIToolGUI.php.

554 : void
555 {
556 global $DIC;
557
558 $this->ctrl->setParameter($this, 'new_type', $this->getType());
559 $this->ctrl->setParameter($this, 'tool_id', null);
560 $this->ctrl->setParameter(
561 $this,
562 self::DEEP_LINKING_PARAM,
563 ilLTIAdvantagePlatformDeepLinking::start($tool, $this->getContainerRefId(), $this->user->getId(), $custom_params)
564 );
565 $frame_url = $this->ctrl->getLinkTarget($this, self::CMD_START_DEEP_LINKING);
566 $this->ctrl->setParameter($this, self::DEEP_LINKING_PARAM, null);
567
568 $origin_ref_id = $this->getOriginRefId();
569 $cancel_url = $origin_ref_id > 0
570 ? $this->getStaticLink($origin_ref_id)
571 : $this->ctrl->getLinkTarget($this, 'create');
572
573 $this->tpl->setTitleIcon(ilObject::getIconForType($this->getType()));
574 $this->tpl->setTitle($tool->getTitle());
575 $this->tabs_gui->setBackTarget($this->lng->txt('cancel'), $cancel_url);
576 $this->tpl->setContent($this->ui_renderer->render([
577 $this->ui_factory->messageBox()->info($this->lng->txt('lti_deep_linking_running')),
579 ]));
580 }
static start(ilLTITool $tool, int $ref_id, int $user_id, string $custom_params='')
Keeps a new request for the user and the container the objects are created in.
static buildFrame(string $url, string $title, int $height, Container $dic)
The iframe a tool opens in, with the platform storage of LTI for it.
getOriginRefId()
The object whose tool settings the content is picked from, 0 on the creation screen.

References $DIC, ilLTIAdvantagePlatformLaunchRenderer\buildFrame(), ILIAS\Repository\ctrl(), getContainerRefId(), ilObject\getIconForType(), getOriginRefId(), getStaticLink(), ilLTITool\getTitle(), getType(), ILIAS\Repository\lng(), ilLTIAdvantagePlatformDeepLinking\start(), and ILIAS\Repository\user().

Referenced by createOrSelectContent(), and selectContent().

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

◆ startDeepLinking()

ilObjLTIToolGUI::startDeepLinking ( )
protected

Content of the iframe: starts the Deep Linking request at the tool.

Exceptions
ilCtrlException
RandomException
ResponseSendingException

Definition at line 589 of file class.ilObjLTIToolGUI.php.

589 : never
590 {
591 global $DIC;
592
593 $this->assertCreationAccess();
594
595 $state = $this->getDeepLinkingState();
596 $this->ctrl->setParameter($this, 'new_type', $this->getType());
597 $this->ctrl->setParameter($this, self::DEEP_LINKING_PARAM, $state);
598 $return_url = ilLTIEndpoint::getBaseUrl() . '/'
599 . $this->ctrl->getLinkTarget($this, self::CMD_FINISH_DEEP_LINKING);
600
602 $state,
603 $this->user->getId(),
604 $this->getContainerRefId(),
605 $return_url,
606 $DIC
607 );
608 }
static sendRequestPage(string $state, int $user_id, int $ref_id, string $return_url, Container $dic)
Sends the page that starts the request at the tool and ends the request of ILIAS.
static getBaseUrl()
The base URL of the installation as the request reached it.

References $DIC, assertCreationAccess(), ILIAS\Repository\ctrl(), ilLTIEndpoint\getBaseUrl(), getDeepLinkingState(), getType(), ilLTIAdvantagePlatformDeepLinking\sendRequestPage(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ trackReadEvent()

ilObjLTIToolGUI::trackReadEvent ( )
private

Opening an object counts as reading it, which the learning progress takes into account.

Definition at line 315 of file class.ilObjLTIToolGUI.php.

315 : void
316 {
317 if ($this->creation_mode || !$this->object instanceof ilObjLTITool) {
318 return;
319 }
320
322 $this->object->getType(),
323 $this->object->getRefId(),
324 $this->object->getId(),
325 $this->user->getId()
326 );
327 ilLPStatusWrapper::_updateStatus($this->object->getId(), $this->user->getId());
328 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $a_ext_rc=null, $a_ext_time=null)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)

References ilChangeEvent\_recordReadEvent(), ilLPStatusWrapper\_updateStatus(), and ILIAS\Repository\object().

Referenced by executeCommand().

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

Field Documentation

◆ CMD_DELIVER_CERTIFICATE

const string ilObjLTIToolGUI::CMD_DELIVER_CERTIFICATE = 'deliverCertificate'

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

Referenced by ilObjLTIToolListGUI\getProperties().

◆ CMD_FINISH_DEEP_LINKING

const string ilObjLTIToolGUI::CMD_FINISH_DEEP_LINKING = 'finishDeepLinking'
private

Definition at line 58 of file class.ilObjLTIToolGUI.php.

◆ CMD_FINISH_REGISTRATION

const string ilObjLTIToolGUI::CMD_FINISH_REGISTRATION = 'finishRegistration'
private

Definition at line 54 of file class.ilObjLTIToolGUI.php.

◆ CMD_LAUNCH

const string ilObjLTIToolGUI::CMD_LAUNCH = 'launch'

Definition at line 47 of file class.ilObjLTIToolGUI.php.

Referenced by ilObjLTIToolAccess\_getCommands().

◆ CMD_REGISTER_TOOL

const string ilObjLTIToolGUI::CMD_REGISTER_TOOL = 'registerTool'
private

Definition at line 53 of file class.ilObjLTIToolGUI.php.

◆ CMD_SAVE_OWN_TOOL

const string ilObjLTIToolGUI::CMD_SAVE_OWN_TOOL = 'saveOwnTool'
private

Definition at line 52 of file class.ilObjLTIToolGUI.php.

◆ CMD_SELECT_CONTENT

const string ilObjLTIToolGUI::CMD_SELECT_CONTENT = 'selectContent'

◆ CMD_START_DEEP_LINKING

const string ilObjLTIToolGUI::CMD_START_DEEP_LINKING = 'startDeepLinking'
private

Definition at line 57 of file class.ilObjLTIToolGUI.php.

◆ DEEP_LINKING_PARAM

const string ilObjLTIToolGUI::DEEP_LINKING_PARAM = 'deep_linking'
private

Definition at line 59 of file class.ilObjLTIToolGUI.php.

◆ ORIGIN_PARAM

const string ilObjLTIToolGUI::ORIGIN_PARAM = 'origin_ref_id'

◆ REGISTRATION_FRAME_ID

const string ilObjLTIToolGUI::REGISTRATION_FRAME_ID = 'il_lti_registration_frame'
private

Definition at line 56 of file class.ilObjLTIToolGUI.php.

◆ REGISTRATION_PARAM

const string ilObjLTIToolGUI::REGISTRATION_PARAM = 'registration'
private

Definition at line 55 of file class.ilObjLTIToolGUI.php.

◆ TAB_CONTENT

const string ilObjLTIToolGUI::TAB_CONTENT = 'tab_content'
private

Definition at line 61 of file class.ilObjLTIToolGUI.php.

◆ TAB_GRADEBOOK

const string ilObjLTIToolGUI::TAB_GRADEBOOK = 'tab_grade_synchronization'
private

Definition at line 66 of file class.ilObjLTIToolGUI.php.

◆ TAB_INFO

const string ilObjLTIToolGUI::TAB_INFO = 'tab_info'
private

Definition at line 62 of file class.ilObjLTIToolGUI.php.

◆ TAB_LEARNING_PROGRESS

const string ilObjLTIToolGUI::TAB_LEARNING_PROGRESS = 'learning_progress'
private

Definition at line 67 of file class.ilObjLTIToolGUI.php.

◆ TAB_METADATA

const string ilObjLTIToolGUI::TAB_METADATA = 'meta_data'
private

Definition at line 68 of file class.ilObjLTIToolGUI.php.

◆ TAB_PERMISSIONS

const string ilObjLTIToolGUI::TAB_PERMISSIONS = 'id_permissions'
private

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

◆ TAB_RANKING

const string ilObjLTIToolGUI::TAB_RANKING = 'tab_scoring'
private

Definition at line 65 of file class.ilObjLTIToolGUI.php.

◆ TAB_SETTINGS

const string ilObjLTIToolGUI::TAB_SETTINGS = 'tab_settings'
private

Definition at line 63 of file class.ilObjLTIToolGUI.php.

◆ TAB_STATEMENTS

const string ilObjLTIToolGUI::TAB_STATEMENTS = 'tab_statements'
private

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

◆ VERSION_PARAM

const string ilObjLTIToolGUI::VERSION_PARAM = 'version'
private

Definition at line 60 of file class.ilObjLTIToolGUI.php.


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