skill_badge_list.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Show information about Mozilla OpenBadges
  5. * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
  6. * @package chamilo.admin.openbadges
  7. */
  8. use ChamiloSession as Session;
  9. $cidReset = true;
  10. require_once '../inc/global.inc.php';
  11. if (!api_is_platform_admin() || api_get_setting('allow_skills_tool') !== 'true') {
  12. api_not_allowed(true);
  13. }
  14. $this_section = SECTION_PLATFORM_ADMIN;
  15. $errorMessage = null;
  16. if (Session::has('errorMessage')) {
  17. $errorMessage = Session::read('errorMessage');
  18. }
  19. $objSkill = new Skill();
  20. $skills = $objSkill->get_all();
  21. $interbreadcrumb = array(
  22. array(
  23. 'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
  24. 'name' => get_lang('Administration')
  25. ),
  26. array(
  27. 'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
  28. 'name' => get_lang('Badges')
  29. )
  30. );
  31. $toolbar = Display::toolbarButton(
  32. get_lang('ManageSkills'),
  33. api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php',
  34. 'list',
  35. 'primary',
  36. ['title' => get_lang('ManageSkills')]
  37. );
  38. $tpl = new Template(get_lang('Skills'));
  39. $tpl->assign('errorMessage', $errorMessage);
  40. $tpl->assign('skills', $skills);
  41. $contentTemplate = $tpl->fetch('default/skill/badge_list.tpl');
  42. $tpl->assign('actions', $toolbar);
  43. $tpl->assign('content', $contentTemplate);
  44. $tpl->display_one_col_template();
  45. Session::erase('errorMessage');