skills_wheel.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. $this_section = SECTION_SOCIAL;
  11. if (api_get_setting('allow_skills_tool') != 'true') {
  12. api_not_allowed();
  13. }
  14. api_block_anonymous_users();
  15. //Adds the JS needed to use the jqgrid
  16. $htmlHeadXtra[] = api_get_js('d3/d3.v2.min.js');
  17. $htmlHeadXtra[] = api_get_js('d3/colorbrewer.js');
  18. $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
  19. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
  20. $htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';
  21. $tpl = new Template(null, false, false);
  22. $load_user = api_get_user_id();
  23. $userInfo = api_get_user_info();
  24. $skill = new Skill();
  25. $ranking = $skill->get_user_skill_ranking($load_user);
  26. $countSkill = count($skill->get_all());
  27. $skill_condition = '';
  28. if (isset($_GET['skill_id'])) {
  29. $skill_condition = '&skill_id='.intval($_GET['skill_id']);
  30. $tpl->assign('skill_id_to_load', $_GET['skill_id']);
  31. }
  32. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
  33. $tpl->assign('wheel_url', $url);
  34. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  35. $tpl->assign('url', $url);
  36. $tpl->assign('userInfo', $userInfo);
  37. $tpl->assign('ranking', $ranking);
  38. $tpl->assign('countSkill', $countSkill);
  39. $content = $tpl->fetch('default/skill/skill_wheel_student.tpl');
  40. $tpl->assign('content', $content);
  41. $tpl->display_no_layout_template();