◆ __construct()
◆ executeCommand()
      
        
          | ilLTIConsumerContentGUI::executeCommand  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ getEmbeddedAutoStartFormular()
  
  
      
        
          | ilLTIConsumerContentGUI::getEmbeddedAutoStartFormular  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 268 of file class.ilLTIConsumerContentGUI.php.
References $context, $ltiMessageHint, CLIENT_ID, ilObjLTIConsumer\getIliasHttpPath(), initCmixUser(), ILIAS\Repository\object(), and ilSession\set().
Referenced by showEmbedded().
  271         $user_ident = $this->cmixUser->getUsrIdent();
   273         $context = $ilLTIConsumerLaunch->getContext();
   274         $contextType = $ilLTIConsumerLaunch::getLTIContextType($context[
"type"]);
   275         $contextId = $context[
"id"];
   276         $contextTitle = $context[
"title"];
   282         $output = 
'<form id="lti_launch_form" name="lti_launch_form" action="' . $this->
object->getProvider()->getInitiateLogin() . 
'" method="post" target="' . $target . 
'" encType="application/x-www-form-urlencoded">';
   284         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'target_link_uri', $this->
object->getProvider()->getProviderUrl()) . 
"\n";
   285         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'login_hint', $user_ident) . 
"\n";
   286         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'lti_message_hint', 
$ltiMessageHint) . 
"\n";
   287         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'client_id', $this->
object->getProvider()->getClientId()) . 
"\n";
   288         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'lti_deployment_id', $this->
object->getProvider()->getId()) . 
"\n";
   289         $output .= 
'</form>';
   291         $output .= 
"<script type=\"text/javascript\">\n" .
   293                 "document.lti_launch_form.submit();\n" .
 
static getIliasHttpPath()
 
static set(string $a_var, $a_val)
Set a value. 
 
 
 
 
◆ getLaunchParameters()
  
  
      
        
          | ilLTIConsumerContentGUI::getLaunchParameters  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 336 of file class.ilLTIConsumerContentGUI.php.
References $token, ilCmiXapiAuthToken\fillToken(), ilLTIConsumerLaunch\getContext(), ilLTIConsumerLaunch\getLTIContextType(), and ILIAS\Repository\object().
Referenced by showEmbedded().
  339         $launchContext = $ilLTIConsumerLaunch->
getContext();
   342         $launchContextId = $launchContext[
"id"];
   343         $launchContextTitle = $launchContext[
"title"];
   346             $this->dic->user()->getId(),
   347             $this->
object->getRefId(),
   348             $this->
object->getId()
   351         return $this->
object->buildLaunchParameters(
 
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 ...
 
static fillToken(int $usrId, int $refId, int $objId, int $lrsTypeId=0)
 
static getLTIContextType(string $a_type)
 
 
 
 
◆ getLaunchParametersLTI13()
  
  
      
        
          | ilLTIConsumerContentGUI::getLaunchParametersLTI13  | 
          ( | 
          string  | 
          $endpoint,  | 
         
        
           | 
           | 
          string  | 
          $clientId,  | 
         
        
           | 
           | 
          int  | 
          $deploymentId,  | 
         
        
           | 
           | 
          string  | 
          $nonce  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
 
◆ getLoginLTI13Form()
  
  
      
        
          | ilLTIConsumerContentGUI::getLoginLTI13Form  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 118 of file class.ilLTIConsumerContentGUI.php.
References ILIAS\LTI\ToolProvider\$key, $params, $r, ilSession\clear(), ilSession\get(), getLaunchParametersLTI13(), initCmixUser(), ILIAS\Repository\object(), and validateLTI13InitalLogin().
Referenced by launch().
  128             if (isset($loginData[
'state'])) {
   129                 $params[
'state'] = $loginData[
'state'];
   132             $r = 
'<form action="' . $loginData[
'redirect_uri'] . 
"\" name=\"ltiAuthForm\" id=\"ltiAuthForm\" " .
   133                 "method=\"post\" enctype=\"application/x-www-form-urlencoded\">\n";
   137                     $value = htmlspecialchars($value);
   138                     $r .= 
"  <input type=\"hidden\" name=\"{$key}\" value=\"{$value}\"/>\n";
   142             $r .= 
"<script type=\"text/javascript\">\n" .
   144                 "document.ltiAuthForm.submit();\n" .
 static get(string $a_var)
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
getLaunchParametersLTI13(string $endpoint, string $clientId, int $deploymentId, string $nonce)
 
validateLTI13InitalLogin(array $loginData)
 
static clear(string $a_var)
 
 
 
 
◆ getRequestValue()
  
  
      
        
          | ilLTIConsumerContentGUI::getRequestValue  | 
          ( | 
          string  | 
          $key,  | 
         
        
           | 
           | 
            | 
          $default = null  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
- Parameters
 - 
  
  
 
- Returns
 - mixed|null 
 
Definition at line 521 of file class.ilLTIConsumerContentGUI.php.
References $DIC, and ILIAS\LTI\ToolProvider\$key.
  524         if (isset($DIC->http()->request()->getQueryParams()[
$key])) {
   525             return $DIC->http()->request()->getQueryParams()[
$key];
   528         if (isset($DIC->http()->request()->getParsedBody()[
$key])) {
   529             return $DIC->http()->request()->getParsedBody()[
$key];
   532         return $default ?? null;
 
 
 
 
◆ getStartButtonTxt11()
  
  
      
        
          | ilLTIConsumerContentGUI::getStartButtonTxt11  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 153 of file class.ilLTIConsumerContentGUI.php.
References $context, $token, ilLTIConsumeProvider\AVAILABILITY_NONE, ilCmiXapiAuthToken\fillToken(), ilCmiXapiUser\getIdent(), ilObjLTIConsumer\getIliasHttpPath(), ilCmiXapiUser\getUsrIdent(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilCmiXapiUser\save(), ilCmiXapiUser\setUsrIdent(), and ILIAS\Repository\user().
Referenced by launch().
  155         if ($this->
object->getOfflineStatus() ||
   156             $this->
object->isLaunchMethodEmbedded() ||
   163             $this->
user->getId(),
   164             $this->
object->getProvider()->getPrivacyIdent()
   167         if ($user_ident == 
'' || $user_ident == null) {
   173         $context = $ilLTIConsumerLaunch->getContext();
   174         $contextType = $ilLTIConsumerLaunch::getLTIContextType($context[
"type"]);
   175         $contextId = $context[
"id"];
   176         $contextTitle = $context[
"title"];
   179             $this->dic->user()->getId(),
   180             $this->
object->getRefId(),
   181             $this->
object->getId()
   184         $returnUrl = !$this->
object->isLaunchMethodOwnWin() ? 
'' : str_replace(
   190         $launchParameters = $this->
object->buildLaunchParameters(
   199         $target = $this->
object->getLaunchMethod() == 
"newWin" ? 
"_blank" : 
"_self";
   200         $button = 
'<input class="btn btn-default ilPre" type="button" onClick="ltilaunch()" value = "' . $this->
lng->txt(
"show_content") . 
'" />';
   201         $output = 
'<form id="lti_launch_form" name="lti_launch_form" action="' . $this->
object->getProvider()->getProviderUrl() . 
'" method="post" target="' . $target . 
'" encType="application/x-www-form-urlencoded">';
   202         foreach ($launchParameters as $field => $value) {
   203             $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', $field, $value) . 
"\n";
   206         $output .= 
'</form>';
   207         $output .= 
'<span id ="lti_launched" style="display:none">' . $this->
lng->txt(
"launched") . 
'</span>';
   208         $output .= 
'<script type="text/javascript">   209         function ltilaunch() {   210             document.lti_launch_form.submit();   211             document.getElementById("lti_launch_form").style.display = "none";   212             document.getElementById("lti_launched").style.display = "inline"; 
static fillToken(int $usrId, int $refId, int $objId, int $lrsTypeId=0)
 
static getIdent(int $userIdentMode, ilObjUser $user)
 
static getIliasHttpPath()
 
setUsrIdent(string $usrIdent)
 
 
 
 
◆ getStartButtonTxt13()
  
  
      
        
          | ilLTIConsumerContentGUI::getStartButtonTxt13  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 217 of file class.ilLTIConsumerContentGUI.php.
References $context, $ltiMessageHint, $token, ilLTIConsumeProvider\AVAILABILITY_NONE, CLIENT_ID, ilCmiXapiAuthToken\fillToken(), ilObjLTIConsumer\getIliasHttpPath(), initCmixUser(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilSession\set().
Referenced by launch().
  219         if ($this->
object->getOfflineStatus() ||
   220             $this->
object->isLaunchMethodEmbedded() ||
   225         $user_ident = $this->cmixUser->getUsrIdent();
   227         $context = $ilLTIConsumerLaunch->getContext();
   228         $contextType = $ilLTIConsumerLaunch::getLTIContextType($context[
"type"]);
   229         $contextId = $context[
"id"];
   230         $contextTitle = $context[
"title"];
   233             $this->dic->user()->getId(),
   234             $this->
object->getRefId(),
   235             $this->
object->getId()
   238         $returnUrl = !$this->
object->isLaunchMethodOwnWin() ? 
'' : str_replace(
   244         $target = $this->
object->getLaunchMethod() == 
"newWin" ? 
"_blank" : 
"_self";
   245         $button = 
'<input class="btn btn-default ilPre" type="button" onClick="ltilaunch()" value = "' . $this->
lng->txt(
"show_content") . 
'" />';
   248         $output = 
'<form id="lti_launch_form" name="lti_launch_form" action="' . $this->
object->getProvider()->getInitiateLogin() . 
'" method="post" target="' . $target . 
'" encType="application/x-www-form-urlencoded">';
   250         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'target_link_uri', $this->
object->getProvider()->getProviderUrl()) . 
"\n";
   251         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'login_hint', $user_ident) . 
"\n";
   252         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'lti_message_hint', 
$ltiMessageHint) . 
"\n";
   253         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'client_id', $this->
object->getProvider()->getClientId()) . 
"\n";
   254         $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', 
'lti_deployment_id', $this->
object->getProvider()->getId()) . 
"\n";
   256         $output .= 
'</form>';
   257         $output .= 
'<span id ="lti_launched" style="display:none">' . $this->
lng->txt(
"launched") . 
'</span>';
   258         $output .= 
'<script type="text/javascript">   259         function ltilaunch() {   260             document.lti_launch_form.submit();   261             document.getElementById("lti_launch_form").style.display = "none";   262             document.getElementById("lti_launched").style.display = "inline"; 
static fillToken(int $usrId, int $refId, int $objId, int $lrsTypeId=0)
 
static getIliasHttpPath()
 
static set(string $a_var, $a_val)
Set a value. 
 
 
 
 
◆ initCmixUser()
  
  
      
        
          | ilLTIConsumerContentGUI::initCmixUser  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ isEmbeddedLaunchRequest()
  
  
      
        
          | static ilLTIConsumerContentGUI::isEmbeddedLaunchRequest  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ launch()
  
  
      
        
          | ilLTIConsumerContentGUI::launch  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
- Exceptions
 - 
  
  
 
Definition at line 72 of file class.ilLTIConsumerContentGUI.php.
References $response, ilSession\get(), getLoginLTI13Form(), getStartButtonTxt11(), getStartButtonTxt13(), and ILIAS\Repository\object().
   74         if ($this->dic->access()->checkAccess(
'read', 
'', $this->
object->getRefId())) {
    75             if ($this->
object->getProvider()->getLtiVersion() == 
"LTI-1p0") {
    76                 if ($this->
object->isLaunchMethodEmbedded()) {
    77                     $tpl = 
new ilTemplate(
'tpl.lti_content.html', 
true, 
true, 
'Modules/LTIConsumer');
    78                     $tpl->setVariable(
"EMBEDDED_IFRAME_SRC", $this->dic->ctrl()->getLinkTarget(
    80                         self::CMD_SHOW_EMBEDDED
    82                     $this->dic->ui()->mainTemplate()->setContent($tpl->get());
    88                     $tpl = 
new ilTemplate(
'tpl.lti_content.html', 
true, 
true, 
'Modules/LTIConsumer');
    89                     $tpl->setVariable(
"EMBEDDED_IFRAME_SRC", $this->dic->ctrl()->getLinkTarget(
    91                         self::CMD_SHOW_EMBEDDED
    93                     $this->dic->ui()->mainTemplate()->setContent($tpl->get());
    99                             $this->dic->ui()->mainTemplate()->setOnScreenMessage(
   101                                 'initialLogin Error: ',
   106                             $this->dic->http()->saveResponse(
$response);
   107                             $this->dic->http()->sendResponse();
   108                             $this->dic->http()->close();
 
static get(string $a_var)
 
Class ChatMainBarProvider . 
 
 
 
 
◆ showEmbedded()
  
  
      
        
          | ilLTIConsumerContentGUI::showEmbedded  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
- Exceptions
 - 
  
  
 
Definition at line 304 of file class.ilLTIConsumerContentGUI.php.
References $response, exit, getEmbeddedAutoStartFormular(), ilUtil\getImagePath(), getLaunchParameters(), ILIAS_VERSION_NUMERIC, initCmixUser(), and ILIAS\Repository\object().
  306         if ($this->
object->getProvider()->getLtiVersion() == 
"LTI-1p0") {
   308             $tpl = 
new ilTemplate(
'tpl.lti_embedded.html', 
true, 
true, 
'Modules/LTIConsumer');
   310                 $tpl->setCurrentBlock(
'launch_parameter');
   311                 $tpl->setVariable(
'LAUNCH_PARAMETER', $field);
   312                 $tpl->setVariable(
'LAUNCH_PARAM_VALUE', $value);
   313                 $tpl->parseCurrentBlock();
   317             $tpl->setVariable(
"DELOS_CSS_HREF", 
'templates/default/delos.css' . $v);
   318             $tpl->setVariable(
"JQUERY_SRC", 
'node_modules/jquery/dist/jquery.js' . $v);
   321             $tpl->setVariable(
'LAUNCH_URL', $this->
object->getProvider()->getProviderUrl());
   323             #$DIC->ui()->mainTemplate()->getStandardTemplate();   324             #$DIC->ui()->mainTemplate()->setContent($tpl->get());   330             $this->dic->http()->saveResponse(
$response);
   331             $this->dic->http()->sendResponse();
   332             $this->dic->http()->close();
 
const ILIAS_VERSION_NUMERIC
 
Class ChatMainBarProvider . 
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
getEmbeddedAutoStartFormular()
 
 
 
 
◆ validateLTI13InitalLogin()
  
  
      
        
          | ilLTIConsumerContentGUI::validateLTI13InitalLogin  | 
          ( | 
          array  | 
          $loginData | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Definition at line 415 of file class.ilLTIConsumerContentGUI.php.
References $ref_id, $scope, ilSession\get(), ilObjLTIConsumer\getLogger(), ilCmiXapiUser\getUsrIdent(), ILIAS\Repository\int(), ILIAS\Repository\object(), and ILIAS\Repository\user().
Referenced by getLoginLTI13Form().
  417         $scope = $loginData[
'scope'];
   418         $responsetype = $loginData[
'response_type'];
   419         $clientid = $loginData[
'client_id'];
   420         $redirecturi = $loginData[
'redirect_uri'];
   421         $loginhint = $loginData[
'login_hint'];
   422         $ltimessagehint = $loginData[
'lti_message_hint'];
   423         $state = $loginData[
'state'];
   424         $responsemode = $loginData[
'response_mode'];
   425         $nonce = $loginData[
'nonce'];
   426         $prompt = $loginData[
'prompt'];
   430         $ok = !empty(
$scope) && !empty($responsetype) && !empty($clientid) &&
   431             !empty($redirecturi) && !empty($loginhint) &&
   435             $error = 
'invalid_request';
   437         if ($ok && (
$scope !== 
'openid')) {
   439             $error = 
'invalid_scope';
   441         if ($ok && ($responsetype !== 
'id_token')) {
   443             $error = 
'unsupported_response_type';
   449                 $error = 
'invalid_request';
   451             if ($this->
object->getProvider()->getClientId() !== $clientid) {
   453                 $error = 
'unauthorized_client';
   460                 $this->
user->getId(),
   461                 $this->
object->getProvider()->getPrivacyIdent()
   471             if ((
string) $loginhint !== $user_ident) {
   473                 $error = 
'access_denied';
   476         $uris = array_map(
"trim", explode(
",", $this->
object->getProvider()->getRedirectionUris()));
   477         if (!in_array($redirecturi, $uris)) {
   479             $error = 
'invalid_request';
   483             if (isset($responsemode)) {
   484                 $ok = ($responsemode === 
'form_post');
   486                     $error = 
'invalid_request';
   487                     $desc = 
'Invalid response_mode';
   491                 $error = 
'invalid_request';
   492                 $desc = 
'Missing response_mode';
   495         if ($ok && !empty($prompt) && ($prompt !== 
'none')) {
   497             $error = 
'invalid_request';
   498             $desc = 
'Invalid prompt';
   504             $err = 
"error '" . $error . 
"'";
   506                 $err .= 
" with description: " . $desc;
 static get(string $a_var)
 
 
 
 
◆ $cmixUser
◆ $dic
  
  
      
        
          | ILIAS DI Container ilLTIConsumerContentGUI::$dic | 
         
       
   | 
  
private   | 
  
 
 
◆ $lng
◆ $object
◆ $user
◆ CMD_LAUNCH
      
        
          | const ilLTIConsumerContentGUI::CMD_LAUNCH = 'launch' | 
        
      
 
 
◆ CMD_SHOW_EMBEDDED
      
        
          | const ilLTIConsumerContentGUI::CMD_SHOW_EMBEDDED = 'showEmbedded' | 
        
      
 
 
The documentation for this class was generated from the following file: