skills.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_PLATFORM_ADMIN;
  13. api_protect_admin_script();
  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_js('jquery.jsPlumb.all.js');
  19. $htmlHeadXtra[] = api_get_js('skills.js');
  20. $skill = new Skill();
  21. $type = 'edit'; //edit
  22. $tree = $skill->get_skills_tree(null, null, true);
  23. $skill_visualizer = new SkillVisualizer($tree, $type);
  24. $html = $skill_visualizer->return_html();
  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('html', $html);
  29. $tpl->assign('skill_visualizer', $skill_visualizer);
  30. $tpl->assign('js', $skill_visualizer->return_js());
  31. //
  32. $content = $tpl->fetch('default/skill/skill_tree.tpl');
  33. $tpl->assign('content', $content);
  34. $tpl->display_no_layout_template();