start.php 934 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /* For license terms, see /license.txt */
  3. require_once __DIR__.'/../../main/inc/global.inc.php';
  4. $toolId = isset($_GET['id']) ? intval($_GET['id']) : 0;
  5. if (empty($toolId)) {
  6. if (api_is_platform_admin()) {
  7. header('Location: '.api_get_path(WEB_PLUGIN_PATH).'ims_lti/list.php');
  8. exit;
  9. }
  10. api_not_allowed(true);
  11. exit;
  12. }
  13. api_protect_course_script();
  14. $imsLtiPlugin = ImsLtiPlugin::create();
  15. $tool = ImsLtiTool::fetch($toolId);
  16. $htmlHeadXtra[] = '<link rel="stylesheet" href="../assets/css/style.css" type="text/css">';
  17. $template = new Template($imsLtiPlugin->get_title());
  18. $template->assign(
  19. 'launch_url',
  20. api_get_path(WEB_PLUGIN_PATH).'ims_lti/form.php?'.http_build_query(['id' => $tool->getId()])
  21. );
  22. $content = $template->fetch('ims_lti/view/start.tpl');
  23. $template->assign('header', $tool->getName());
  24. $template->assign('content', $content);
  25. $template->display_one_col_template();