Tsugi

Launch
in package

This captures all of the data associated with the LTI Launch.

Table of Contents

Properties

$base_string  : mixed
Get the base string from the launch.
$context  : mixed
Get the Context associated with the launch.
$current_url  : mixed
Must be a string that is the current called URL.
$deeplink  : mixed
The deeplink url, if any
$error_message  : mixed
Get the error message if something went wrong with the setup (TBD)
$for_user  : mixed
Get the "For User" associated with the launch.
$key  : mixed
Get the User associated with the launch.
$link  : mixed
Get the Link associated with the launch.
$membership  : mixed
Get the launching user's Membership in the current context, when known.
$output  : mixed
Return the output helper class.
$pdox  : mixed
Return the PDOX connection used by Tsugi.
$profile  : mixed
Site profile for the launching user (always set after buildLaunch()).
$redirect_url  : mixed
If this is non-null when we return, the caller must redirect to a GET of the same URL.
$request_parms  : mixed
Must be an array equivalent to $_REQUEST. If this is present We do not assume access to $_POST or $_GET and we assume that we cannot use header() so the caller must
$result  : mixed
Get the Result associated with the launch.
$user  : mixed
Get the User associated with the launch.

Methods

documentTarget()  : string|null
Return the document target The value for this property MUST be one of: frame, iframe, or window.
errorReturnUrl()  : string|null
Return the error return URL for redirecting the user on error.
isCanvas()  : bool
Indicate if this launch came from Canvas
isCoursera()  : bool
Indicate if this launch came from Coursera
isLTI13()  : bool
Return whether this is an LTI 1.3 launch or not
isLTIAdvantage()  : bool
Return a boolean indicating if this is an LTI Advantage launch
isMoodle()  : bool
Indicate if this launch came from Moodle
isSakai()  : bool
Indicate if this launch came from Sakai
ltiCustomGet()  : mixed
Pull out a custom variable from the LTIX session.
ltiJWTClaim()  : mixed
Pull a claim from the body of the Launch JWT
ltiMessageType()  : string
Return the LTI 1.3 Message Type with Reasonable Fall Backs
ltiParameter()  : mixed
Pull a keyed variable from the LTI data in the current session with default
ltiParameterArray()  : array<string|int, mixed>|false
Pull a keyed variable from the LTI data in the current session with default
ltiParameterUpdate()  : void
Update a keyed variable from the LTI data in the current session with default
ltiRawJWT()  : object|null
Return the original JWT (JSON Web Token) from the launch
ltiRawParameter()  : mixed
Pull a keyed variable from the original LTI post data in the current session with default
ltiRawPostArray()  : array<string|int, mixed>|false
Return the original $_POST array
newLaunch()  : array<string|int, mixed>
Set up parameters for an outbound launch from this launch
returnUrl()  : string|null
Return the return URL
settingsCascade()  : mixed
Check for a setting starting nearby
var_dump()  : void
Dump out the internal data structures associated with the current launch. Best if used within a pre tag.

Properties

$base_string

Get the base string from the launch.

public mixed $base_string = null

This is null if it is not the original launch. it is not restored when the launch is restored from the session.

$context

Get the Context associated with the launch.

public mixed $context

$current_url

Must be a string that is the current called URL.

public mixed $current_url = null

Required if request_parms is provided.

The deeplink url, if any

public mixed $deeplink = null

$error_message

Get the error message if something went wrong with the setup (TBD)

public mixed $error_message = null

$for_user

Get the "For User" associated with the launch.

public mixed $for_user

$key

Get the User associated with the launch.

public mixed $key

Get the Link associated with the launch.

public mixed $link

$membership

Get the launching user's Membership in the current context, when known.

public mixed $membership

$output

Return the output helper class.

public mixed $output

$pdox

Return the PDOX connection used by Tsugi.

public mixed $pdox

$profile

Site profile for the launching user (always set after buildLaunch()).

public mixed $profile

When no profile is linked, this is an empty placeholder (id 0, premium 0).

$redirect_url

If this is non-null when we return, the caller must redirect to a GET of the same URL.

public mixed $redirect_url = null

$request_parms

Must be an array equivalent to $_REQUEST. If this is present We do not assume access to $_POST or $_GET and we assume that we cannot use header() so the caller must

public mixed $request_parms = null

$result

Get the Result associated with the launch.

public mixed $result

$user

Get the User associated with the launch.

public mixed $user

Methods

documentTarget()

Return the document target The value for this property MUST be one of: frame, iframe, or window.

public documentTarget() : string|null
Return values
string|null —

The document target value or null if not set

errorReturnUrl()

Return the error return URL for redirecting the user on error.

public errorReturnUrl() : string|null

When the platform provides a separate error_return_url (LTI 1.3), that is returned. Otherwise falls back to returnUrl() since the same URL is used for errors in LTI 1.1.

Return values
string|null —

The error return URL or null if not set

isCanvas()

Indicate if this launch came from Canvas

public isCanvas() : bool
Return values
bool —

True if launch is from Canvas, false otherwise

isCoursera()

Indicate if this launch came from Coursera

public isCoursera() : bool
Return values
bool —

True if launch is from Coursera, false otherwise

isLTI13()

Return whether this is an LTI 1.3 launch or not

public isLTI13() : bool
Return values
bool —

True if this is an LTI 1.3 launch, false otherwise

isLTIAdvantage()

Return a boolean indicating if this is an LTI Advantage launch

public isLTIAdvantage() : bool
Return values
bool —

True if this is an LTI Advantage launch, false otherwise

isMoodle()

Indicate if this launch came from Moodle

public isMoodle() : bool
Return values
bool —

True if launch is from Moodle, false otherwise

isSakai()

Indicate if this launch came from Sakai

public isSakai() : bool
Return values
bool —

True if launch is from Sakai, false otherwise

ltiCustomGet()

Pull out a custom variable from the LTIX session.

public ltiCustomGet(string $varname[, mixed $default = false ]) : mixed

For LTI 1.1, it adds the "custom_" prefix automatically and looks in POST values For LTI Advantage, the data is pulled from the JSON Web Token (JWT)

Parameters
$varname : string

The custom variable name (without 'custom_' prefix)

$default : mixed = false

The default value if variable doesn't exist

Return values
mixed —

The custom variable value or default

ltiJWTClaim()

Pull a claim from the body of the Launch JWT

public ltiJWTClaim(string $claim[, mixed $default = null ]) : mixed
Parameters
$claim : string

The claim name to retrieve

$default : mixed = null

The default value if claim doesn't exist

Return values
mixed —

The claim value or default

ltiMessageType()

Return the LTI 1.3 Message Type with Reasonable Fall Backs

public ltiMessageType() : string
Return values
string —

The message type (e.g., 'LtiResourceLinkRequest')

ltiParameter()

Pull a keyed variable from the LTI data in the current session with default

public ltiParameter(string $varname[, mixed $default = false ]) : mixed
Parameters
$varname : string

The LTI parameter name

$default : mixed = false

The default value if parameter doesn't exist

Return values
mixed —

The parameter value or default

ltiParameterArray()

Pull a keyed variable from the LTI data in the current session with default

public ltiParameterArray() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false —

The LTI parameter array or false if not available

ltiParameterUpdate()

Update a keyed variable from the LTI data in the current session with default

public ltiParameterUpdate(string $varname, mixed $value) : void
Parameters
$varname : string

The LTI parameter name to update

$value : mixed

The value to set

ltiRawJWT()

Return the original JWT (JSON Web Token) from the launch

public ltiRawJWT() : object|null
Return values
object|null —

The JWT object or null if not available

ltiRawParameter()

Pull a keyed variable from the original LTI post data in the current session with default

public ltiRawParameter(string $varname[, mixed $default = false ]) : mixed
Parameters
$varname : string

The parameter name from the original POST

$default : mixed = false

The default value if parameter doesn't exist

Return values
mixed —

The parameter value or default

ltiRawPostArray()

Return the original $_POST array

public ltiRawPostArray() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false —

The original LTI POST array or false if not available

newLaunch()

Set up parameters for an outbound launch from this launch

public newLaunch([bool $send_name = true ][, bool $send_email = true ]) : array<string|int, mixed>
Parameters
$send_name : bool = true

Whether to include user name in launch parameters

$send_email : bool = true

Whether to include user email in launch parameters

Return values
array<string|int, mixed> —

Associative array of LTI launch parameters

returnUrl()

Return the return URL

public returnUrl() : string|null
Return values
string|null —

The return URL or null if not set

settingsCascade()

Check for a setting starting nearby

public settingsCascade(string $key[, mixed $retval = null ]) : mixed

This routine looks for a key based on the following low-to-high precedence:

(4) From a Key Setting (3) From a Context Setting (2) From a Link Setting (1) From a custom launch variable prefixed by "tsugi_setting"

Parameters
$key : string

The setting key to look up

$retval : mixed = null

The default value if setting is not found

Return values
mixed —

The setting value or default

var_dump()

Dump out the internal data structures associated with the current launch. Best if used within a pre tag.

public var_dump() : void

        
On this page

Search results