criteria.php 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. $skill = $entityManager->find('ChamiloCoreBundle:Skill', $_GET['id']);
  13. if (!$skill) {
  14. Display::addFlash(
  15. Display::return_message(get_lang('SkillNotFound'), 'error')
  16. );
  17. header('Location: '.api_get_path(WEB_PATH));
  18. exit;
  19. }
  20. $skillInfo = [
  21. 'name' => $skill->getName(),
  22. 'short_code' => $skill->getShortCode(),
  23. 'description' => $skill->getDescription(),
  24. 'criteria' => $skill->getCriteria(),
  25. 'badge_image' => $skill->getWebIconPath(),
  26. ];
  27. $template = new Template();
  28. $template->assign('skill_info', $skillInfo);
  29. $content = $template->fetch(
  30. $template->get_template('skill/criteria.tpl')
  31. );
  32. $template->assign('content', $content);
  33. $template->display_one_col_template();