start.php 780 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. api_protect_course_script(true);
  5. api_block_anonymous_users();
  6. if (!api_is_allowed_to_edit()) {
  7. api_not_allowed(true);
  8. }
  9. $course_info = api_get_course_info();
  10. $directory = $course_info['directory'];
  11. $title = $course_info['title'];
  12. // Preparing a confirmation message.
  13. $link = api_get_path(WEB_COURSE_PATH).$directory.'/';
  14. $tpl = Container::getTwig();
  15. $tpl->addGlobal('course_url', $link);
  16. $tpl->addGlobal('course_title', Display::url($title, $link));
  17. $tpl->addGlobal('course_id', $course_info['code']);
  18. $tpl->addGlobal('just_created', isset($_GET['first']) && $_GET['first'] ? 1 : 0);
  19. echo $tpl->render('ChamiloCoreBundle:default/create_course:add_course.html.twig');