skills_wheel.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. $this_section = SECTION_PLATFORM_ADMIN;
  5. api_protect_admin_script(false, true);
  6. if (api_get_setting('skill.allow_skills_tool') != 'true') {
  7. api_not_allowed();
  8. }
  9. //Adds the JS needed to use the jqgrid
  10. $htmlHeadXtra[] = api_get_js('js/d3/d3.v3.5.4.min.js');
  11. $htmlHeadXtra[] = api_get_js('js/d3/colorbrewer.js');
  12. $htmlHeadXtra[] = api_get_js('js/d3/jquery.xcolor.js');
  13. $tpl = Container::getTwig();
  14. $load_user = 0;
  15. if (isset($_GET['load_user'])) {
  16. $load_user = 1;
  17. }
  18. $skill_condition = '';
  19. $tpl->addGlobal('skill_id_to_load', '');
  20. if (isset($_GET['skill_id'])) {
  21. $skillId = intval($_GET['skill_id']);
  22. $skill_condition = '&skill_id='.$skillId;
  23. $tpl->addGlobal('skill_id_to_load', $skillId);
  24. }
  25. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
  26. $tpl->addGlobal('wheel_url', $url);
  27. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  28. $tpl->addGlobal('url', $url);
  29. $tpl->addGlobal('isAdministration', true);
  30. $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
  31. $dialogForm->addLabel(
  32. get_lang('Name'),
  33. Display::tag('p', null, ['id' => 'name', 'class' => 'form-control-static'])
  34. );
  35. $dialogForm->addLabel(
  36. get_lang('ShortCode'),
  37. Display::tag('p', null, ['id' => 'short_code', 'class' => 'form-control-static'])
  38. );
  39. $dialogForm->addLabel(
  40. get_lang('Parent'),
  41. Display::tag('p', null, ['id' => 'parent', 'class' => 'form-control-static'])
  42. );
  43. $dialogForm->addLabel(
  44. [get_lang('Gradebook'), get_lang('WithCertificate')],
  45. Display::tag('ul', null, ['id' => 'gradebook', 'class' => 'form-control-static list-unstyled'])
  46. );
  47. $dialogForm->addLabel(
  48. get_lang('Description'),
  49. Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
  50. );
  51. $tpl->addGlobal('dialogForm', $dialogForm->returnForm());
  52. $saveProfileForm = new FormValidator('form', 'post', null, null, ['id' => 'dialog-form-profile']);
  53. $saveProfileForm->addHidden('profile_id', null);
  54. $saveProfileForm->addText('name', get_lang('Name'), true, ['id' => 'name_profile']);
  55. $saveProfileForm->addTextarea('description', get_lang('Description'), ['id' => 'description_profile', 'rows' => 6]);
  56. $tpl->addGlobal('saveProfileForm', $saveProfileForm->returnForm());
  57. echo $tpl->render('@template_style/skill/skill_wheel.html.twig');
  58. Container::$legacyTemplate = 'layout_one_col_no_content.html.twig';