|
| __construct (int $a_ref_id) |
| ilObjLTIConsumerLaunch constructor. More...
|
|
| getContext ($a_valid_types=array('crs', 'grp', 'cat', 'root')) |
| get info about the context in which the link is used More...
|
|
◆ __construct()
ilLTIConsumerLaunch::__construct |
( |
int |
$a_ref_id | ) |
|
ilObjLTIConsumerLaunch constructor.
- Parameters
-
int | $a_id | |
bool | $a_reference | |
Definition at line 25 of file class.ilLTIConsumerLaunch.php.
27 $this->ref_id = $a_ref_id;
◆ getContext()
ilLTIConsumerLaunch::getContext |
( |
|
$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
-
- Returns
- array context array ("ref_id", "title", "type")
Definition at line 39 of file class.ilLTIConsumerLaunch.php.
References $context, and $DIC.
Referenced by ilLTIConsumerContentGUI\getLaunchParameters().
42 $tree = $DIC->repositoryTree();
44 if (!isset($this->context)) {
45 $this->context = array();
48 $path = array_reverse(
$tree->getPathFull($this->ref_id));
49 foreach ($path as $key => $row) {
50 if (in_array($row[
'type'], $a_valid_types)) {
52 if (in_array($row[
'type'], array(
'cat',
'root')) && !empty($this->context)) {
56 $this->context[
'id'] = $row[
'child'];
57 $this->context[
'title'] = $row[
'title'];
58 $this->context[
'type'] = $row[
'type'];
◆ getLTIContextType()
static ilLTIConsumerLaunch::getLTIContextType |
( |
|
$a_type | ) |
|
|
static |
◆ signOAuth()
static ilLTIConsumerLaunch::signOAuth |
( |
|
$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 signed data
Definition at line 104 of file class.ilLTIConsumerLaunch.php.
References OAuthRequest\from_consumer_and_token().
Referenced by ilObjLTIConsumer\buildLaunchParameters().
106 require_once(
'./Modules/LTIConsumer/lib/OAuth.php');
107 switch ($a_params[
'sign_method']) {
119 return "ERROR: unsupported signature method!";
122 $consumer =
new OAuthConsumer($a_params[
"key"], $a_params[
"secret"], $a_params[
"callback"]);
124 $request->sign_request($method, $consumer, $a_params[
"token"]);
127 self::$last_oauth_base_string =
$request->get_signature_base_string();
static from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=null)
pretty much a helper function to set up the request
◆ $last_oauth_base_string
ilLTIConsumerLaunch::$last_oauth_base_string = "" |
|
staticprivate |
◆ $ref_id
ilLTIConsumerLaunch::$ref_id |
|
protected |
The documentation for this class was generated from the following file: