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