my_certificates.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * List of achieved certificates by the current user
  5. * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
  6. * @package chamilo.gradebook
  7. */
  8. $cidReset = true;
  9. require_once '../inc/global.inc.php';
  10. if (api_is_anonymous()) {
  11. api_not_allowed(true);
  12. }
  13. $userId = api_get_user_id();
  14. $courseList = GradebookUtils::getUserCertificatesInCourses($userId);
  15. $sessionList = GradebookUtils::getUserCertificatesInSessions($userId);
  16. $template = new Template(get_lang('MyCertificates'));
  17. $template->assign('course_list', $courseList);
  18. $template->assign('session_list', $sessionList);
  19. $content = $template->fetch('default/gradebook/my_certificates.tpl');
  20. if (empty($courseList) || empty($sessionList)) {
  21. $template->assign(
  22. 'message',
  23. Display::return_message(get_lang('YouNotYetAchievedCertificates'), 'warning')
  24. );
  25. }
  26. if (api_get_setting('allow_public_certificates') == 'true') {
  27. $template->assign(
  28. 'actions',
  29. Display::toolbarButton(
  30. get_lang('SearchCertificates'),
  31. api_get_path(WEB_CODE_PATH) . "gradebook/search.php",
  32. 'search',
  33. 'info'
  34. )
  35. );
  36. }
  37. $template->assign('content', $content);
  38. $template->display_one_col_template();