|
| __construct (int $a_ref_id) |
| ilObjLTIConsumerLaunch constructor. More...
|
|
| getContext (?array $a_valid_types=array('crs', 'grp', 'cat', 'root')) |
| get info about the context in which the link is used The most outer matching course or group is used If not found the most inner category or root node is used More...
|
|
◆ __construct()
ilLTIConsumerLaunch::__construct |
( |
int |
$a_ref_id | ) |
|
◆ getContext()
ilLTIConsumerLaunch::getContext |
( |
?array |
$a_valid_types = array('crs', 'grp', 'cat', 'root') | ) |
|
get info about the context in which the link is used The most outer matching course or group is used If not found the most inner category or root node is used
- Parameters
-
array | null | $a_valid_types | list of valid types |
- Returns
- array|null context array ("ref_id", "title", "type")
Definition at line 52 of file class.ilLTIConsumerLaunch.php.
References $context, $DIC, and $path.
Referenced by ilLTIConsumerContentGUI\getLaunchParameters(), and ilLTIConsumerContentGUI\getLaunchParametersLTI13().
55 $tree = $DIC->repositoryTree();
57 if (!isset($this->context)) {
58 $this->context = array();
61 $path = array_reverse($tree->getPathFull($this->ref_id));
62 foreach (
$path as $row) {
63 if (in_array($row[
'type'], $a_valid_types)) {
65 if (in_array($row[
'type'], array(
'cat',
'root')) && !empty($this->context)) {
69 $this->context[
'id'] = $row[
'child'];
70 $this->context[
'title'] = $row[
'title'];
71 $this->context[
'type'] = $row[
'type'];
◆ getLTIContextType()
static ilLTIConsumerLaunch::getLTIContextType |
( |
string |
$a_type | ) |
|
|
static |
◆ signOAuth()
static ilLTIConsumerLaunch::signOAuth |
( |
array |
$a_params | ) |
|
|
static |
sign request data with OAuth
- Parameters
-
array | ( "method => signature methos
"key" => consumer key
"secret" => shared secret
"token" => request token
"url" => request url data => array (key => value) ) |
- Returns
- array|string signed data
Definition at line 113 of file class.ilLTIConsumerLaunch.php.
Referenced by ilObjLTIConsumer\buildLaunchParameters().
115 switch ($a_params[
'sign_method']) {
120 $method =
new ILIAS\LTIOAuth\OAuthSignatureMethod_PLAINTEXT();
127 return "ERROR: unsupported signature method!";
129 $consumer =
new ILIAS\LTIOAuth\OAuthConsumer($a_params[
"key"], $a_params[
"secret"], $a_params[
"callback"]);
130 $request = ILIAS\LTIOAuth\OAuthRequest::from_consumer_and_token($consumer, $a_params[
"token"], $a_params[
"http_method"], $a_params[
"url"], $a_params[
"data"]);
131 $request->sign_request($method, $consumer, $a_params[
"token"]);
137 return $request->get_parameters();
OAuth PECL extension includes an OAuth Exception class, so we need to wrap the definition of this cla...
◆ $context
array ilLTIConsumerLaunch::$context = null |
|
private |
◆ $ref_id
int ilLTIConsumerLaunch::$ref_id |
|
protected |
The documentation for this class was generated from the following file: