skills_tree.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. /**
  5. * @package chamilo.admin
  6. */
  7. $cidReset = true;
  8. //require_once '../inc/global.inc.php';
  9. $this_section = SECTION_MYPROFILE;
  10. api_block_anonymous_users();
  11. if (api_get_setting('skill.allow_skills_tool') != 'true') {
  12. api_not_allowed();
  13. }
  14. //Adds the JS needed to use the jqgrid
  15. $htmlHeadXtra[] = api_get_jqgrid_js();
  16. $htmlHeadXtra[] = api_get_js('components/jsplumb/dist/js/jsPlumb-2.0.4.js');
  17. $htmlHeadXtra[] = api_get_js('components/jquery.ui.touch/jquery.ui.touch.js');
  18. $htmlHeadXtra[] = api_get_js('js/skills.js');
  19. $skill = new Skill();
  20. $type = 'read'; //edit
  21. $tree = $skill->get_skills_tree(api_get_user_id(), null, true);
  22. $skill_visualizer = new SkillVisualizer($tree, $type);
  23. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  24. $tpl = Container::getTwig();
  25. $tpl->addGlobal('url', $url);
  26. $tpl->addGlobal('skill_visualizer', $skill_visualizer);
  27. $content = $tpl->render('@template_style/skill/skill_tree_student.html.twig');
  28. echo $content;