criteria.php 944 B

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