class Launch

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

Properties

$key Get the User associated with the launch.
$user Get the User associated with the launch.
$for_user Get the "For User" associated with the launch.
$context Get the Context associated with the launch.
$link Get the Link associated with the launch.
$result Get the Result associated with the launch.
$pdox Return the PDOX connection used by Tsugi.
$output Return the output helper class.
$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
$current_url Must be a string that is the current called URL.
$session_object If present, it means all session management is above us.
$redirect_url If this is non-null when we return, the caller must redirect to a GET of the same URL.
$base_string Get the base string from the launch.
$error_message Get the error message if something went wrong with the setup (TBD)
$deeplink The deeplink url, if any

Methods

session_get($key, $default = null)

Get a key from the session

session_put($key, $value)

Set a key in the session

session_forget($key)

Forget a key in the session

session_flush()

Flush the session

ltiParameterArray()

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

ltiParameter($varname, $default = false)

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

ltiParameterUpdate($varname, $value)

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

ltiRawPostArray()

Return the original $_POST array

ltiRawJWT()

Return the original JWT

ltiRawParameter($varname, $default = false)

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

ltiJWTClaim($claim, $default = null)

Pull a claim from the body of the Launch JWT

isLTI13()

Return whether this is an LTI13 launch or not

ltiMessageType()

Return the LTI 1.3 Message Type with Reasonable Fall Backs

ltiCustomGet($varname, $default = false)

Pull out a custom variable from the LTIX session.

settingsCascade($key, $retval = null)

Check for a setting starting nearby

isSakai()

Indicate if this launch came from Sakai

isCanvas()

Indicate if this launch came from Canvas

isMoodle()

Indicate if this launch came from Moodle

isCoursera()

Indicate if this launch came from Coursera

documentTarget()

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

returnUrl()

Return the return Url

isLTIAdvantage()

Return a boolean is this is an LTI Advantage launch

newLaunch($send_name = true, $send_email = true)

set up parameters for an outbound launch from this launch

var_dump()

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

Details

at line 110
session_get($key, $default = null)

Get a key from the session

Parameters

$key
$default

at line 117
session_put($key, $value)

Set a key in the session

Parameters

$key
$value

at line 124
session_forget($key)

Forget a key in the session

Parameters

$key

at line 131
session_flush()

Flush the session

at line 138
ltiParameterArray()

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

at line 146
ltiParameter($varname, $default = false)

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

Parameters

$varname
$default

at line 156
ltiParameterUpdate($varname, $value)

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

Parameters

$varname
$value

at line 166
ltiRawPostArray()

Return the original $_POST array

at line 174
ltiRawJWT()

Return the original JWT

at line 182
ltiRawParameter($varname, $default = false)

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

Parameters

$varname
$default

at line 192
ltiJWTClaim($claim, $default = null)

Pull a claim from the body of the Launch JWT

Parameters

$claim
$default

at line 203
isLTI13()

Return whether this is an LTI13 launch or not

at line 211
ltiMessageType()

Return the LTI 1.3 Message Type with Reasonable Fall Backs

at line 228
ltiCustomGet($varname, $default = false)

Pull out a custom variable from the LTIX session.

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

Parameters

$varname
$default

at line 249
settingsCascade($key, $retval = null)

Check for a setting starting nearby

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
$retval

at line 277
isSakai()

Indicate if this launch came from Sakai

if ( $LTI->isSakai() ) echo("SAKAI");

at line 296
isCanvas()

Indicate if this launch came from Canvas

if ( $LTI->isCanvas() ) echo("CANVAS");

at line 314
isMoodle()

Indicate if this launch came from Moodle

if ( $LTI->isMoodle() ) echo("MOODLE");

at line 333
isCoursera()

Indicate if this launch came from Coursera

if ( $LTI->isCoursera() ) echo("Coursera");

at line 352
documentTarget()

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

at line 369
returnUrl()

Return the return Url

at line 386
isLTIAdvantage()

Return a boolean is this is an LTI Advantage launch

at line 393
newLaunch($send_name = true, $send_email = true)

set up parameters for an outbound launch from this launch

Parameters

$send_name
$send_email

at line 435
var_dump()

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