skills.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. $this_section = SECTION_PLATFORM_ADMIN;
  9. api_protect_admin_script();
  10. if (api_get_setting('skill.allow_skills_tool') != 'true') {
  11. api_not_allowed();
  12. }
  13. //Adds the JS needed to use the jqgrid
  14. $htmlHeadXtra[] = api_get_js('componentes/jsplumb/dist/js/jsPlumb-2.0.4.js');
  15. $htmlHeadXtra[] = api_get_js('componentes/jquery.ui.touch/jquery.ui.touch.js');
  16. $htmlHeadXtra[] = api_get_js('js/skills.js');
  17. $skill = new Skill();
  18. $type = 'edit'; //edit
  19. $tree = $skill->get_skills_tree(null, null, true);
  20. $skill_visualizer = new SkillVisualizer($tree, $type);
  21. $html = $skill_visualizer->return_html();
  22. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  23. $tpl = new Template(null, false, false);
  24. $tpl->assign('url', $url);
  25. $tpl->assign('html', $html);
  26. $tpl->assign('skill_visualizer', $skill_visualizer);
  27. $tpl->assign('js', $skill_visualizer->return_js());
  28. //
  29. $content = $tpl->fetch('default/skill/skill_tree.tpl');
  30. $tpl->assign('content', $content);
  31. $tpl->display_no_layout_template();