criteria.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. $skillId = isset($_GET['id']) ? $_GET['id'] : 0;
  12. if (empty($skillId)) {
  13. exit;
  14. }
  15. $entityManager = Database::getManager();
  16. /** @var \Chamilo\CoreBundle\Entity\Skill $skill */
  17. $skill = $entityManager->find('ChamiloCoreBundle:Skill', $_GET['id']);
  18. if ($skill) {
  19. $skillInfo = [
  20. 'name' => $skill->getName(),
  21. 'short_code' => $skill->getShortCode(),
  22. 'description' => $skill->getDescription(),
  23. 'criteria' => $skill->getCriteria(),
  24. 'badge_image' => Skill::getWebIconPath($skill),
  25. ];
  26. $template = new Template();
  27. $template->assign('skill_info', $skillInfo);
  28. $content = $template->fetch(
  29. $template->get_template('skill/criteria.tpl')
  30. );
  31. $template->assign('content', $content);
  32. $template->display_one_col_template();
  33. exit;
  34. }
  35. Display::addFlash(
  36. Display::return_message(get_lang('SkillNotFound'), 'error')
  37. );
  38. header('Location: '.api_get_path(WEB_PATH));
  39. exit;