class.php 798 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Show information about the OpenBadge class.
  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']) ? (int) $_GET['id'] : 0;
  12. $objSkill = new Skill();
  13. $skill = $objSkill->get($skillId);
  14. $json = [];
  15. if ($skill) {
  16. $json = [
  17. 'name' => $skill['name'],
  18. 'description' => $skill['description'],
  19. 'image' => api_get_path(WEB_UPLOAD_PATH)."badges/{$skill['icon']}",
  20. 'criteria' => api_get_path(WEB_CODE_PATH)."badge/criteria.php?id=$skillId",
  21. 'issuer' => api_get_path(WEB_CODE_PATH).'badge/issuer.php',
  22. ];
  23. }
  24. header('Content-Type: application/json');
  25. echo json_encode($json);