skills_wheel.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. $cidReset = true;
  7. require_once __DIR__.'/../inc/global.inc.php';
  8. $this_section = SECTION_SOCIAL;
  9. api_block_anonymous_users();
  10. Skill::isAllow(api_get_user_id());
  11. //Adds the JS needed to use the jqgrid
  12. $htmlHeadXtra[] = api_get_asset('d3/d3.js');
  13. $htmlHeadXtra[] = api_get_asset('colorbrewer/colorbrewer.js');
  14. $htmlHeadXtra[] = api_get_asset('xcolor/jquery.xcolor.js');
  15. $tpl = new Template(null, false, false);
  16. $userId = api_get_user_id();
  17. $userInfo = api_get_user_info();
  18. $skill = new Skill();
  19. $ranking = $skill->get_user_skill_ranking($userId);
  20. $skills = $skill->getUserSkills($userId, true);
  21. $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
  22. $dialogForm->addLabel(
  23. get_lang('Name'),
  24. Display::tag('p', null, ['id' => 'name', 'class' => 'form-control-static'])
  25. );
  26. $dialogForm->addLabel(
  27. get_lang('ShortCode'),
  28. Display::tag('p', null, ['id' => 'short_code', 'class' => 'form-control-static'])
  29. );
  30. $dialogForm->addLabel(
  31. get_lang('Parent'),
  32. Display::tag('p', null, ['id' => 'parent', 'class' => 'form-control-static'])
  33. );
  34. $dialogForm->addLabel(
  35. [
  36. get_lang('Gradebook'),
  37. get_lang('WithCertificate')
  38. ],
  39. Display::tag(
  40. 'ul',
  41. null,
  42. ['id' => 'gradebook', 'class' => 'form-control-static list-unstyled']
  43. )
  44. );
  45. $dialogForm->addLabel(
  46. get_lang('Description'),
  47. Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
  48. );
  49. $type = 'read';
  50. $tree = $skill->get_skills_tree($userId, null, true);
  51. $skill_visualizer = new SkillVisualizer($tree, $type);
  52. $tpl->assign('skill_visualizer', $skill_visualizer);
  53. $tpl->assign('dialogForm', $dialogForm->returnForm());
  54. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$userId";
  55. $tpl->assign('wheel_url', $url);
  56. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  57. $tpl->assign('url', $url);
  58. $tpl->assign('user_info', $userInfo);
  59. $tpl->assign('ranking', $ranking);
  60. $tpl->assign('skills', $skills);
  61. $template = $tpl->get_template('skill/skill_wheel_student.tpl');
  62. $content = $tpl->fetch($template);
  63. $tpl->assign('content', $content);
  64. $tpl->display_no_layout_template();