criteria.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Show information about OpenBadge criteria.
  5. *
  6. * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
  7. *
  8. * @package chamilo.badge
  9. */
  10. require_once __DIR__.'/../inc/global.inc.php';
  11. $entityManager = Database::getManager();
  12. /** @var \Chamilo\CoreBundle\Entity\Skill $skill */
  13. $skill = $entityManager->find('ChamiloCoreBundle:Skill', $_GET['id']);
  14. if (!$skill) {
  15. Display::addFlash(
  16. Display::return_message(get_lang('SkillNotFound'), 'error')
  17. );
  18. header('Location: '.api_get_path(WEB_PATH));
  19. exit;
  20. }
  21. $skillInfo = [
  22. 'name' => $skill->getName(),
  23. 'short_code' => $skill->getShortCode(),
  24. 'description' => $skill->getDescription(),
  25. 'criteria' => $skill->getCriteria(),
  26. 'badge_image' => Skill::getWebIconPath($skill),
  27. ];
  28. $template = new Template();
  29. $template->assign('skill_info', $skillInfo);
  30. $content = $template->fetch(
  31. $template->get_template('skill/criteria.tpl')
  32. );
  33. $template->assign('content', $content);
  34. $template->display_one_col_template();