skill_badge_list.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use ChamiloSession as Session;
  4. /**
  5. * Show information about Mozilla OpenBadges
  6. * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
  7. * @package chamilo.admin.openbadges
  8. */
  9. $cidReset = true;
  10. require_once __DIR__.'/../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::url(
  32. Display::return_icon(
  33. 'list_badges.png',
  34. get_lang('ManageSkills'),
  35. null,
  36. ICON_SIZE_MEDIUM),
  37. api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
  38. ['title' => get_lang('ManageSkills')]
  39. );
  40. $tpl = new Template(get_lang('Skills'));
  41. $tpl->assign('errorMessage', $errorMessage);
  42. $tpl->assign('skills', $skills);
  43. $templateName = $tpl->get_template('skill/badge_list.tpl');
  44. $contentTemplate = $tpl->fetch($templateName);
  45. $tpl->assign(
  46. 'actions',
  47. Display::toolbarAction('toolbar', [$toolbar])
  48. );
  49. $tpl->assign('content', $contentTemplate);
  50. $tpl->display_one_col_template();
  51. Session::erase('errorMessage');