Lti: Fixing launch page for lti tool #2741

pull/3924/head
Angel Fernando Quiroz Campos 5 years ago
parent b0e1440921
commit 3c3e9a37bc
  1. 4
      config/services.yaml
  2. 8
      src/CoreBundle/Resources/views/Lti/iframe.html.twig
  3. 11
      src/LtiBundle/Controller/CourseController.php
  4. 4
      src/LtiBundle/Resources/config/services.yml

@ -76,10 +76,6 @@ services:
chamilo_core.hook_factory:
class: 'Chamilo\CoreBundle\Hook\HookFactory'
chamilo_lti_utils:
class: Chamilo\LtiBundle\Util\Utils
arguments: ['@chamilo.settings.manager']
Chamilo\CoreBundle\EventListener\HTTPExceptionListener:
tags:
- {name: kernel.event_listener, event: kernel.exception}

@ -3,7 +3,7 @@
{% block content %}
<section class="bg-white">
{% if not tool.description is empty %}
{% if tool.parent.activeDeepLinking %}
{% if tool.toolParent.activeDeepLinking %}
{% autoescape false %}
<div class="m-3 pt-3">{{ tool.description }}</div>
{% endautoescape %}
@ -12,9 +12,9 @@
{% endif %}
{% endif %}
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item plugin-ims-lti-iframe" allowfullscreen
src="{{ url('chamilo_lti_launch', {'code': course.code, 'id': tool.id}) }}"></iframe>
<div class="">
<iframe class="w-full h-screen plugin-ims-lti-iframe" allowfullscreen
src="{{ url('chamilo_lti_launch', {'cid': course.id, 'id': tool.id}) }}"></iframe>
</div>
</section>
{% endblock %}

@ -127,9 +127,12 @@ class CourseController extends ToolBaseController
/**
* @Route("/launch/{id}", name="chamilo_lti_launch", requirements={"id"="\d+"})
*
* @param string $id
* @param int $id
* @param Utils $ltiUtil
*
* @return Response
*/
public function launchAction($id): Response
public function launchAction(int $id, Utils $ltiUtil): Response
{
$em = $this->getDoctrine()->getManager();
/** @var null|ExternalTool $tool */
@ -150,8 +153,6 @@ class CourseController extends ToolBaseController
throw $this->createAccessDeniedException('');
}
$ltiUtil = $this->get('chamilo_lti_utils');
$institutionDomain = $ltiUtil->getInstitutionDomain();
$toolUserId = $ltiUtil->generateToolUserId($user->getId());
@ -381,7 +382,7 @@ class CourseController extends ToolBaseController
}
return $this->render(
'ChamiloCoreBundle:Lti:iframe.html.twig',
'@ChamiloCore/Lti/iframe.html.twig',
[
'tool' => $externalTool,
'course' => $course,

@ -7,9 +7,11 @@ services:
Chamilo\LtiBundle\:
resource: '../../*'
exclude: '../../{Component,Form,ChamiloLtiBundle.php,Entity}'
exclude: '../../{Component,Form,ChamiloLtiBundle.php,Entity,Util}'
public: true
Chamilo\LtiBundle\Util\Utils:
Chamilo\LtiBundle\Controller\:
resource: '../../Controller'
tags: ['controller.service_arguments']

Loading…
Cancel
Save