| 
|   | __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 54 of file class.ilLTIConsumerLaunch.php.
References $context, $DIC, and $path.
Referenced by ilLTIConsumerContentGUI\getLaunchParameters(), and ilLTIConsumerContentGUI\getLaunchParametersLTI13().
   57         $tree = $DIC->repositoryTree();
    59         if (!isset($this->context)) {
    60             $this->context = array();
    63             $path = array_reverse($tree->getPathFull($this->ref_id));
    64             foreach (
$path as $row) {
    65                 if (in_array($row[
'type'], $a_valid_types)) {
    67                     if (in_array($row[
'type'], array(
'cat', 
'root')) && !empty($this->context)) {
    71                     $this->context[
'id'] = $row[
'child'];
    72                     $this->context[
'title'] = $row[
'title'];
    73                     $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 | $a_params | ( "method => signature methos
                   "key" => consumer key
                   "secret" => shared secret
                   "token"    => request token
                   "url" => request url data => array (key => value) ) | 
  
   
- Returns
 - array signed data 
 
- Exceptions
 - 
  
  
 
Definition at line 115 of file class.ilLTIConsumerLaunch.php.
Referenced by ilObjLTIConsumer\buildLaunchParameters().
  117         switch ($a_params[
'sign_method']) {
   119                 $method = 
new OAuthSignatureMethod_HMAC_SHA1();
   122                 throw new Exception(
"Unknown signature method: " . $a_params[
'sign_method']);
   125         $consumer = 
new OAuthConsumer($a_params[
"key"], $a_params[
"secret"], $a_params[
"callback"]);
   126         $request = OAuthRequest::from_consumer_and_token($consumer, $a_params[
"token"], $a_params[
"http_method"], $a_params[
"url"], $a_params[
"data"]);
   127         $request->sign_request($method, $consumer, $a_params[
"token"]);
   133         return $request->get_parameters();
 
 
 
 
◆ $context
  
  
      
        
          | array ilLTIConsumerLaunch::$context = null | 
         
       
   | 
  
private   | 
  
 
 
◆ $ref_id
  
  
      
        
          | int ilLTIConsumerLaunch::$ref_id | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: