start.php 840 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /* For license terms, see /license.txt */
  3. use Chamilo\PluginBundle\Entity\ImsLti\ImsLtiTool;
  4. require_once __DIR__.'/../../main/inc/global.inc.php';
  5. api_protect_course_script();
  6. $em = Database::getManager();
  7. /** @var ImsLtiTool $tool */
  8. $tool = isset($_GET['id']) ? $em->find('ChamiloPluginBundle:ImsLti\ImsLtiTool', intval($_GET['id'])) : null;
  9. if (!$tool) {
  10. api_not_allowed(true);
  11. }
  12. $imsLtiPlugin = ImsLtiPlugin::create();
  13. $template = new Template($tool->getName());
  14. $template->assign('tool', $tool);
  15. $template->assign(
  16. 'launch_url',
  17. api_get_path(WEB_PLUGIN_PATH).'ims_lti/form.php?'.http_build_query(['id' => $tool->getId()])
  18. );
  19. $content = $template->fetch('ims_lti/view/start.tpl');
  20. $template->assign('header', $tool->getName());
  21. $template->assign('content', $content);
  22. $template->display_one_col_template();