skills_tree.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. // Language files that need to be included.
  7. $language_file = array('admin');
  8. $cidReset = true;
  9. require_once '../inc/global.inc.php';
  10. require_once api_get_path(LIBRARY_PATH).'skill.lib.php';
  11. require_once api_get_path(LIBRARY_PATH).'skill.visualizer.lib.php';
  12. $this_section = SECTION_MYPROFILE;
  13. api_block_anonymous_users();
  14. if (api_get_setting('allow_skills_tool') != 'true') {
  15. api_not_allowed();
  16. }
  17. //Adds the JS needed to use the jqgrid
  18. $htmlHeadXtra[] = api_get_jqgrid_js();
  19. $htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');
  20. $htmlHeadXtra[] = api_get_js('skills.js');
  21. $skill = new Skill();
  22. $type = 'read'; //edit
  23. $tree = $skill->get_skills_tree(api_get_user_id(), true);
  24. $skill_visualizer = new SkillVisualizer($tree, $type);
  25. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  26. $tpl = new Template(null, false, false);
  27. $tpl->assign('url', $url);
  28. $tpl->assign('skill_visualizer', $skill_visualizer);
  29. $content = $tpl->fetch('default/skill/skill_tree_student.tpl');
  30. $tpl->assign('content', $content);
  31. $tpl->display_no_layout_template();