skills_wheel.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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_PLATFORM_ADMIN;
  9. api_protect_admin_script(false, true);
  10. Skill::isAllowed();
  11. //Adds the JS needed to use the jqgrid
  12. $htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js');
  13. $htmlHeadXtra[] = api_get_js('d3/colorbrewer.js');
  14. $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
  15. $tpl = new Template(null, false, false);
  16. $load_user = 0;
  17. if (isset($_GET['load_user'])) {
  18. $load_user = 1;
  19. }
  20. $skill_condition = '';
  21. if (isset($_GET['skill_id'])) {
  22. $skill_condition = '&skill_id='.intval($_GET['skill_id']);
  23. $tpl->assign('skill_id_to_load', $_GET['skill_id']);
  24. }
  25. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
  26. $tpl->assign('wheel_url', $url);
  27. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  28. $tpl->assign('url', $url);
  29. $tpl->assign('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(
  50. 'p',
  51. null,
  52. ['id' => 'description', 'class' => 'form-control-static']
  53. )
  54. );
  55. $tpl->assign('dialogForm', $dialogForm->returnForm());
  56. $saveProfileForm = new FormValidator(
  57. 'form',
  58. 'post',
  59. null,
  60. null,
  61. ['id' => 'dialog-form-profile']
  62. );
  63. $saveProfileForm->addHidden('profile_id', null);
  64. $saveProfileForm->addText(
  65. 'name',
  66. get_lang('Name'),
  67. true,
  68. ['id' => 'name_profile']
  69. );
  70. $saveProfileForm->addTextarea(
  71. 'description',
  72. get_lang('Description'),
  73. ['id' => 'description_profile', 'rows' => 6]
  74. );
  75. $tpl->assign('save_profile_form', $saveProfileForm->returnForm());
  76. $templateName = $tpl->get_template('skill/skill_wheel.tpl');
  77. $content = $tpl->fetch($templateName);
  78. $tpl->assign('content', $content);
  79. $tpl->display_no_layout_template();