Issues (1796)

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

Severity
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
/**
6
 * Show information about OpenBadge criteria.
7
 *
8
 * @author Angel Fernando Quiroz Campos <[email protected]>
9
 */
10
require_once __DIR__.'/../inc/global.inc.php';
11
12
$skillId = isset($_GET['id']) ? $_GET['id'] : 0;
13
14
if (empty($skillId)) {
15
    exit;
16
}
17
18
$entityManager = Database::getManager();
19
/** @var \Chamilo\CoreBundle\Entity\Skill $skill */
20
$skill = $entityManager->find(\Chamilo\CoreBundle\Entity\Skill::class, $_GET['id']);
21
22
if ($skill) {
0 ignored issues
show
$skill is of type Chamilo\CoreBundle\Entity\Skill, thus it always evaluated to true.
Loading history...
23
    $skillInfo = [
24
        'name' => $skill->getTitle(),
25
        'short_code' => $skill->getShortCode(),
26
        'description' => $skill->getDescription(),
27
        'criteria' => $skill->getCriteria(),
28
        'badge_image' => SkillModel::getWebIconPath($skill),
29
    ];
30
31
    $template = new Template();
32
    $template->assign('skill_info', $skillInfo);
33
34
    $content = $template->fetch(
35
        $template->get_template('skill/criteria.tpl')
36
    );
37
38
    $template->assign('content', $content);
39
    $template->display_one_col_template();
40
    exit;
41
}
42
43
Display::addFlash(
44
    Display::return_message(get_lang('Skill not found'), 'error')
45
);
46
47
header('Location: '.api_get_path(WEB_PATH));
48
exit;
49