Issues (1796)

public/main/skills/class.php (1 issue)

Labels
Severity
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
/**
5
 * Show information about the OpenBadge class.
6
 *
7
 * @author Angel Fernando Quiroz Campos <[email protected]>
8
 */
9
require_once __DIR__.'/../inc/global.inc.php';
10
11
$skillId = isset($_GET['id']) ? (int) $_GET['id'] : 0;
12
13
$objSkill = new SkillModel();
14
$skill = $objSkill->get($skillId);
15
$json = [];
16
17
if ($skill) {
18
    $json = [
19
        'name' => $skill['name'],
20
        'description' => $skill['description'],
21
        'image' => api_get_path(WEB_UPLOAD_PATH)."badges/{$skill['icon']}",
0 ignored issues
show
The constant WEB_UPLOAD_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
22
        'criteria' => api_get_path(WEB_CODE_PATH)."skills/criteria.php?id=$skillId",
23
        'issuer' => api_get_path(WEB_CODE_PATH).'skills/issuer.php',
24
    ];
25
}
26
27
header('Content-Type: application/json');
28
29
echo json_encode($json);
30