diff --git a/main/badge/criteria.php b/main/badge/criteria.php index 93e55d5699..a43a8751e8 100644 --- a/main/badge/criteria.php +++ b/main/badge/criteria.php @@ -5,13 +5,25 @@ * @author Angel Fernando Quiroz Campos * @package chamilo.badge */ -header('Content-Type: text/plain'); - require_once '../inc/global.inc.php'; -$skillId = isset($_GET['id']) ? intval($_GET['id']) : 0; +$entityManager = Database::getManager(); +$skill = $entityManager->find('ChamiloCoreBundle:Skill', $_GET['id']); + +$skillInfo = [ + 'name' => $skill->getName(), + 'short_code' => $skill->getShortCode(), + 'description' => $skill->getDescription(), + 'criteria' => $skill->getCriteria(), + 'badge_image' => $skill->getWebIconPath() +]; + +$template = new Template(); +$template->assign('skill_info', $skillInfo); -$objSkill = new Skill(); -$skill = $objSkill->get($skillId); +$content = $template->fetch( + $template->get_template('skill/criteria.tpl') +); -echo $skill['criteria']; +$template->assign('content', $content); +$template->display_one_col_template(); diff --git a/main/template/default/skill/criteria.tpl b/main/template/default/skill/criteria.tpl new file mode 100644 index 0000000000..3b35cd6a40 --- /dev/null +++ b/main/template/default/skill/criteria.tpl @@ -0,0 +1,24 @@ +

{{ 'BadgeDetails'|get_lang }}

+
+
+
+
+ {{ skill_info.name }} +
+

{{ skill_info.name }}

+ {% if skill_info.short_code %} +

{{ skill_info.short_code }}

+ {% endif %} +
+
+
+
+

{{ 'Name'|get_lang }}

+

{{ skill_info.name }}

+

{{ 'Description'|get_lang }}

+

{{ skill_info.description }}

+

{{ 'CriteriaToEarnTheBadge'|get_lang }}

+

{{ skill_info.criteria }}

+
+
+
diff --git a/main/template/default/social/skills_block.tpl b/main/template/default/social/skills_block.tpl index 7c24c29459..8dabe94e6a 100644 --- a/main/template/default/social/skills_block.tpl +++ b/main/template/default/social/skills_block.tpl @@ -32,7 +32,7 @@