Browse Source

Fix skill pages

Julio Montoya 9 years ago
parent
commit
78d1f3d168
31 changed files with 623 additions and 515 deletions
  1. 13 11
      main/admin/skills_wheel.php
  2. 10 8
      main/gradebook/my_certificates.php
  3. 12 16
      main/gradebook/search.php
  4. 1 1
      main/inc/lib/certificate.lib.php
  5. 1 1
      main/inc/lib/userportal.lib.php
  6. 25 18
      main/social/my_skills_report.php
  7. 0 15
      main/template/default/skill/skill_info.tpl
  8. 13 15
      src/Chamilo/CoreBundle/Menu/CourseMenuBuilder.php
  9. 19 16
      src/Chamilo/CoreBundle/Resources/views/default/gradebook/certificate_report.html.twig
  10. 11 11
      src/Chamilo/CoreBundle/Resources/views/default/gradebook/my_certificates.html.twig
  11. 18 15
      src/Chamilo/CoreBundle/Resources/views/default/gradebook/search.html.twig
  12. 15 12
      src/Chamilo/CoreBundle/Resources/views/default/skill/badge.html.twig
  13. 34 14
      src/Chamilo/CoreBundle/Resources/views/default/skill/badge_create.html.twig
  14. 10 7
      src/Chamilo/CoreBundle/Resources/views/default/skill/badge_list.html.twig
  15. 4 4
      src/Chamilo/CoreBundle/Resources/views/default/skill/criteria.html.twig
  16. 23 18
      src/Chamilo/CoreBundle/Resources/views/default/skill/drh_report.html.twig
  17. 11 11
      src/Chamilo/CoreBundle/Resources/views/default/skill/issued.html.twig
  18. 20 14
      src/Chamilo/CoreBundle/Resources/views/default/skill/list.html.twig
  19. 19 14
      src/Chamilo/CoreBundle/Resources/views/default/skill/nested.html.twig
  20. 35 28
      src/Chamilo/CoreBundle/Resources/views/default/skill/profile.html.twig
  21. 9 3
      src/Chamilo/CoreBundle/Resources/views/default/skill/profile_item.html.twig
  22. 16 0
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_info.html.twig
  23. 0 0
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_ranking.html.twig
  24. 185 175
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_tree.html.twig
  25. 0 0
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_tree_student.html.twig
  26. 53 39
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_wheel.html.twig
  27. 2 2
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_wheel.js.html.twig
  28. 41 26
      src/Chamilo/CoreBundle/Resources/views/default/skill/skill_wheel_student.html.twig
  29. 12 10
      src/Chamilo/CoreBundle/Resources/views/default/skill/student_boss_report.html.twig
  30. 6 6
      src/Chamilo/CoreBundle/Resources/views/default/skill/student_report.html.twig
  31. 5 5
      src/Chamilo/CoreBundle/Resources/views/default/skill/user_skills.tpl

+ 13 - 11
main/admin/skills_wheel.php

@@ -21,7 +21,7 @@ $htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js');
 $htmlHeadXtra[] = api_get_js('d3/colorbrewer.js');
 $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
 
-$tpl = new Template(null, false, false);
+$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
 
 $load_user = 0;
 if (isset($_GET['load_user'])) {
@@ -29,17 +29,19 @@ if (isset($_GET['load_user'])) {
 }
 
 $skill_condition = '';
+$tpl->addGlobal('skill_id_to_load', '');
 if (isset($_GET['skill_id'])) {
-    $skill_condition = '&skill_id='.intval($_GET['skill_id']);
-    $tpl->assign('skill_id_to_load', $_GET['skill_id']);
+    $skillId = intval($_GET['skill_id']);
+    $skill_condition = '&skill_id='.$skillId;
+    $tpl->addGlobal('skill_id_to_load', $skillId);
 }
 
 $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
-$tpl->assign('wheel_url', $url);
+$tpl->addGlobal('wheel_url', $url);
 
 $url  = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
-$tpl->assign('url', $url);
-$tpl->assign('isAdministration', true);
+$tpl->addGlobal('url', $url);
+$tpl->addGlobal('isAdministration', true);
 
 $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
 $dialogForm->addLabel(
@@ -63,14 +65,14 @@ $dialogForm->addLabel(
     Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
 );
 
-$tpl->assign('dialogForm', $dialogForm->returnForm());
+$tpl->addGlobal('dialogForm', $dialogForm->returnForm());
 
 $saveProfileForm = new FormValidator('form', 'post', null, null, ['id' => 'dialog-form-profile']);
 $saveProfileForm->addHidden('profile_id', null);
 $saveProfileForm->addText('name', get_lang('Name'), true, ['id' => 'name_profile']);
 $saveProfileForm->addTextarea('description', get_lang('Description'), ['id' => 'description_profile', 'rows' => 6]);
-$tpl->assign('saveProfileForm', $saveProfileForm->returnForm());
+$tpl->addGlobal('saveProfileForm', $saveProfileForm->returnForm());
+
+echo $tpl->render('@template_style/skill/skill_wheel.html.twig');
+
 
-$content = $tpl->fetch('default/skill/skill_wheel.tpl');
-$tpl->assign('content', $content);
-$tpl->display_no_layout_template();

+ 10 - 8
main/gradebook/my_certificates.php

@@ -25,14 +25,16 @@ if (empty($courseList) && empty($sessionList)) {
     );
 }
 
-$template = new Template(get_lang('MyCertificates'));
+//$template = new Template(get_lang('MyCertificates'));
 
-$template->assign('course_list', $courseList);
-$template->assign('session_list', $sessionList);
-$content = $template->fetch('default/gradebook/my_certificates.tpl');
+$template = \Chamilo\CoreBundle\Framework\Container::getTwig();
 
-if (api_get_setting('allow_public_certificates') == 'true') {
-    $template->assign(
+$template->addGlobal('course_list', $courseList);
+$template->addGlobal('session_list', $sessionList);
+
+
+if (api_get_setting('course.allow_public_certificates') == 'true') {
+    $template->addGlobal(
         'actions',
         Display::toolbarButton(
             get_lang('SearchCertificates'),
@@ -43,5 +45,5 @@ if (api_get_setting('allow_public_certificates') == 'true') {
     );
 }
 
-$template->assign('content', $content);
-$template->display_one_col_template();
+echo $template->render('@template_style/gradebook/my_certificates.html.twig');
+

+ 12 - 16
main/gradebook/search.php

@@ -12,11 +12,9 @@ $cidReset = true;
 
 //require_once '../inc/global.inc.php';
 
-if (api_get_setting('allow_public_certificates') != 'true') {
-    api_not_allowed(
-        true,
-        Display::return_message(get_lang('CertificatesNotPublic'), 'warning')
-    );
+if (api_get_setting('course.allow_public_certificates') != 'true') {
+    Display::return_message(get_lang('CertificatesNotPublic'), 'warning');
+    api_not_allowed();
 }
 
 $userId = isset($_GET['id']) ? intval($_GET['id']) : 0;
@@ -70,17 +68,15 @@ if ($searchForm->validate()) {
     }
 }
 
-$template = new Template(get_lang('SearchCertificates'));
+//$template = new Template(get_lang('SearchCertificates'));
+$template = \Chamilo\CoreBundle\Framework\Container::getTwig();
 
-$template->assign('search_form', $searchForm->returnForm());
-$template->assign('user_list', $userList);
-$template->assign('user_info', $userInfo);
-$template->assign('course_list', $courseList);
-$template->assign('session_list', $sessionList);
+$template->addGlobal('search_form', $searchForm->returnForm());
+$template->addGlobal('user_list', $userList);
+$template->addGlobal('user_info', $userInfo);
+$template->addGlobal('course_list', $courseList);
+$template->addGlobal('session_list', $sessionList);
+$template->addGlobal('header', get_lang('SearchCertificates'));
 
-$content = $template->fetch('default/gradebook/search.tpl');
+echo $template->render('@template_style/gradebook/search.html.twig');
 
-$template->assign('header', get_lang('SearchCertificates'));
-$template->assign('content', $content);
-
-$template->display_one_col_template();

+ 1 - 1
main/inc/lib/certificate.lib.php

@@ -377,7 +377,7 @@ class Certificate extends Model
         // Special rules for anonymous users
         $failed = false;
         if (api_is_anonymous()) {
-            if (api_get_setting('allow_public_certificates') != 'true') {
+            if (api_get_setting('course.allow_public_certificates') != 'true') {
                 // The "non-public" setting is set, so do not print
                 $failed = true;
             } else {

+ 1 - 1
main/inc/lib/userportal.lib.php

@@ -335,7 +335,7 @@ class IndexManager
 
         $searchItem = null;
 
-        if (api_get_setting('allow_public_certificates') == 'true') {
+        if (api_get_setting('course.allow_public_certificates') == 'true') {
             $searchItem = Display::tag(
                 'li',
                 Display::url(Display::return_icon('search_graduation.png',get_lang('Search'),null,ICON_SIZE_SMALL).

+ 25 - 18
main/social/my_skills_report.php

@@ -24,11 +24,18 @@ $courseTable = Database::get_main_table(TABLE_MAIN_COURSE);
 
 $tableRows = array();
 
-$tpl = new Template(get_lang('Skills'));
+//$tpl = new Template(get_lang('Skills'));
+$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
 $tplPath = null;
 
-$tpl->assign('allowSkillsTool', api_get_setting('skill.allow_skills_tool') == 'true');
-$tpl->assign('allowDrhSkillsManagement', api_get_setting('allow_hr_skills_management') == 'true');
+$tpl->addGlobal(
+    'allowSkillsTool',
+    api_get_setting('skill.allow_skills_tool') == 'true'
+);
+$tpl->addGlobal(
+    'allowDrhSkillsManagement',
+    api_get_setting('gradebook.allow_hr_skills_management') == 'true'
+);
 
 if ($isStudent) {
     $sql = "SELECT s.name, sru.acquired_skill_at, c.title, c.directory
@@ -63,7 +70,7 @@ if ($isStudent) {
         $tableRows[] = $tableRow;
     }
 
-    $tplPath = 'skill/student_report.tpl';
+    $tplPath = 'skill/student_report.html.twig';
 } else if ($isStudentBoss) {
     $selectedStudent = isset($_REQUEST['student']) ? intval($_REQUEST['student']) : 0;
     $tableRows = array();
@@ -109,9 +116,9 @@ if ($isStudent) {
         }
     }
 
-    $tplPath = 'skill/student_boss_report.tpl';
-    $tpl->assign('followedStudents', $followedStudents);
-    $tpl->assign('selectedStudent', $selectedStudent);
+    $tplPath = 'skill/student_boss_report.html.twig';
+    $tpl->addGlobal('followedStudents', $followedStudents);
+    $tpl->addGlobal('selectedStudent', $selectedStudent);
 } else if ($isDRH) {
     $selectedCourse = isset($_REQUEST['course']) ? intval($_REQUEST['course']) : null;
     $selectedSkill = isset($_REQUEST['skill']) ? intval($_REQUEST['skill']) : 0;
@@ -175,19 +182,19 @@ if ($isStudent) {
         }
     }
 
-    $tplPath = 'skill/drh_report.tpl';
+    $tplPath = 'skill/drh_report.html.twig';
 
-    $tpl->assign('action', $action);
-    $tpl->assign('courses', $courses);
-    $tpl->assign('skills', $skills);
-    $tpl->assign('selectedCourse', $selectedCourse);
-    $tpl->assign('selectedSkill', $selectedSkill);
-    $tpl->assign('reportTitle', $reportTitle);
+    $tpl->addGlobal('action', $action);
+    $tpl->addGlobal('courses', $courses);
+    $tpl->addGlobal('skills', $skills);
+    $tpl->addGlobal('selectedCourse', $selectedCourse);
+    $tpl->addGlobal('selectedSkill', $selectedSkill);
+    $tpl->addGlobal('reportTitle', $reportTitle);
 }
 
-$tpl->assign('rows', $tableRows);
+$tpl->addGlobal('rows', $tableRows);
+
+echo $tpl->render("@template_style/".$tplPath);
+
 
-$contentTemplate = $tpl->fetch("default/" . $tplPath);
 
-$tpl->assign('content', $contentTemplate);
-$tpl->display_one_col_template();

+ 0 - 15
main/template/default/skill/skill_info.tpl

@@ -1,15 +0,0 @@
-<p>{{ "ToGetToLearnXYouWillNeedToTakeOneOfTheFollowingCourses" | get_lang | format( "<em>" ~ skill.name ~ "</em>") }}</p>
-
-<ul>
-    {% for course in courses %}
-        <li>
-            <a href="#" class="course_description_popup" rel="{{ course.code }}">{{ "SkillXWithCourseX" | get_lang | format(skill.name, course.title) }}</a>
-        </li>
-    {% endfor %}
-
-    {% for session in sessions %}
-        <li>
-            {{ "SkillXWithCourseX" | get_lang | format(skill.name, session.name) }}
-        </li>
-    {% endfor %}
-</ul>

+ 13 - 15
src/Chamilo/CoreBundle/Menu/CourseMenuBuilder.php

@@ -30,16 +30,22 @@ class CourseMenuBuilder extends ContainerAware
         return $menu;
     }
 
+    /**
+     * @param FactoryInterface $factory
+     * @param array $options
+     * @return \Knp\Menu\ItemInterface
+     */
     public function skillsMenu(FactoryInterface $factory, array $options)
     {
         $security = $this->container->get('security.context');
+        $translator = $this->container->get('translator');
         $menu = $factory->createItem('root');
         if ($security->isGranted('IS_AUTHENTICATED_FULLY')) {
 
             $menu->setChildrenAttribute('class', 'nav nav-pills nav-stacked');
 
             $menu->addChild(
-                'My certificates',
+                $translator->trans('MyCertificates'),
                 [
                     'route' => 'main',
                     'routeParameters' => ['name' => 'gradebook/my_certificates.php'],
@@ -47,34 +53,26 @@ class CourseMenuBuilder extends ContainerAware
             );
 
             $menu->addChild(
-                'My certificates',
+                $translator->trans('Search'),
                 [
                     'route' => 'main',
-                    'routeParameters' => ['name' => 'gradebook/my_certificates.php'],
-                ]
-            );
-
-            $menu->addChild(
-                'Search',
-                [
-                    'route' => 'main',
-                    'routeParameters' => ['name' => 'gradebook/my_certificates.php'],
+                    'routeParameters' => ['name' => 'grgradebook/search.phpadebook/search.php'],
                 ]
             );
 
             $menu->addChild(
-                'My skills',
+                $translator->trans('MySkills'),
                 [
                     'route' => 'main',
-                    'routeParameters' => ['name' => 'gradebook/my_certificates.php'],
+                    'routeParameters' => ['name' => 'social/my_skills_report.php'],
                 ]
             );
 
             $menu->addChild(
-                'Manage skills',
+                $translator->trans('ManageSkills'),
                 [
                     'route' => 'main',
-                    'routeParameters' => ['name' => 'gradebook/my_certificates.php'],
+                    'routeParameters' => ['name' => 'admin/skills_wheel.php'],
                 ]
             );
         }

+ 19 - 16
main/template/default/gradebook/certificate_report.tpl → src/Chamilo/CoreBundle/Resources/views/default/gradebook/certificate_report.html.twig

@@ -12,7 +12,7 @@
             }, function (courseList) {
                 $('<option>', {
                     value: 0,
-                    text: "{{ 'Select' | get_lang }}"
+                    text: "{{ 'Select' | trans }}"
                 }).appendTo($selectCourse);
 
                 if (courseList.length > 0) {
@@ -24,7 +24,7 @@
                     });
                 }
             }, 'json');
-        });
+    });
     });
 </script>
 
@@ -39,11 +39,11 @@
 {% endif %}
 
 {% if not certificateStudents is empty %}
-    <h2 class="page-header">{{ "GradebookListOfStudentsCertificates" | get_lang }}</h2>
+    <h2 class="page-header">{{ "GradebookListOfStudentsCertificates" | trans }}</h2>
     {% if not exportAllLink is null %}
         <div class="actions">
             <a href="{{ exportAllLink }}" class="btn btn-info">
-                <em class="fa fa-check"></em> {{ 'ExportAllCertificatesToPDF' | get_lang }}
+                <em class="fa fa-check"></em> {{ 'ExportAllCertificatesToPDF' | trans }}
             </a>
         </div>
     {% endif %}
@@ -51,20 +51,20 @@
     <table class="table table-striped">
         <thead>
             <tr>
-                <th>{{ 'Student' | get_lang }}</th>
-                <th>{{ 'Sesion' | get_lang }}</th>
-                <th>{{ 'Course' | get_lang }}</th>
-                <th>{{ 'Date' | get_lang }}</th>
-                <th>{{ 'Certificate' | get_lang }}</th>
+                <th>{{ 'Student' | trans }}</th>
+                <th>{{ 'Sesion' | trans }}</th>
+                <th>{{ 'Course' | trans }}</th>
+                <th>{{ 'Date' | trans }}</th>
+                <th>{{ 'Certificate' | trans }}</th>
             </tr>
         </thead>
         <tfoot>
             <tr>
-                <th>{{ 'Student' | get_lang }}</th>
-                <th>{{ 'Sesion' | get_lang }}</th>
-                <th>{{ 'Course' | get_lang }}</th>
-                <th>{{ 'Date' | get_lang }}</th>
-                <th>{{ 'Certificate' | get_lang }}</th>
+                <th>{{ 'Student' | trans }}</th>
+                <th>{{ 'Sesion' | trans }}</th>
+                <th>{{ 'Course' | trans }}</th>
+                <th>{{ 'Date' | trans }}</th>
+                <th>{{ 'Certificate' | trans }}</th>
             </tr>
         </tfoot>
         <tbody>
@@ -80,7 +80,10 @@
                     </td>
                     <td>
                         {% for certificate in student.certificates %}
-                            <a href="{{ _p.web }}certificates/index.php?id={{ certificate.id }}" class="btn btn-default"><em class="fa fa-floppy-o"></em> {{ 'Certificate' | get_lang }}</a>
+                            <a href="{{ _p.web }}certificates/index.php?id={{ certificate.id }}"
+                               class="btn btn-default"><em
+                                        class="fa fa-floppy-o"></em> {{ 'Certificate' | trans }}
+                            </a>
                         {% endfor %}
                     </td>
                 </tr>
@@ -88,5 +91,5 @@
         </tbody>
     </table>
 {% else %}
-    <p class="alert alert-info">{{ 'NoResults' | get_lang }}</p>
+    <p class="alert alert-info">{{ 'NoResults' | trans }}</p>
 {% endif %}

+ 11 - 11
main/template/default/gradebook/my_certificates.tpl → src/Chamilo/CoreBundle/Resources/views/default/gradebook/my_certificates.html.twig

@@ -1,13 +1,13 @@
 {% if course_list is not empty %}
-    <h1 class="page-header">{{ "Courses"|get_lang }}</h1>
+    <h1 class="page-header">{{ "Courses"|trans }}</h1>
 
     <div class="table-responsive">
         <table class="table table-hover table-striped">
             <thead>
                 <tr>
-                    <th>{{ "Course"|get_lang }}</th>
-                    <th class="text-right">{{ "Score"|get_lang }}</th>
-                    <th class="text-center">{{ "Date"|get_lang }}</th>
+                    <th>{{ "Course"|trans }}</th>
+                    <th class="text-right">{{ "Score"|trans }}</th>
+                    <th class="text-center">{{ "Date"|trans }}</th>
                     <th class="text-right">&nbsp;</th>
                 </tr>
             </thead>
@@ -19,7 +19,7 @@
                         <td class="text-center">{{ row.date }}</td>
                         <td class="text-right">
                             <a href="{{ row.link }}" target="_blank" class="btn btn-default">
-                                <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                                <em class="fa fa-external-link"></em> {{ 'Certificate'|trans }}
                             </a>
                         </td>
                     </tr>
@@ -30,16 +30,16 @@
 {% endif %}
 
 {% if session_list is not empty %}
-    <h1 class="page-header">{{ "Sessions"|get_lang }}</h1>
+    <h1 class="page-header">{{ "Sessions"|trans }}</h1>
 
     <div class="table-responsive">
         <table class="table table-hover table-striped">
             <thead>
                 <tr>
-                    <th>{{ "Session"|get_lang }}</th>
-                    <th>{{ "Course"|get_lang }}</th>
-                    <th class="text-right">{{ "Score"|get_lang }}</th>
-                    <th class="text-center">{{ "Date"|get_lang }}</th>
+                    <th>{{ "Session"|trans }}</th>
+                    <th>{{ "Course"|trans }}</th>
+                    <th class="text-right">{{ "Score"|trans }}</th>
+                    <th class="text-center">{{ "Date"|trans }}</th>
                     <th class="text-right">&nbsp;</th>
                 </tr>
             </thead>
@@ -52,7 +52,7 @@
                         <td class="text-center">{{ row.date }}</td>
                         <td class="text-right">
                             <a href="{{ row.link }}" target="_blank" class="btn btn-default">
-                                <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                                <em class="fa fa-external-link"></em> {{ 'Certificate'|trans }}
                             </a>
                         </td>
                     </tr>

+ 18 - 15
main/template/default/gradebook/search.tpl → src/Chamilo/CoreBundle/Resources/views/default/gradebook/search.html.twig

@@ -1,3 +1,4 @@
+{% autoescape false %}
 {{ search_form }}
 
 {% if user_list is not empty %}
@@ -5,8 +6,8 @@
         <table class="table table-hover table-striped">
             <thead>
                 <tr>
-                    <th>{{ "FirstName"|get_lang }}</th>
-                    <th>{{ "LastName"|get_lang }}</th>
+                    <th>{{ "FirstName"|trans }}</th>
+                    <th>{{ "LastName"|trans }}</th>
                     <th class="text-right">&nbsp;</th>
                 </tr>
             </thead>
@@ -16,8 +17,9 @@
                         <td>{{ user.firstname }}</td>
                         <td>{{ user.lastname }}</td>
                         <td class="text-right">
-                            <a href="{{ _p.web_main }}gradebook/search.php?id={{ user.id }}" class="btn btn-default">
-                                <em class="fa fa-external-link"></em> {{ "Certificates"|get_lang }}
+                            <a href="{{ url('web.main') }}gradebook/search.php?id={{ user.id }}"
+                               class="btn btn-default">
+                                <em class="fa fa-external-link"></em> {{ "Certificates"|trans }}
                             </a>
                         </td>
                     </tr>
@@ -31,15 +33,15 @@
     <h2>{{ user_info.complete_name }}</h2>
 
     {% if course_list is not empty %}
-        <h3 class="page-header">{{ "Courses"|get_lang }}</h3>
+        <h3 class="page-header">{{ "Courses"|trans }}</h3>
 
         <div class="table-responsive">
             <table class="table table-hover table-striped">
                 <thead>
                     <tr>
-                        <th>{{ "Course"|get_lang }}</th>
-                        <th class="text-right">{{ "Score"|get_lang }}</th>
-                        <th class="text-center">{{ "Date"|get_lang }}</th>
+                        <th>{{ "Course"|trans }}</th>
+                        <th class="text-right">{{ "Score"|trans }}</th>
+                        <th class="text-center">{{ "Date"|trans }}</th>
                         <th class="text-right">&nbsp;</th>
                     </tr>
                 </thead>
@@ -51,7 +53,7 @@
                             <td class="text-center">{{ row.date }}</td>
                             <td class="text-right">
                                 <a href="{{ row.link }}" target="_blank" class="btn btn-default">
-                                    <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                                    <em class="fa fa-external-link"></em> {{ 'Certificate'|trans }}
                                 </a>
                             </td>
                         </tr>
@@ -62,16 +64,16 @@
     {% endif %}
 
     {% if session_list is not empty %}
-        <h3 class="page-header">{{ "Sessions"|get_lang }}</h3>
+        <h3 class="page-header">{{ "Sessions"|trans }}</h3>
 
         <div class="table-responsive">
             <table class="table table-hover table-striped">
                 <thead>
                     <tr>
-                        <th>{{ "Session"|get_lang }}</th>
-                        <th>{{ "Course"|get_lang }}</th>
-                        <th class="text-right">{{ "Score"|get_lang }}</th>
-                        <th class="text-center">{{ "Date"|get_lang }}</th>
+                        <th>{{ "Session"|trans }}</th>
+                        <th>{{ "Course"|trans }}</th>
+                        <th class="text-right">{{ "Score"|trans }}</th>
+                        <th class="text-center">{{ "Date"|trans }}</th>
                         <th class="text-right">&nbsp;</th>
                     </tr>
                 </thead>
@@ -84,7 +86,7 @@
                             <td class="text-center">{{ row.date }}</td>
                             <td class="text-right">
                                 <a href="{{ row.link }}" target="_blank" class="btn btn-default">
-                                    <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                                    <em class="fa fa-external-link"></em> {{ 'Certificate'|trans }}
                                 </a>
                             </td>
                         </tr>
@@ -94,3 +96,4 @@
         </div>
     {% endif %}
 {% endif %}
+{% endautoescape %}

+ 15 - 12
main/template/default/skill/badge.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/badge.html.twig

@@ -2,24 +2,27 @@
     <div class="openbadges-tabs">
         <ul class="nav nav-tabs">
             <li class="active">
-                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ url('web.main') }}admin/skill_badge.php">{{ 'Home' | trans }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ "CurrentBadges" | get_lang }}</a>
+                <a href="{{ url('web.main') }}admin/skill_badge_list.php">{{ "CurrentBadges" | trans }}</a>
             </li>
         </ul>
     </div>
     <div class="tab-content">
         <div class="tab-pane active">
             <div class="openbadges-introduction">
-                <h1 class="title"><img src="{{ 'badges.png' | icon(64) }}" width="64" height="64">{{ 'OpenBadgesTitle' | get_lang }}</h1>
+                <h1 class="title"><img src="{{ 'badges.png' | icon(64) }}"
+                                       width="64"
+                                       height="64">{{ 'OpenBadgesTitle' | trans }}
+                </h1>
                 <div class="row">
                     <div class="col-xs-12 col-md-6">
                         <p class="lead">
-                            {{ 'OpenBadgesBannerText' | get_lang }}
+                            {{ 'OpenBadgesBannerText' | trans }}
                         </p>
                         <p class="lead">
-                            {{ 'OpenBadgesIntroduction' | get_lang }}
+                            {{ 'OpenBadgesIntroduction' | trans }}
                         </p>
                     </div>
                     <div class="col-xs-12 col-md-6">
@@ -27,18 +30,18 @@
                     </div>
                 </div>
 
-                <h3 class="sub-title">{{ 'OpenBadgesActionCall' | get_lang }}</h3>
+                <h3 class="sub-title">{{ 'OpenBadgesActionCall' | trans }}</h3>
                 <div class="block-content">
-                    <div class="block-title">{{ 'IssuerDetails' | get_lang }}</div>
+                    <div class="block-title">{{ 'IssuerDetails' | trans }}</div>
 
-                    <p>{{ 'Name' | get_lang }} : {{ _s.institution }}</p>
-                    <p>{{ 'URL' | get_lang }} : {{ _p.web }}</p>
+                    <p>{{ 'Name' | trans }} : {{ _s.institution }}</p>
+                    <p>{{ 'URL' | trans }} : {{ _p.web }}</p>
 
-                    <div class="block-title">{{ 'BackpackDetails' | get_lang }}</div>
+                    <div class="block-title">{{ 'BackpackDetails' | trans }}</div>
 
-                    <p>{{ 'URL' | get_lang }} : {{ backpack }}</p>
+                    <p>{{ 'URL' | trans }} : {{ backpack }}</p>
 
-                    <p>{{ 'TheBadgesWillBeSentToThatBackpack' | get_lang }}</p>
+                    <p>{{ 'TheBadgesWillBeSentToThatBackpack' | trans }}</p>
 
                 </div>
             </div>

+ 34 - 14
main/template/default/skill/badge_create.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/badge_create.html.twig

@@ -45,13 +45,13 @@
     <div class="openbadges-tabs">
         <ul class="nav nav-tabs">
             <li>
-                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ url('web.main') }}admin/skill_badge.php">{{ 'Home' | trans }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ "CurrentBadges" | get_lang }}</a>
+                <a href="{{ url('web.main') }}admin/skill_badge_list.php">{{ "CurrentBadges" | trans }}</a>
             </li>
             <li class="active">
-                <a href="#">{{ 'Edit' | get_lang }}</a>
+                <a href="#">{{ 'Edit' | trans }}</a>
             </li>
         </ul>
     </div>
@@ -62,7 +62,7 @@
                 <div class="row">
                     <div class="col-md-12">
                         <div class="block-edit">
-                            <div class="block-title">{{ 'SkillInfo' | get_lang }}</div>
+                            <div class="block-title">{{ 'SkillInfo' | trans }}</div>
                         </div>
                     </div>
                 </div>
@@ -72,25 +72,35 @@
                             <fieldset>
 
                                 <div class="form-group">
-                                    <label class="col-sm-2 control-label" for="name">{{ 'Name' | get_lang }}</label>
+                                    <label class="col-sm-2 control-label"
+                                           for="name">{{ 'Name' | trans }}</label>
                                     <div class="col-sm-10">
                                         <input type="text" name="name" id="name" class="form-control" value="{{ skill.name }}">
                                     </div>
                                 </div>
                                 <div class="form-group">
-                                    <label class="col-sm-2 control-label" for="name">{{ 'Description' | get_lang }}</label>
+                                    <label class="col-sm-2 control-label"
+                                           for="name">{{ 'Description' | trans }}</label>
                                     <div class="col-sm-10">
                                         <textarea name="description" id="description" class="form-control" rows="4">{{ skill.description }}</textarea>
                                     </div>
                                 </div>
                                 <div class="form-group">
-                                    <label class="col-sm-2 control-label" for="image">{{ 'Image' | get_lang }}</label>
+                                    <label class="col-sm-2 control-label"
+                                           for="image">{{ 'Image' | trans }}</label>
                                     <div class="col-sm-10">
-                                        <input data-placement="left" data-toggle="tooltip" title="{{ "BadgeMeasuresXPixelsInPNG" | get_lang }}" type="file" name="image" id="image" class="help-badges-img" accept="image/*">
+                                        <input data-placement="left"
+                                               data-toggle="tooltip"
+                                               title="{{ "BadgeMeasuresXPixelsInPNG" | trans }}"
+                                               type="file" name="image"
+                                               id="image"
+                                               class="help-badges-img"
+                                               accept="image/*">
                                     </div>
                                 </div>
                                 <div class="form-group">
-                                    <label class="col-sm-2 control-label" for="criteria">{{ 'CriteriaToEarnTheBadge' | get_lang }}</label>
+                                    <label class="col-sm-2 control-label"
+                                           for="criteria">{{ 'CriteriaToEarnTheBadge' | trans }}</label>
                                     <div class="col-sm-10">
                                         <textarea name="criteria" id="criteria" class="form-control" rows="10">{{ skill.criteria }}</textarea>
                                     </div>
@@ -98,20 +108,30 @@
                             </fieldset>
                             <div class="form-group">
                                 <div class="col-sm-offset-2 col-sm-10">
-                                    <button type="submit" class="btn btn-primary btn-large"><em class="fa fa-floppy-o"></em> {{ 'SaveBadge'| get_lang }}</button>
+                                    <button type="submit"
+                                            class="btn btn-primary btn-large">
+                                        <em class="fa fa-floppy-o"></em> {{ 'SaveBadge'| trans }}
+                                    </button>
                                 </div>
                             </div>
                         </form>
                     </div>
                     <div class="col-md-3">
                         <div class="create-openbadges">
-                            <button id="btn-open-designer" class="help-badges btn btn-primary btn-large btn-block" data-toggle="tooltip" data-placement="bottom" title="{{ 'DesignANewBadgeComment' | get_lang }}" type="button">
-                                <em class="fa fa-plus"></em> {{ 'DesignNewBadge' | get_lang }}
+                            <button id="btn-open-designer"
+                                    class="help-badges btn btn-primary btn-large btn-block"
+                                    data-toggle="tooltip"
+                                    data-placement="bottom"
+                                    title="{{ 'DesignANewBadgeComment' | trans }}"
+                                    type="button">
+                                <em class="fa fa-plus"></em> {{ 'DesignNewBadge' | trans }}
                             </button>
                         </div>
-                        <p class="openbadges-text">{{'BadgePreview' | get_lang }}</p>
+                        <p class="openbadges-text">{{ 'BadgePreview' | trans }}</p>
                         <div class="openbadges-img {{ skill.icon ? '' : 'hide' }}" id="badge-container">
-                            <img id="badge-preview" alt="{{ 'BadgePreview' | get_lang }}" src="{{ skill.icon ? skill.web_icon_path : '' }}">
+                            <img id="badge-preview"
+                                 alt="{{ 'BadgePreview' | trans }}"
+                                 src="{{ skill.icon ? skill.web_icon_path : '' }}">
                         </div>
                     </div>
                 </div>

+ 10 - 7
main/template/default/skill/badge_list.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/badge_list.html.twig

@@ -2,10 +2,10 @@
     <div class="openbadges-tabs">
         <ul class="nav nav-tabs">
             <li>
-                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ url('web.main') }}admin/skill_badge.php">{{ 'Home' | trans }}</a>
             </li>
             <li class="active">
-                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ "CurrentBadges" | get_lang }}</a>
+                <a href="{{ url('web.main') }}admin/skill_badge_list.php">{{ "CurrentBadges" | trans }}</a>
             </li>
         </ul>
     </div>
@@ -21,9 +21,9 @@
                     <table class="table">
                         <thead>
                             <tr>
-                                <th>{{ 'Name' | get_lang }}</th>
-                                <th>{{ 'Description' | get_lang }}</th>
-                                <th>{{ 'Actions' | get_lang }}</th>
+                                <th>{{ 'Name' | trans }}</th>
+                                <th>{{ 'Description' | trans }}</th>
+                                <th>{{ 'Actions' | trans }}</th>
                             </tr>
                         </thead>
                         <tbody>
@@ -40,8 +40,11 @@
                                 </td>
                                 <td>{{ skill.description }}</td>
                                 <td>
-                                    <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" title="{{ 'Edit' | get_lang }}">
-                                        <img src="{{ 'edit.png' | icon(22) }}" width="22" height="22" alt="{{ 'Edit' | get_lang }}">
+                                    <a href="{{ url('web.main') }}admin/skill_badge_create.php?id={{ skill.id }}"
+                                       title="{{ 'Edit' | trans }}">
+                                        <img src="{{ 'edit.png' | icon(22) }}"
+                                             width="22" height="22"
+                                             alt="{{ 'Edit' | trans }}">
                                     </a>
                                 </td>
                             </tr>

+ 4 - 4
main/template/default/skill/criteria.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/criteria.html.twig

@@ -1,4 +1,4 @@
-<h2 class="page-header">{{ 'BadgeDetails'|get_lang }}</h2>
+<h2 class="page-header">{{ 'BadgeDetails'|trans }}</h2>
 <article>
     <div class="row">
         <div class="col-md-3">
@@ -13,11 +13,11 @@
             </figure>
         </div>
         <div class="col-md-9">
-            <h4 class="title-badge">{{ 'Name'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'Name'|trans }}</h4>
             <p class="lead">{{ skill_info.name }}</p>
-            <h4 class="title-badge">{{ 'Description'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'Description'|trans }}</h4>
             <p>{{ skill_info.description }}</p>
-            <h4 class="title-badge">{{ 'CriteriaToEarnTheBadge'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'CriteriaToEarnTheBadge'|trans }}</h4>
             <p>{{ skill_info.criteria }}</p>
         </div>
     </div>

+ 23 - 18
main/template/default/skill/drh_report.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/drh_report.html.twig

@@ -1,37 +1,42 @@
 {% if allowSkillsTool %}
     <div class="btn-group">
-        <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">{{ 'SkillsWheel' | get_lang }}</a>
+        <a class="btn btn-default"
+           href="{{ url('web.main') }}social/skills_wheel.php">{{ 'SkillsWheel' | trans }}</a>
         {% if allowDrhSkillsManagement %}
-            <a class="btn btn-default" href="{{ _p.web_main }}admin/skills_wheel.php">{{ 'ManageSkills' | get_lang }}</a>
+            <a class="btn btn-default"
+               href="{{ url('web.main') }}admin/skills_wheel.php">{{ 'ManageSkills' | trans }}</a>
         {% endif %}
     </div>
 {% endif %}
 
-<h1 class="page-header">{{ 'Skills' | get_lang }}</h1>
+<h1 class="page-header">{{ 'Skills' | trans }}</h1>
 
 <div class="row">
     <div class="col-md-6">
         <form class="form-inline" method="post" action="{{ _p.web_self }}">
-            <label for="course">{{ 'Courses' | get_lang }}</label>
+            <label for="course">{{ 'Courses' | trans }}</label>
             <select name="course" id="course">
-                <option value="0">{{ 'Select' | get_lang }}</option>
+                <option value="0">{{ 'Select' | trans }}</option>
                 {% for course in courses %}
                     <option value="{{ course.id }}" {{ (course.id == selectedCourse) ? 'selected' : '' }}>{{ course.title }}</option>
                 {% endfor %}
             </select>
-            <button type="submit" class="btn btn-default">{{ 'Filter' | get_lang }}</button>
+            <button type="submit"
+                    class="btn btn-default">{{ 'Filter' | trans }}</button>
         </form>
     </div>
     <div class="col-md-6">
         <form class="form-inline" method="post" action="{{ _p.web_self }}">
-            <label for="skill">{{ 'Skills' | get_lang }}</label>
+            <label for="skill">{{ 'Skills' | trans }}</label>
             <select name="skill" id="skill">
-                <option value="0">{{ 'Select' | get_lang }}</option>
+                <option value="0">{{ 'Select' | trans }}</option>
                 {% for skill in skills %}
                     <option value="{{ skill.id }}" {{ (skill.id == selectedSkill) ? 'selected' : '' }}>{{ skill.name }}</option>
                 {% endfor %}
             </select>
-            <button type="submit" class="btn btn-default"><em class="fa fa-filter"></em>{{ 'Filter' | get_lang }}</button>
+            <button type="submit" class="btn btn-default"><em
+                        class="fa fa-filter"></em>{{ 'Filter' | trans }}
+            </button>
         </form>
     </div>
 </div>
@@ -43,15 +48,15 @@
         <thead>
             <tr>
                 {% if action == 'filterByCourse' %}
-                    <th>{{ 'Course' | get_lang }}</th>
-                    <th>{{ 'Skill' | get_lang }}</th>
-                    <th>{{ 'Student' | get_lang }}</th>
-                    <th>{{ 'Date' | get_lang }}</th>
+                    <th>{{ 'Course' | trans }}</th>
+                    <th>{{ 'Skill' | trans }}</th>
+                    <th>{{ 'Student' | trans }}</th>
+                    <th>{{ 'Date' | trans }}</th>
                 {% elseif action == 'filterBySkill' %}
-                    <th>{{ 'Skill' | get_lang }}</th>
-                    <th>{{ 'Student' | get_lang }}</th>
-                    <th>{{ 'Date' | get_lang }}</th>
-                    <th>{{ 'Course' | get_lang }}</th>
+                    <th>{{ 'Skill' | trans }}</th>
+                    <th>{{ 'Student' | trans }}</th>
+                    <th>{{ 'Date' | trans }}</th>
+                    <th>{{ 'Course' | trans }}</th>
                 {% endif %}
             </tr>
         </thead>
@@ -75,6 +80,6 @@
     </table>
 {% else %}
     <div class="alert alert-info">
-        {{ 'NoResults' | get_lang }}
+        {{ 'NoResults' | trans }}
     </div>
 {% endif %}

+ 11 - 11
main/template/default/skill/issued.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/issued.html.twig

@@ -7,23 +7,23 @@
             </figcaption>
         </figure>
             <div class="panel panel-default">
-                <div class="panel-heading">{{ 'SkillAcquiredAt'|get_lang }}</div>
+                <div class="panel-heading">{{ 'SkillAcquiredAt'|trans }}</div>
                 <div class="panel-body">
                     {% for course in skill_info.courses %}
                     <p>
                         {% if course.name %}
-                            <em class="fa fa-clock-o fa-fw"></em> {{ 'TimeXThroughCourseY'|get_lang|format(course.date_issued, course.name) }}
+                            <em class="fa fa-clock-o fa-fw"></em> {{ 'TimeXThroughCourseY'|trans|format(course.date_issued, course.name) }}
                         {% else %}
                             <em class="fa fa-clock-o fa-fw"></em> {{ course.date_issued }}
                         {% endif %}
                     </p>
                     {% endfor %}
                 </div>
-            </div>    
+            </div>
         {% if allow_export %}
             <p class="text-center">
                 <a href="#" class="btn btn-success" id="badge-export-button">
-                    <em class="fa fa-external-link-square fa-fw"></em> {{ 'ExportBadge'|get_lang }}
+                    <em class="fa fa-external-link-square fa-fw"></em> {{ 'ExportBadge'|trans }}
                 </a>
             </p>
         {% endif %}
@@ -31,18 +31,18 @@
     <div class="col-md-8">
         <div class="panel panel-default">
         <div class="panel-body">
-        <h4 class="title-badge">{{ 'RecipientDetails'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'RecipientDetails'|trans }}</h4>
         <p class="lead">{{ user_info.complete_name }}</p>
-        <h4 class="title-badge">{{ 'BadgeDetails'|get_lang }}</h4>
-        <h4 class="title-badge">{{ 'Name'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'BadgeDetails'|trans }}</h4>
+            <h4 class="title-badge">{{ 'Name'|trans }}</h4>
         <p>{{ skill_info.name }}</p>
         {% if skill_info.short_code %}
-            <h4 class="title-badge">{{ 'ShortCode'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'ShortCode'|trans }}</h4>
             <p>{{ skill_info.short_code }}</p>
         {% endif %}
-        <h4 class="title-badge">{{ 'Description'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'Description'|trans }}</h4>
         <p>{{ skill_info.description }}</p>
-        <h4 class="title-badge">{{ 'CriteriaToEarnTheBadge'|get_lang }}</h4>
+            <h4 class="title-badge">{{ 'CriteriaToEarnTheBadge'|trans }}</h4>
         <p>{{ skill_info.criteria }}</p>
         </div>
         </div>
@@ -58,4 +58,4 @@
             });
         });
     </script>
-{% endif %}
+{% endif %}

+ 20 - 14
main/template/default/skill/list.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/list.html.twig

@@ -1,25 +1,25 @@
 <legend>
-    <h1>{{ "ManageSkills" | get_lang }}</h1>
+    <h1>{{ "ManageSkills" | trans }}</h1>
 </legend>
 
 <div class="table table-responsive">
     <table class="table table-hover table-striped">
         <thead>
             <tr>
-                <th>{{ "Badges" | get_lang }}</th>
-                <th>{{ "Name" | get_lang }}</th>
-                <th class="text-center">{{ "ShortCode" | get_lang }}</th>
-                <th class="text-center">{{ "Description" | get_lang }}</th>
-                <th class="text-center">{{ "Options" | get_lang }}</th>
+                <th>{{ "Badges" | trans }}</th>
+                <th>{{ "Name" | trans }}</th>
+                <th class="text-center">{{ "ShortCode" | trans }}</th>
+                <th class="text-center">{{ "Description" | trans }}</th>
+                <th class="text-center">{{ "Options" | trans }}</th>
             </tr>
         </thead>
         <tfoot>
             <tr>
-                <th>{{ "Badges" | get_lang }}</th>
-                <th>{{ "Name" | get_lang }}</th>
-                <th class="text-center">{{ "ShortCode" | get_lang }}</th>
-                <th class="text-center">{{ "Description" | get_lang }}</th>
-                <th class="text-center">{{ "Options" | get_lang }}</th>
+                <th>{{ "Badges" | trans }}</th>
+                <th>{{ "Name" | trans }}</th>
+                <th class="text-center">{{ "ShortCode" | trans }}</th>
+                <th class="text-center">{{ "Description" | trans }}</th>
+                <th class="text-center">{{ "Options" | trans }}</th>
             </tr>
         </tfoot>
         <tbody>
@@ -37,13 +37,19 @@
                     <td class="text-center">{{ skill.short_code }}</td>
                     <td width="500">{{ skill.description }}</td>
                     <td class="text-right">
-                        <a href="{{ _p.web_main }}admin/skill_edit.php?id={{ skill.id }}" class="btn btn-primary btn-sm" title="{{ "Edit" | get_lang }}">
+                        <a href="{{ url('web.main') }}admin/skill_edit.php?id={{ skill.id }}"
+                           class="btn btn-primary btn-sm"
+                           title="{{ "Edit" | trans }}">
                             <em class="fa fa-edit fa-fw"></em>
                         </a>
-                        <a href="{{ _p.web_main }}admin/skill_create.php?parent={{ skill.id }}" class="btn btn-primary btn-sm" title="{{ "CreateChildSkill" | get_lang }}">
+                        <a href="{{ url('web.main') }}admin/skill_create.php?parent={{ skill.id }}"
+                           class="btn btn-primary btn-sm"
+                           title="{{ "CreateChildSkill" | trans }}">
                             <em class="fa fa-plus fa-fw"></em>
                         </a>
-                        <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" class="btn btn-primary btn-sm" title="{{ "CreateBadge" | get_lang }}">
+                        <a href="{{ url('web.main') }}admin/skill_badge_create.php?id={{ skill.id }}"
+                           class="btn btn-primary btn-sm"
+                           title="{{ "CreateBadge" | trans }}">
                             <em class="fa fa-shield fa-fw"></em>
                         </a>
 

+ 19 - 14
main/template/default/skill/nested.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/nested.html.twig

@@ -17,13 +17,18 @@
             <td class="text-center">{{ skill.short_code }}</td>
             <td width="500">{{ skill.description }}</td>
             <td class="text-right">
-                <a href="{{ _p.web_main }}admin/skill_edit.php?id={{ skill.id }}" class="btn btn-primary btn-sm" title="{{ "Edit" | get_lang }}">
+                <a href="{{ url('web.main') }}admin/skill_edit.php?id={{ skill.id }}"
+                   class="btn btn-primary btn-sm" title="{{ "Edit" | trans }}">
                     <em class="fa fa-edit fa-fw"></em>
                 </a>
-                <a href="{{ _p.web_main }}admin/skill_create.php?parent={{ skill.id }}" class="btn btn-primary btn-sm" title="{{ "CreateChildSkill" | get_lang }}">
+                <a href="{{ url('web.main') }}admin/skill_create.php?parent={{ skill.id }}"
+                   class="btn btn-primary btn-sm"
+                   title="{{ "CreateChildSkill" | trans }}">
                     <em class="fa fa-plus fa-fw"></em>
                 </a>
-                <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" class="btn btn-primary btn-sm" title="{{ "CreateBadge" | get_lang }}">
+                <a href="{{ url('web.main') }}admin/skill_badge_create.php?id={{ skill.id }}"
+                   class="btn btn-primary btn-sm"
+                   title="{{ "CreateBadge" | trans }}">
                     <em class="fa fa-shield fa-fw"></em>
                 </a>
 
@@ -46,27 +51,27 @@
 
 {% import _self as macros %}
 <legend>
-    <h1>{{ "ManageSkills" | get_lang }}</h1>
+    <h1>{{ "ManageSkills" | trans }}</h1>
 </legend>
 
 <div class="table table-responsive">
     <table class="table table-hover table-striped collaptable">
         <thead>
             <tr>
-                <th>{{ "Badges" | get_lang }}</th>
-                <th>{{ "Name" | get_lang }}</th>
-                <th class="text-center">{{ "ShortCode" | get_lang }}</th>
-                <th class="text-center">{{ "Description" | get_lang }}</th>
-                <th class="text-center">{{ "Options" | get_lang }}</th>
+                <th>{{ "Badges" | trans }}</th>
+                <th>{{ "Name" | trans }}</th>
+                <th class="text-center">{{ "ShortCode" | trans }}</th>
+                <th class="text-center">{{ "Description" | trans }}</th>
+                <th class="text-center">{{ "Options" | trans }}</th>
             </tr>
         </thead>
         <tfoot>
             <tr>
-                <th>{{ "Badges" | get_lang }}</th>
-                <th>{{ "Name" | get_lang }}</th>
-                <th class="text-center">{{ "ShortCode" | get_lang }}</th>
-                <th class="text-center">{{ "Description" | get_lang }}</th>
-                <th class="text-center">{{ "Options" | get_lang }}</th>
+                <th>{{ "Badges" | trans }}</th>
+                <th>{{ "Name" | trans }}</th>
+                <th class="text-center">{{ "ShortCode" | trans }}</th>
+                <th class="text-center">{{ "Description" | trans }}</th>
+                <th class="text-center">{{ "Options" | trans }}</th>
             </tr>
         </tfoot>
         <tbody>

+ 35 - 28
main/template/default/skill/profile.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/profile.html.twig

@@ -1,28 +1,30 @@
 {% if search_skill_list is not null %}
     <div class="skills-skills">
-        <h3>{{"Skills"|get_lang}}</h3>
-        <ul class="holder">             
-            {% for search_skill_id in search_skill_list %}        
+        <h3>{{ "Skills"|trans }}</h3>
+        <ul class="holder">
+            {% for search_skill_id in search_skill_list %}
                 <li class="bit-box">
                     {{ skill_list[search_skill_id].name}}
                     <a class="closebutton" href="?a=remove_skill&id={{search_skill_id}}"></a>
-                </li>        
+                </li>
             {% endfor %}
         </ul>
-        <a id="add_profile" class="btn btn-default" href="#"><em class="fa fa-floppy-o"></em> {{"SaveThisSearch"|get_lang}}</a>
+        <a id="add_profile" class="btn btn-default" href="#"><em
+                    class="fa fa-floppy-o"></em> {{ "SaveThisSearch"|trans }}
+        </a>
     </div>
 {% endif %}
 
-{% if profiles is not null %}    
+{% if profiles is not null %}
     <div class="skills-profiles">
-        <h3>{{"SkillProfiles"|get_lang}}</h3>
+        <h3>{{ "SkillProfiles"|trans }}</h3>
         <ul class="holder">
-            {%for profile in profiles %}        
+            {% for profile in profiles %}
                 <li class="bit-box">
                     <a href="?a=load_profile&id={{profile.id}}">{{profile.name}}</a>
-                </li>        
+                </li>
             {% endfor %}
-        </ul>    
+        </ul>
     </div>
 {% endif %}
 
@@ -32,12 +34,12 @@
             <div class="col-md-12">
                 <h4 class="page-header">
                     {% if count == total_search_skills %}
-                        {{ "CompleteMatch"|get_lang }}
+                        {{ "CompleteMatch"|trans }}
                     {% else %}
                         {% if (total_search_skills - count) == 1 %}
-                            {{ "MissingOneStepToMatch"|get_lang }}
+                            {{ "MissingOneStepToMatch"|trans }}
                         {% else %}
-                            {{ "MissingXStepsToMatch"|get_lang | format(total_search_skills - count)}}                        
+                            {{ "MissingXStepsToMatch"|trans | format(total_search_skills - count) }}
                         {% endif %}
                     {% endif %}
                 </h4>
@@ -53,12 +55,15 @@
                             <div class="avatar-user">
                                 <img  class="img-circle" width="100" src="{{ user.user.avatar }}" class="center-block">
                             </div>
-                            <p class="text-center"><em class="fa fa-user"></em> 
-                                <a href="{{ _p.web_main }}social/profile.php?u={{ user['user'].user_id }}" target="_blank">
+                            <p class="text-center"><em class="fa fa-user"></em>
+                                <a href="{{ url('web.main') }}social/profile.php?u={{ user['user'].user_id }}"
+                                   target="_blank">
                                     {{ user['user'].complete_name_with_username }}
                                 </a>
                             </p>
-                            <p class="text-center"><em class="fa fa-graduation-cap"></em> {{ "AchievedSkills"|get_lang }} {{ user.total_found_skills }} / {{ total_search_skills }}</p>
+                            <p class="text-center"><em
+                                        class="fa fa-graduation-cap"></em> {{ "AchievedSkills"|trans }} {{ user.total_found_skills }}
+                                / {{ total_search_skills }}</p>
                         </div>
                         <ul class="list-group">
                             {% for skill_data in user.skills %}
@@ -78,32 +83,34 @@
                             {% endfor %}
                         </ul>
                     </div>
-                    </div>    
+                    </div>
                 </div>
             {% endfor %}
         </div>
     {% endfor %}
 {% else %}
     {% if search_skill_list is null %}
-        <div class="warning-message">{{"NoResults"|get_lang}}</div>
+        <div class="warning-message">{{ "NoResults"|trans }}</div>
     {% endif %}
 {% endif %}
 </div>
-<div id="dialog-form" style="display:none;">    
-    <form id="save_profile_form" class="form-horizontal" name="form">       
+<div id="dialog-form" style="display:none;">
+    <form id="save_profile_form" class="form-horizontal" name="form">
         <fieldset>
-            <div class="control-group">            
-                <label class="control-label" for="name">{{"Name"|get_lang}}</label>            
+            <div class="control-group">
+                <label class="control-label"
+                       for="name">{{ "Name"|trans }}</label>
                 <div class="controls">
-                    <input type="text" name="name" id="name" size="40" />             
+                    <input type="text" name="name" id="name" size="40"/>
                 </div>
-            </div>        
-            <div class="control-group">            
-                <label class="control-label" for="name">{{"Description"|get_lang}}</label>            
+            </div>
+            <div class="control-group">
+                <label class="control-label"
+                       for="name">{{ "Description"|trans }}</label>
                 <div class="controls">
                     <textarea name="description" id="description" class="span2"  rows="7"></textarea>
                 </div>
-            </div>  
+            </div>
         </fieldset>
-    </form>    
+    </form>
 </div>

+ 9 - 3
main/template/default/skill/profile_item.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/profile_item.html.twig

@@ -1,5 +1,5 @@
 {% if profiles %}
-    <h4>{{ "SkillProfiles"|get_lang }}</h4>
+    <h4>{{ "SkillProfiles"|trans }}</h4>
     <table class="table table-responsive table-condensed">
         <tbody>
             {%for profile in profiles %}
@@ -7,10 +7,16 @@
                     <td>{{ profile.name }}</td>
                     <td class="text-right">
                         <div class="btn-group btn-group-sm">
-                            <button class="btn btn-default btn-sm skill-wheel-load-profile" aria-label="{{ 'Search'|get_lang }}" title="{{ 'Search'|get_lang }}" data-id="{{ profile.id }}">
+                            <button class="btn btn-default btn-sm skill-wheel-load-profile"
+                                    aria-label="{{ 'Search'|trans }}"
+                                    title="{{ 'Search'|trans }}"
+                                    data-id="{{ profile.id }}">
                                 <span class="fa fa-search" aria-hidden="true"></span>
                             </button>
-                            <button class="btn btn-default btn-sm skill-wheel-delete-profile" aria-label="{{ 'Delete'|get_lang }}" title="{{ 'Delete'|get_lang }}" data-id="{{ profile.id }}">
+                            <button class="btn btn-default btn-sm skill-wheel-delete-profile"
+                                    aria-label="{{ 'Delete'|trans }}"
+                                    title="{{ 'Delete'|trans }}"
+                                    data-id="{{ profile.id }}">
                                 <span class="fa fa-trash" aria-hidden="true"></span>
                             </button>
                         </div>

+ 16 - 0
src/Chamilo/CoreBundle/Resources/views/default/skill/skill_info.html.twig

@@ -0,0 +1,16 @@
+<p>{{ "ToGetToLearnXYouWillNeedToTakeOneOfTheFollowingCourses" | trans | format( "<em>" ~ skill.name ~ "</em>") }}</p>
+
+<ul>
+    {% for course in courses %}
+        <li>
+            <a href="#" class="course_description_popup"
+               rel="{{ course.code }}">{{ "SkillXWithCourseX" | trans | format(skill.name, course.title) }}</a>
+        </li>
+    {% endfor %}
+
+    {% for session in sessions %}
+        <li>
+            {{ "SkillXWithCourseX" | trans | format(skill.name, session.name) }}
+        </li>
+    {% endfor %}
+</ul>

+ 0 - 0
main/template/default/skill/skill_ranking.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/skill_ranking.html.twig


+ 185 - 175
main/template/default/skill/skill_tree.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/skill_tree.html.twig

@@ -1,19 +1,19 @@
 <style>
 /* just because */
-body {    
-    /* fallback */ 
-    background-color: #eee; 
-    background-image: url(images/radial_bg.png); 
-    background-position: center center; 
-    background-repeat: no-repeat; 
-    
-    /* Safari 4-5, Chrome 1-9 */ /* Can't specify a percentage size? Laaaaaame. */ 
-    background: -webkit-gradient(radial, center center, 0, center center, 460, from(#eee), to(#666)); 
-    /* Safari 5.1+, Chrome 10+ */ 
-    background: -webkit-radial-gradient(circle, #eee, #666); 
-    /* Firefox 3.6+ */ 
-    background: -moz-radial-gradient(circle, #eee, #666); 
-    /* IE 10 */ 
+body {
+    /* fallback */
+    background-color: #eee;
+    background-image: url(images/radial_bg.png);
+    background-position: center center;
+    background-repeat: no-repeat;
+
+    /* Safari 4-5, Chrome 1-9 */ /* Can't specify a percentage size? Laaaaaame. */
+    background: -webkit-gradient(radial, center center, 0, center center, 460, from(#eee), to(#666));
+    /* Safari 5.1+, Chrome 10+ */
+    background: -webkit-radial-gradient(circle, #eee, #666);
+    /* Firefox 3.6+ */
+    background: -moz-radial-gradient(circle, #eee, #666);
+    /* IE 10 */
     background: -ms-radial-gradient(circle, #eee, #666);
 }
 </style>
@@ -30,30 +30,30 @@ var space_between_blocks_y  = {{skill_visualizer.space_between_blocks_y}};
 var center_x                = {{skill_visualizer.center_x}};
 var block_size              = {{skill_visualizer.block_size}};
 
-$(window).resize(function() {    
-    jsPlumb.repaintEverything();    
-    /*jsPlumb.repaint(".skill_root");    
+$(window).resize(function () {
+    jsPlumb.repaintEverything();
+    /*jsPlumb.repaint(".skill_root");
     // When resize repaint everything + fix the root position
-    normal_weight = $('.skill_child :first-child').width();                
+     normal_weight = $('.skill_child :first-child').width();
     sum = $('body').width() / 2 - normal_weight/2;
     $('.skill_root').animate({ left: sum, top:0 }, { duration: 100 });*/
 });
 
 jsPlumb.ready(function() {
     //Setting the loading dialog
-    var loading = $( "#dialog-loading" );    
+    var loading = $("#dialog-loading");
     loading.dialog( "destroy" );
     loading.dialog({
         autoOpen:false,
         height: 120,
         modal: true,
         zIndex: 10000,
-        resizable :false,        
+        resizable: false,
         closeOnEscape : false,
-        disabled: true,            
+        disabled: true,
         open: function(event, ui) { $(this).parent().children().children('.ui-dialog-titlebar-close').hide(); }
-    });    
-    
+    });
+
     jQuery.ajaxSetup({
         beforeSend: function() {
             loading.dialog( "open" );
@@ -61,31 +61,31 @@ jsPlumb.ready(function() {
             console.log('before------------------->>');
         },
         complete: function(){
-            loading.dialog( "close" );                    
+            loading.dialog("close");
             //$('#skill_tree').show();
             console.log('complete------------------->>');
         },
         success: function() {}
     });
-        
+
     //Return to root button
     $('#return_to_root').click(function(){
         clean_values();
-        console.log('Clean values');        
+        console.log('Clean values');
         console.log('Reopen the root ');
     });
-    
+
     //Open dialog
     $("#dialog-form").dialog({
         autoOpen: false,
-        modal   : true, 
-        width   : 550, 
+        modal: true,
+        width: 550,
         height  : 480
     });
-    
+
     //Filling skills select
     /*
-    $.getJSON("{{url}}&a=get_skills&parent_id="+parents[0], {},     
+     $.getJSON("{{ url }}&a=get_skills&parent_id="+parents[0], {},
         function(data) {
             $.each(data, function(n, parent) {
                 // add a new option with the JSON-specified value and text
@@ -93,9 +93,9 @@ jsPlumb.ready(function() {
             });
         }
     );*/
-    
+
     //Filling gradebook select
-    $.getJSON("{{url}}&a=get_gradebooks", {},     
+    $.getJSON("{{ url }}&a=get_gradebooks", {},
         function(data) {
             $.each(data, function(n, gradebook) {
                 // add a new option with the JSON-specified value and text
@@ -103,26 +103,25 @@ jsPlumb.ready(function() {
             });
         }
     );
-    
-    //Add button on click    
-    $("#add_item_link").click(function() {     
+
+    //Add button on click
+    $("#add_item_link").click(function () {
         $("#name").attr('value', '');
-        $("#description").attr('value', '');        
+        $("#description").attr('value', '');
         $("#parent_id option:selected").removeAttr('selected');
-        $("#gradebook_id option:selected").removeAttr('selected');               
+        $("#gradebook_id option:selected").removeAttr('selected');
         $("#dialog-form").dialog("open");
-        
+
         //Filling skills select
         var my_id = 1;
-        
+
         if (parents.length > 1) {
-            my_id = parents[1].split('_')[1];            
+            my_id = parents[1].split('_')[1];
         }
         //Remove all options
         $("#parent_id").find('option').remove();
 
-        $.getJSON("{{url}}&a=get_skills&id="+my_id, {
-            },     
+        $.getJSON("{{url}}&a=get_skills&id="+my_id, {},
             function(data) {
                 $.each(data, function(n, parent) {
                     // add a new option with the JSON-specified value and text
@@ -131,219 +130,222 @@ jsPlumb.ready(function() {
             }
         );
     });
-    
+
     //Add button process
-    
+
     var name = $( "#name" ),
-    description = $( "#description" ),  
-    allFields = $( [] ).add( name ).add( description ), tips = $(".validateTips");    
-    
+            description = $("#description"),
+            allFields = $([]).add(name).add(description), tips = $(".validateTips");
+
     $("#dialog-form").css('z-index', '9001');
-    
-    $("#dialog-form").dialog({              
+
+    $("#dialog-form").dialog({
         buttons: {
-            "{{"Add"|get_lang}}" : function() {                
+            "{{ "Add"|trans }}": function () {
                 var bValid = true;
                 bValid = bValid && checkLength( name, "name", 1, 255 );
-                
+
                 if (bValid) {
                     var params = $("#add_item").serialize();
-                          
+
                     $.ajax({
                         async: false,
                         url: url+'&a=add&'+params,
-                        success:function(my_id) {                            
+                        success: function (my_id) {
                             //Setting the selected id from the form
-                            parent_id = $("#parent_id option:selected").attr('value');                            
-                            
+                            parent_id = $("#parent_id option:selected").attr('value');
+
                             //Reseting jsplumb
-                            jsPlumb.reset();                            
+                            jsPlumb.reset();
                             //Deletes all windows
                             $('.skill_root').remove();
                             $('.skill_child').remove();
-                            
+
                             //cleaning skills
                             skills = [];
-                            
+
                             //Setting the first parent
                             first_parent = parents[0];
-                            
+
                             //Deleting the first parent
                             console.log('parents before '+parents);
-                            parents.splice(0,1);     
-                            console.log('parents now '+parents);                            
-                            
-                            //Remove parent block                      
+                            parents.splice(0, 1);
+                            console.log('parents now ' + parents);
+
+                            //Remove parent block
                             $('#block_'+parent_id).remove();
-                            
-                            //Open the block                 
-                            open_block('block_'+parent_id, 0, 1);                            
-                            
+
+                            //Open the block
+                            open_block('block_' + parent_id, 0, 1);
+
                             //Close dialog
-                            $("#dialog-form").dialog("close");                                      
-                        }                           
+                            $("#dialog-form").dialog("close");
+                        }
                     });
                 }
             }
-        },              
-        close: function() {     
+        },
+        close: function () {
             $("#name").attr('value', '');
-            $("#description").attr('value', '');                
+            $("#description").attr('value', '');
         }
     });
-    
+
     //Clicking in a box skill (we use live instead of bind because we're creating divs on the fly )
     $(".open_block").click(function() {
         var id = $(this).attr('id');
-        
+
         console.log('click.open_block id: ' + id);
         console.log('parents: ' + parents);
-        
+
         //if is root
         if (parents[0] == id) {
             parents = [id];
-        }     
-        
+        }
+
         if (parents[1] != id) {
             console.log('parents.length ' +parents.length);
-            
+
             //If there are 2 parents in the skill_tree
             if (parents.length == 2 ) {
-                first_parent = parents[0]; 
+                first_parent = parents[0];
                 $('#'+parents[1]).css('top', '0px');
-                //console.log('deleting: '+parents[0]);        
+                //console.log('deleting: '+parents[0]);
                 //removing father
                 console.log("first_parent " + first_parent);
-                
-                for (var i = 0; i < skills.length; i++) {  
+
+                for (var i = 0; i < skills.length; i++) {
                     //console.log('looping '+skills[i].element + ' ');
                     if (skills[i].element == parents[0] ) {
-                        console.log('deleting parent:'+ skills[i].element + ' here ');                             
+                        console.log('deleting parent:' + skills[i].element + ' here ');
                         jsPlumb.deleteEndpoint(skills[i].element);
                         jsPlumb.detachAllConnections(skills[i].element);
-                        jsPlumb.removeAllEndpoints(skills[i].element);  
+                        jsPlumb.removeAllEndpoints(skills[i].element);
                         $("#"+skills[i].element).remove();
                     }
-                }                                
-                parents.splice(0,1);                
+                }
+                parents.splice(0, 1);
                 parents.push(id);
                 console.log('parents after slice/push: ' + parents);
-            }     
-                
-            if ($(this).hasClass('first_window')) {  
+            }
+
+            if ($(this).hasClass('first_window')) {
                 console.log('im in a first_window (root)');
                 $('#'+first_parent).css('top', '0px');
                 //show the first_parent
                 //if (first_parent != '') {
-                   parents = [first_parent, id];                   
+                parents = [first_parent, id];
                    open_parent(first_parent, id);
                 //}
             }
-            
-            if (jQuery.inArray(id, parents) == -1) {                              
+
+            if (jQuery.inArray(id, parents) == -1) {
                 parents.push(id);
                 console.log('parents push: ' + parents);
             }
-            open_block(id, 0, 0);            
+            open_block(id, 0, 0);
         }
-        
-        //Setting class       
-        cleanclass($(this));   
+
+        //Setting class
+        cleanclass($(this));
         $(this).addClass('second_window');
-        
+
         parent_div = $("#"+parents[0]);
         cleanclass(parent_div);
         parent_div.addClass('first_window');
         parent_div.addClass('skill_root');
-        
-        parent_div = $("#"+parents[1]);        
+
+        parent_div = $("#" + parents[1]);
         cleanclass(parent_div);
         parent_div.addClass('second_window');
-       
+
         //console.log(parents);
-       // console.log(skills);        
-        console.log('first_parent : ' + first_parent);             
-        
+        // console.log(skills);
+        console.log('first_parent : ' + first_parent);
+
         //redraw
         jsPlumb.repaintEverything();
         jsPlumb.repaint(id);
- 
+
     });
-    
-    //Skill title click  
+
+    //Skill title click
     $(".edit_block").click(function() {
         var my_id = $(this).attr('id');
         my_id = my_id.split('_')[2];
-        
+
         //Cleaning selected
         $("#parent_id option:selected").removeAttr('selected');
         $("#gradebook_id option:selected").removeAttr('selected');
-        
+
         $.ajax({
-            url: url+'&a=get_skill_info&id='+my_id,             
+            url: url + '&a=get_skill_info&id=' + my_id,
             success: function(json) {
                 var skill = jQuery.parseJSON(json);
                 $("#name").attr('value', skill.name);
-                $("#id").attr('value',   skill.id);                        
-                $("#description").attr('value', skill.description);                
+                $("#id").attr('value', skill.id);
+                $("#description").attr('value', skill.description);
                 //filling parent_id
                 $("#parent_id option[value='"+skill.extra.parent_id+"']").attr('selected', 'selected');
-                //filling the gradebook_id         
-                jQuery.each(skill.gradebooks, function(index, data) {                    
-                    $("#gradebook_id option[value='"+data.id+"']").attr('selected', 'selected');            
+                //filling the gradebook_id
+                jQuery.each(skill.gradebooks, function (index, data) {
+                    $("#gradebook_id option[value='" + data.id + "']").attr('selected', 'selected');
                 });
             }
-        });        
-                
+        });
+
         $("#gradebook_id").trigger("liszt:updated");
         $("#parent_id").trigger("liszt:updated");
         $("#dialog-form").dialog("open");
         return false;
     });
-        
-    
+
+
     //Clicking in a box
     $(".window").bind('click', function() {
         var id = $(this).attr('id');
         id = id.split('_')[1];
-    });    
+    });
 
     // chrome fix.
-    document.onselectstart = function () { return false; };             
+    document.onselectstart = function () {
+        return false;
+    };
 
     // render mode
     var resetRenderMode = function(desiredMode) {
-        var newMode = jsPlumb.setRenderMode(desiredMode);        
+        var newMode = jsPlumb.setRenderMode(desiredMode);
         jsPlumbDemo.init();
     };
-    resetRenderMode(jsPlumb.CANVAS);       
+    resetRenderMode(jsPlumb.CANVAS);
 });
-    
-;(function() {         
+
+;
+(function () {
     prepare = function(div, endpointOptions) {
         console.log('preparing = '+div);
         console.log('endpointOptions = '+endpointOptions);
         //jsPlumbDemo.initHover(elId);
-        
-        var endPoint = jsPlumb.addEndpoint(div, endpointOptions);         
+
+        var endPoint = jsPlumb.addEndpoint(div, endpointOptions);
         skills.push({
             element: div, endp:endPoint
         });
-        return endPoint;        
-    },    
-    window.jsPlumbDemo = {  	   
+        return endPoint;
+    },
+            window.jsPlumbDemo = {
         init : function() {
-            console.log('Import defaults');            
-            jsPlumb.Defaults.Anchors = [ "BottomCenter", "TopCenter" ];            
+            console.log('Import defaults');
+            jsPlumb.Defaults.Anchors = ["BottomCenter", "TopCenter"];
             jsPlumb.Defaults.Container = "skill_tree";
-            
+
             open_block('block_1', 0, 1);
-           
-            // listen for clicks on connections, and offer to delete connections on click.			
+
+            // listen for clicks on connections, and offer to delete connections on click.
 			jsPlumb.bind("click", function(conn, originalEvent) {
 				/*if (confirm("Delete connection from " + conn.sourceId + " to " + conn.targetId + "?"))
 					jsPlumb.detach(conn); */
-			});            
+            });
         }
     };
 })();
@@ -351,33 +353,33 @@ jsPlumb.ready(function() {
 $(document).ready(function() {
 /*
     //When creating a connection see
-    //http://jsplumb.org/apidocs/files/jsPlumb-1-3-2-all-js.html#bind 
+ //http://jsplumb.org/apidocs/files/jsPlumb-1-3-2-all-js.html#bind
     jsPlumb.bind("jsPlumbConnection", function(conn) {
         //alert("Connection created " + conn.sourceId + " to " + conn.targetId + " ");
-            //jsPlumb.detach(conn); 
+ //jsPlumb.detach(conn);
     });
     //When double clicking a connection
-    jsPlumb.bind("click", function(conn) {        
+ jsPlumb.bind("click", function(conn) {
         if (confirm("Delete connection from " + conn.sourceId + " to " + conn.targetId + "?"))
-            jsPlumb.detach(conn); 
+ jsPlumb.detach(conn);
     });
-    
-     //When double clicking a connection
+
+ //When double clicking a connection
     jsPlumb.bind("click", function(endpoint) {
         if (confirm("Delete connection from " + conn.sourceId + " to " + conn.targetId + "?"))
-            jsPlumb.detach(conn); 
+ jsPlumb.detach(conn);
     });*/
-    
+
     $(".chzn-select").chosen();
     $("#menu").draggable();
 });
 
 ;(function() {
-   
+
     jsPlumbDemo.getSelector = function(spec) {
         return $(spec);
     };
-    
+
     jsPlumbDemo.attachBehaviour = function() {
         $(".hide").click(function() {
             jsPlumb.toggle($(this).attr("rel"));
@@ -394,8 +396,9 @@ $(document).ready(function() {
             jsPlumb.detachAll($(this).attr("rel"));
         });
 
-        $("#clear").click(function() { 
-            jsPlumb.detachEverything(); showConnections(); 
+        $("#clear").click(function () {
+            jsPlumb.detachEverything();
+            showConnections();
         });
     };
 })();
@@ -405,58 +408,65 @@ $(document).ready(function() {
 <div id="dialog-loading">
     <div class="modal-body">
         <p style="text-align:center">
-            {{ "Loading"|get_lang }}
+            {{ "Loading"|trans }}
         <img src="{{ _p.web_img}}loadingAnimation.gif"/>
         </p>
-    </div>    
+    </div>
 </div>
 
 <div id="menu" class="well" style="top:20px; left:20px; width:380px; z-index: 9000; opacity: 0.9;">
-    <h3>{{'Skills'|get_lang}}</h3>
+    <h3>{{ 'Skills'|trans }}</h3>
     <div class="btn-group">
-        <a style="z-index: 1000" class="btn" id="add_item_link" href="#">{{'AddSkill'|get_lang}}</a>
-        <a style="z-index: 1000" class="btn btn-default" id="return_to_root" href="#">{{'Root'|get_lang}}</a>
-        <a style="z-index: 1000" class="btn btn-default" id="return_to_admin" href="{{_p.web_main}}admin">{{'BackToAdmin'|get_lang}}</a>
-        
+        <a style="z-index: 1000" class="btn" id="add_item_link"
+           href="#">{{ 'AddSkill'|trans }}</a>
+        <a style="z-index: 1000" class="btn btn-default" id="return_to_root"
+           href="#">{{ 'Root'|trans }}</a>
+        <a style="z-index: 1000" class="btn btn-default" id="return_to_admin"
+           href="{{ url('web.main') }}admin">{{ 'BackToAdmin'|trans }}</a>
+
     </div>
 </div>
-           
+
 <div id="skill_tree"></div>
 
-<div id="dialog-form" style="display:none; z-index:9001;">    
+<div id="dialog-form" style="display:none; z-index:9001;">
     <p class="validateTips"></p>
     <form class="form-horizontal" id="add_item" name="form">
         <fieldset>
             <input type="hidden" name="id" id="id"/>
-            <div class="control-group">            
-                <label class="control-label" for="name">{{'Name'|get_lang}}</label>            
+            <div class="control-group">
+                <label class="control-label"
+                       for="name">{{ 'Name'|trans }}</label>
                 <div class="controls">
-                    <input type="text" name="name" id="name" size="40" />             
+                    <input type="text" name="name" id="name" size="40"/>
                 </div>
-            </div>        
-            <div class="control-group">            
-                <label class="control-label" for="name">{{'Parent'|get_lang}}</label>            
+            </div>
+            <div class="control-group">
+                <label class="control-label"
+                       for="name">{{ 'Parent'|trans }}</label>
                 <div class="controls">
                     <select id="parent_id" name="parent_id" />
-                    </select>                  
+                    </select>
                 </div>
-            </div>                
-            <div class="control-group">            
-                <label class="control-label" for="name">{{'Gradebook'|get_lang}}</label>            
+            </div>
+            <div class="control-group">
+                <label class="control-label"
+                       for="name">{{ 'Gradebook'|trans }}</label>
                 <div class="controls">
                     <select id="gradebook_id" name="gradebook_id[]" multiple="multiple"/>
-                    </select>             
+                    </select>
                     <span class="help-block">
-                    {{'WithCertificate'|get_lang}}
-                    </span>           
+                    {{ 'WithCertificate'|trans }}
+                    </span>
                 </div>
             </div>
-            <div class="control-group">            
-                <label class="control-label" for="name">{{'Description'|get_lang}}</label>            
+            <div class="control-group">
+                <label class="control-label"
+                       for="name">{{ 'Description'|trans }}</label>
                 <div class="controls">
                     <textarea name="description" id="description" rows="7"></textarea>
                 </div>
-            </div>  
+            </div>
         </fieldset>
-    </form>    
-</div>
+    </form>
+</div>

+ 0 - 0
main/template/default/skill/skill_tree_student.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/skill_tree_student.html.twig


+ 53 - 39
main/template/default/skill/skill_wheel.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/skill_wheel.html.twig

@@ -1,4 +1,5 @@
-{% include template ~ '/skill/skill_wheel.js.tpl' %}
+{% include '@template_style/skill/skill_wheel.js.html.twig' %}
+
 <script>
     /* Skill search input in the left menu */
     function check_skills_sidebar() {
@@ -12,7 +13,7 @@
                     async: false,
                     success: function (return_value) {
                         if (return_value == 0) {
-                            alert("{{ 'SkillDoesNotExist'|get_lang }}");
+                            alert("{{ 'SkillDoesNotExist'|trans }}");
 
                             //Deleting select option tag
                             //$("#skill_id option[value="+skill_id+"]").remove();
@@ -62,11 +63,11 @@
                 <td>' + skill_name + '</td>\n\
                 <td class="text-right">\n\
                     <div class="btn-group btn-group-sm" data-toggle="buttons">\n\
-                        <label class="btn btn-default ' + activeCondition + '" aria-label="{{ 'Select'|get_lang }}" title="{{ 'SelectToSearch'|get_lang }}">\n\
+                        <label class="btn btn-default ' + activeCondition + '" aria-label="{{ 'Select'|trans }}" title="{{ 'SelectToSearch'|trans }}">\n\
                             <input id="skill_to_select_id_' + skill_id + '" data-id="' + skill_id + '" name="' + skill_name + '" class="skill_to_select" type="checkbox" autocomplete="off" ' + checked_condition + '>\n\
                             <span class="' + iconClassCondition + '" aria-hidden="true"></span>\n\
                         </label>\n\
-                        <button class="btn btn-default load_wheel" aria-label="{{ 'Search'|get_lang }}" title="{{ 'PlaceOnTheWheel'|get_lang }}" data-id="' + skill_id + '">\n\
+                        <button class="btn btn-default load_wheel" aria-label="{{ 'Search'|trans }}" title="{{ 'PlaceOnTheWheel'|trans }}" data-id="' + skill_id + '">\n\
                             <span class="fa fa-crosshairs fa-fw" aria-hidden="true"></span>\n\
                         </button>\n\
                     </div>\n\
@@ -85,7 +86,7 @@
                     data: "skill_id=" + skill_id,
                     success: function (return_value) {
                         if (return_value == 0) {
-                            alert("{{ 'SkillDoesNotExist'|get_lang }}");
+                            alert("{{ 'SkillDoesNotExist'|trans }}");
 
                             //Deleting select option tag
                             $("#parent_id").find('option').remove();
@@ -128,7 +129,7 @@
                     data: "gradebook_id=" + gradebook_id,
                     success: function (return_value) {
                         if (return_value == 0) {
-                            alert("{{ 'GradebookDoesNotExist'|get_lang }}");
+                            alert("{{ 'GradebookDoesNotExist'|trans }}");
                             //Deleting select option tag
                             $("#gradebook_id option[value=" + gradebook_id + "]").remove();
                             //Deleting holder
@@ -374,7 +375,7 @@
             cache: false,
             filter_case: false,
             filter_hide: true,
-            complete_text: "{{ 'EnterTheSkillNameToSearch' | get_lang }}",
+            complete_text: "{{ 'EnterTheSkillNameToSearch' | trans }}",
             firstselected: true,
             //onremove: "testme",
             onselect: "check_skills_sidebar",
@@ -405,7 +406,7 @@
         /* Generated random colour */
         /*
          function colour(d) {
-         
+
          if (d.children) {
          // There is a maximum of two children!
          var colours = d.children.map(colour),
@@ -424,7 +425,7 @@
                 return;
             }
 
-            window.location.href = "{{ _p.web_main }}admin/skill_edit.php?id=" + SkillWheel.currentSkill.id;
+            window.location.href = "{{ url('web.main') }}admin/skill_edit.php?id=" + SkillWheel.currentSkill.id;
         });
 
         $('#form-button-create-child').on('click', function (e) {
@@ -434,7 +435,7 @@
                 return;
             }
 
-            window.location.href = "{{ _p.web_main }}admin/skill_create.php?parent=" + SkillWheel.currentSkill.id;
+            window.location.href = "{{ url('web.main') }}admin/skill_create.php?parent=" + SkillWheel.currentSkill.id;
         });
 
         $('#form-button-add-to-profile').on('click', function (e) {
@@ -473,9 +474,9 @@
                 if (parseInt(response) === 1) {
                     update_my_saved_profiles();
 
-                    alert("{{ "Saved" | get_lang }}");
+                    alert("{{ "Saved" | trans }}");
                 } else {
-                    alert("{{ "Error" | get_lang }}");
+                    alert("{{ "Error" | trans }}");
                 }
 
                 $('#frm-save-profile').modal('hide');
@@ -488,14 +489,15 @@
         <div class="row">
             <div class="col-md-3 skill-options">
                 <div class="skill-home">
-                    <a class="btn btn-large btn-block btn-primary" href="{{ _p.web }}user_portal.php">
-                        <em class="fa fa-home"></em> {{ "ReturnToCourseList"|get_lang }}
+                    <a class="btn btn-large btn-block btn-primary"
+                       href="{{ url('userportal') }}">
+                        <em class="fa fa-home"></em> {{ "ReturnToCourseList"|trans }}
                     </a>
                 </div>
                 <div class="panel panel-default">
                     <div class="panel-body">
                         <div id="saved_profiles"></div>
-                        <h4 class="page-header">{{ 'WhatSkillsAreYouLookingFor'|get_lang }}</h4>
+                        <h4 class="page-header">{{ 'WhatSkillsAreYouLookingFor'|trans }}</h4>
                         <div class="search-skill">
                             <form id="skill_search" class="form-search">
                                 <select id="skill_id" name="skill_id" /></select>
@@ -506,20 +508,20 @@
                             <ul id="profile_search" class="holder holder_simple hide"></ul>
                             <form id="search_profile_form" class="form-search">
                                 <button class="btn btn-default btn-block" type="submit">
-                                    <em class="fa fa-search"></em> {{ "SearchProfileMatches"|get_lang }}
+                                    <em class="fa fa-search"></em> {{ "SearchProfileMatches"|trans }}
                                 </button>
                             </form>
-                            <h4 class="page-header">{{ 'IsThisWhatYouWereLookingFor'|get_lang }}</h4>
+                            <h4 class="page-header">{{ 'IsThisWhatYouWereLookingFor'|trans }}</h4>
                             <form id="save_profile_form_button" class="form-search">
                                 <button class="btn btn-default btn-block" type="submit">
-                                    <em class="fa fa-floppy-o"></em> {{ "SaveThisSearch"|get_lang }}
+                                    <em class="fa fa-floppy-o"></em> {{ "SaveThisSearch"|trans }}
                                 </button>
                             </form>
                         </div>
                         <hr>
                         <p>
                             <a class="btn btn-block btn-default load_root" rel="0" href="#">
-                                <em class="fa fa-eye"></em> {{ "ViewSkillsWheel"|get_lang }}
+                                <em class="fa fa-eye"></em> {{ "ViewSkillsWheel"|trans }}
                             </a>
                         </p>
                     </div>
@@ -529,7 +531,7 @@
                         <div class="panel-heading" role="tab" id="wheel-legend-heading">
                             <h4 class="panel-title">
                                 <a role="button" data-toggle="collapse" data-parent="#wheel-second-accordion" href="#wheel-legend-collapse" aria-expanded="true" aria-controls="wheel-legend-collapse">
-                                    {{ "Legend"|get_lang }}
+                                    {{ "Legend"|trans }}
                                 </a>
                             </h4>
                         </div>
@@ -537,13 +539,13 @@
                             <div class="panel-body">
                                 <ul class="fa-ul">
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-basic"></em> {{ "BasicSkills"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-basic"></em> {{ "BasicSkills"|trans }}
                                     </li>
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-add"></em> {{ "SkillsYouCanLearn"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-add"></em> {{ "SkillsYouCanLearn"|trans }}
                                     </li>
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-search"></em> {{ "SkillsSearchedFor"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-search"></em> {{ "SkillsSearchedFor"|trans }}
                                     </li>
                                 </ul>
                             </div>
@@ -553,19 +555,27 @@
                         <div class="panel-heading" role="tab" id="wheel-display-heading">
                             <h4 class="panel-title">
                                 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#wheel-second-accordion" href="#wheel-display-collapse" aria-expanded="false" aria-controls="wheel-display-collapse">
-                                    {{ 'DisplayOptions' | get_lang }}
+                                    {{ 'DisplayOptions' | trans }}
                                 </a>
                             </h4>
                         </div>
                         <div id="wheel-display-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="wheel-display-heading">
                             <div class="panel-body">
-                                <p>{{ 'ChooseABackgroundColor' | get_lang }}</p>
+                                <p>{{ 'ChooseABackgroundColor' | trans }}</p>
                                 <ul class="list-unstyled" id="skill-change-background-options">
-                                    <li><a href="#" data-color="#FFFFFF">{{ 'White' | get_lang }}</a></li>
-                                    <li><a href="#" data-color="#000000">{{ 'Black' | get_lang }}</a></li>
+                                    <li><a href="#"
+                                           data-color="#FFFFFF">{{ 'White' | trans }}</a>
+                                    </li>
+                                    <li><a href="#"
+                                           data-color="#000000">{{ 'Black' | trans }}</a>
+                                    </li>
                                     <li><a href="#" data-color="#A9E2F3">{{ 'LightBlue' }}</a></li>
-                                    <li><a href="#" data-color="#848484">{{ 'Gray' | get_lang }}</a></li>
-                                    <li><a href="#" data-color="#F7F8E0">{{ 'Corn' | get_lang }}</a></li>
+                                    <li><a href="#"
+                                           data-color="#848484">{{ 'Gray' | trans }}</a>
+                                    </li>
+                                    <li><a href="#"
+                                           data-color="#F7F8E0">{{ 'Corn' | trans }}</a>
+                                    </li>
                                 </ul>
                             </div>
                         </div>
@@ -585,26 +595,28 @@
     <div class="modal-dialog modal-lg">
         <div class="modal-content">
             <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
+                <button type="button" class="close" data-dismiss="modal"
+                        aria-label="{{ "Close" | trans }}">
                     <span aria-hidden="true">&times;</span>
                 </button>
-                <h4 class="modal-title" id="form-skill-title">{{ "Skill" | get_lang }}</h4>
+                <h4 class="modal-title"
+                    id="form-skill-title">{{ "Skill" | trans }}</h4>
             </div>
             <div class="modal-body">
                 {{ dialogForm }}
             </div>
             <div class="modal-footer">
                 <button id="form-button-edit" class="btn btn-primary">
-                    <em class="fa fa-edit"></em> {{ "Edit" | get_lang }}
+                    <em class="fa fa-edit"></em> {{ "Edit" | trans }}
                 </button>
                 <button id="form-button-create-child" class="btn btn-primary">
-                    <em class="fa fa-plus"></em> {{ "CreateChildSkill" | get_lang }}
+                    <em class="fa fa-plus"></em> {{ "CreateChildSkill" | trans }}
                 </button>
                 <button id="form-button-add-to-profile" class="btn btn-primary">
-                    <em class="fa fa-check"></em> {{ "AddSkillToProfileSearch" | get_lang }}
+                    <em class="fa fa-check"></em> {{ "AddSkillToProfileSearch" | trans }}
                 </button>
                 <button type="button" class="btn btn-primary" data-dismiss="modal">
-                    <em class="fa fa-close"></em> {{ "Close" | get_lang }}
+                    <em class="fa fa-close"></em> {{ "Close" | trans }}
                 </button>
             </div>
         </div>
@@ -615,20 +627,22 @@
     <div class="modal-dialog modal-lg">
         <div class="modal-content">
             <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
+                <button type="button" class="close" data-dismiss="modal"
+                        aria-label="{{ "Close" | trans }}">
                     <span aria-hidden="true">&times;</span>
                 </button>
-                <h4 class="modal-title" id="form-save-profile-title">{{ "SkillProfile" | get_lang }}</h4>
+                <h4 class="modal-title"
+                    id="form-save-profile-title">{{ "SkillProfile" | trans }}</h4>
             </div>
             <div class="modal-body">
                 {{ saveProfileForm }}
             </div>
             <div class="modal-footer">
                 <button id="form-button-save-profile" class="btn btn-primary">
-                    <em class="fa fa-save"></em> {{ "Save" | get_lang }}
+                    <em class="fa fa-save"></em> {{ "Save" | trans }}
                 </button>
                 <button type="button" class="btn btn-primary" data-dismiss="modal">
-                    <em class="fa fa-close"></em> {{ "Close" | get_lang }}
+                    <em class="fa fa-close"></em> {{ "Close" | trans }}
                 </button>
             </div>
         </div>

+ 2 - 2
main/template/default/skill/skill_wheel.js.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/skill_wheel.js.html.twig

@@ -1,5 +1,5 @@
 {# topbar #}
-{% include template ~ "/layout/topbar.tpl" %}
+{% include "@template_style/layout/topbar.html.twig" %}
 <script>
 
 var SkillWheel = {
@@ -455,7 +455,7 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
     /* Add a small label to help the user */
     div.append("p")
     .attr("id", "intro")
-    .text("{{ "ClickToZoom"|get_lang }}");
+            .text("{{ "ClickToZoom"|trans }}");
 
     /* Generate the partition layout */
     var partition = d3.layout.partition()

+ 41 - 26
main/template/default/skill/skill_wheel_student.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/skill_wheel_student.html.twig

@@ -12,7 +12,7 @@
 //                async: false,
                     success: function (return_value) {
                         if (return_value == 0) {
-                            alert("{{ 'SkillDoesNotExist'|get_lang }}");
+                            alert("{{ 'SkillDoesNotExist'|trans }}");
                             //Deleting select option tag
                             //$("#skill_id option[value="+skill_id+"]").remove();
                             $("#skill_id").empty();
@@ -54,7 +54,7 @@
             <tr>\n\
                 <td>' + skill_name + '</td>\n\
                 <td class="text-right">\n\
-                    <button type="button" id="skill_to_select_id_' + skill_id + '" class="btn btn-warning btn-sm load_wheel" data-id="' + skill_id + '" title="{{ 'PlaceOnTheWheel'|get_lang }}" aria-label="{{ 'PlaceOnTheWheel'|get_lang }}">\n\
+                    <button type="button" id="skill_to_select_id_' + skill_id + '" class="btn btn-warning btn-sm load_wheel" data-id="' + skill_id + '" title="{{ 'PlaceOnTheWheel'|trans }}" aria-label="{{ 'PlaceOnTheWheel'|trans }}">\n\
                         <span class="fa fa-crosshairs fa-fw" aria-hidden="true"></span>\n\
                     </button>\n\
                 </td>\n\
@@ -133,7 +133,7 @@
             cache: false,
             filter_case: false,
             filter_hide: true,
-            complete_text: "{{ 'EnterTheSkillNameToSearch'|get_lang }}",
+            complete_text: "{{ 'EnterTheSkillNameToSearch'|trans }}",
             firstselected: true,
             //onremove: "testme",
             onselect: "check_skills_sidebar",
@@ -155,7 +155,7 @@
             <div class="col-md-3 skill-options">
                 <p class="skill-home">
                     <a class="btn btn-large btn-block btn-primary" href="{{ _p.web }}user_portal.php">
-                        <em class="fa fa-home"></em> {{ "ReturnToCourseList"|get_lang }}
+                        <em class="fa fa-home"></em> {{ "ReturnToCourseList"|trans }}
                     </a>
                 </p>
                 <div class="panel panel-default">
@@ -165,7 +165,9 @@
                             <figcaption class="lead">{{ user_info.complete_name }}</figcaption>
                         </figure>
                         <p class="text-center">
-                            <a href="{{ _p.web_main }}social/skills_ranking.php" class="btn btn-default" target="_blank">{{ 'YourSkillRankingX'|get_lang|format(ranking) }}</a>
+                            <a href="{{ url('web.main') }}social/skills_ranking.php"
+                               class="btn btn-default"
+                               target="_blank">{{ 'YourSkillRankingX'|trans|format(ranking) }}</a>
                         </p>
                         <div class="text-center">
                             {% if skills is not empty %}
@@ -190,14 +192,14 @@
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <a data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
-                                {{ 'GetNewSkills'|get_lang }}
+                                {{ 'GetNewSkills'|trans }}
                             </a>
                         </div>
                         <div id="collapseTwo" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <!-- SEARCH -->
                                 <div class="search-skill">
-                                    <h5 class="page-header">{{ 'SkillsSearch'|get_lang }}</h5>
+                                    <h5 class="page-header">{{ 'SkillsSearch'|trans }}</h5>
                                     <form id="skill_search" class="form-search">
                                         <select id="skill_id" name="skill_id" /></select>
                                         <table id="skill_holder" class="table table-condensed"></table>
@@ -205,12 +207,12 @@
                                 </div>
                                 <!-- END SEARCH -->
                                 <!-- INFO SKILL -->
-                                <h5 class="page-header">{{ 'SkillInfo'|get_lang }}</h5>
+                                <h5 class="page-header">{{ 'SkillInfo'|trans }}</h5>
                                 <div id="skill_info"></div>
                                 <!-- END INFO SKILL -->
                                 <p>
                                     <a class="btn btn-default btn-block load_root" rel="0" href="#">
-                                        <em class="fa fa-eye"></em> {{ "ViewSkillsWheel"|get_lang }}
+                                        <em class="fa fa-eye"></em> {{ "ViewSkillsWheel"|trans }}
                                     </a>
                                 </p>
                             </div>
@@ -222,7 +224,7 @@
                         <div class="panel-heading" role="tab" id="wheel-legend-heading">
                             <h4 class="panel-title">
                                 <a role="button" data-toggle="collapse" data-parent="#wheel-second-accordion" href="#wheel-legend-collapse" aria-expanded="true" aria-controls="wheel-legend-collapse">
-                                    {{ "Legend"|get_lang }}
+                                    {{ "Legend"|trans }}
                                 </a>
                             </h4>
                         </div>
@@ -230,16 +232,16 @@
                             <div class="panel-body">
                                 <ul class="fa-ul">
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-basic"></em> {{ "BasicSkills"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-basic"></em> {{ "BasicSkills"|trans }}
                                     </li>
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-badges"></em> {{ "SkillsYouAcquired"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-badges"></em> {{ "SkillsYouAcquired"|trans }}
                                     </li>
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-add"></em> {{ "SkillsYouCanLearn"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-add"></em> {{ "SkillsYouCanLearn"|trans }}
                                     </li>
                                     <li>
-                                        <em class="fa fa-li fa-square skill-legend-search"></em> {{ "SkillsSearchedFor"|get_lang }}
+                                        <em class="fa fa-li fa-square skill-legend-search"></em> {{ "SkillsSearchedFor"|trans }}
                                     </li>
                                 </ul>
                             </div>
@@ -249,19 +251,27 @@
                         <div class="panel-heading" role="tab" id="wheel-display-heading">
                             <h4 class="panel-title">
                                 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#wheel-second-accordion" href="#wheel-display-collapse" aria-expanded="false" aria-controls="wheel-display-collapse">
-                                    {{ 'DisplayOptions'|get_lang }}
+                                    {{ 'DisplayOptions'|trans }}
                                 </a>
                             </h4>
                         </div>
                         <div id="wheel-display-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="wheel-display-heading">
                             <div class="panel-body">
-                                <p>{{ 'ChooseABackgroundColor'|get_lang }}</p>
+                                <p>{{ 'ChooseABackgroundColor'|trans }}</p>
                                 <ul class="list-unstyled" id="skill-change-background-options">
-                                    <li><a href="#" data-color="#FFFFFF">{{ 'White'|get_lang }}</a></li>
-                                    <li><a href="#" data-color="#000000">{{ 'Black'|get_lang }}</a></li>
+                                    <li><a href="#"
+                                           data-color="#FFFFFF">{{ 'White'|trans }}</a>
+                                    </li>
+                                    <li><a href="#"
+                                           data-color="#000000">{{ 'Black'|trans }}</a>
+                                    </li>
                                     <li><a href="#" data-color="#A9E2F3">{{ 'LightBlue' }}</a></li>
-                                    <li><a href="#" data-color="#848484">{{ 'Gray'|get_lang }}</a></li>
-                                    <li><a href="#" data-color="#F7F8E0">{{ 'Corn'|get_lang }}</a></li>
+                                    <li><a href="#"
+                                           data-color="#848484">{{ 'Gray'|trans }}</a>
+                                    </li>
+                                    <li><a href="#"
+                                           data-color="#F7F8E0">{{ 'Corn'|trans }}</a>
+                                    </li>
                                 </ul>
                             </div>
                         </div>
@@ -282,17 +292,19 @@
     <div class="modal-dialog modal-lg">
         <div class="modal-content">
             <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
+                <button type="button" class="close" data-dismiss="modal"
+                        aria-label="{{ "Close" | trans }}">
                     <span aria-hidden="true">&times;</span>
                 </button>
-                <h4 class="modal-title" id="form-skill-title">{{ "Skill" | get_lang }}</h4>
+                <h4 class="modal-title"
+                    id="form-skill-title">{{ "Skill" | trans }}</h4>
             </div>
             <div class="modal-body">
                 {{ dialogForm }}
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-primary" data-dismiss="modal">
-                    {{ "Close" | get_lang }}
+                    {{ "Close" | trans }}
                 </button>
             </div>
         </div>
@@ -303,14 +315,17 @@
     <div class="modal-dialog">
         <div class="modal-content">
             <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
+                <button type="button" class="close" data-dismiss="modal"
+                        aria-label="{{ "Close" | trans }}">
                     <span aria-hidden="true">&times;</span>
                 </button>
-                <h4 class="modal-title" id="form-course-info-title">{{ "ChooseCourse" | get_lang }}</h4>
+                <h4 class="modal-title"
+                    id="form-course-info-title">{{ "ChooseCourse" | trans }}</h4>
             </div>
             <div class="modal-body"></div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-primary" data-dismiss="modal">{{ "Close" | get_lang }}</button>
+                <button type="button" class="btn btn-primary"
+                        data-dismiss="modal">{{ "Close" | trans }}</button>
             </div>
         </div>
     </div>

+ 12 - 10
main/template/default/skill/student_boss_report.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/student_boss_report.html.twig

@@ -1,30 +1,32 @@
 {% if allowSkillsTool %}
     <div class="btn-group">
-        <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">{{ 'SkillsWheel' | get_lang }}</a>
+        <a class="btn btn-default"
+           href="{{ url('web.main') }}social/skills_wheel.php">{{ 'SkillsWheel' | trans }}</a>
     </div>
 {% endif %}
 
-<h1 class="page-header">{{ 'SkillsAcquired' | get_lang }}</h1>
+<h1 class="page-header">{{ 'SkillsAcquired' | trans }}</h1>
 
 <form class="form-inline" method="post" action="{{ _p.web_self }}">
-    <label>{{ 'Students' | get_lang }}</label>
+    <label>{{ 'Students' | trans }}</label>
     <select name="student" id="student">
-        <option value="0">{{ 'Select' | get_lang }}</option>
+        <option value="0">{{ 'Select' | trans }}</option>
         {% for student in followedStudents %}
             <option value="{{ student.user_id }}" {{ (student.user_id == selectedStudent) ? 'selected' : '' }}>{{ student.completeName }}</option>
         {% endfor %}
     </select>
-    <button type="submit" class="btn btn-primary">{{ 'Search' | get_lang }}</button>
+    <button type="submit"
+            class="btn btn-primary">{{ 'Search' | trans }}</button>
 </form>
 
 {% if rows %}
     <table class="table">
         <thead>
             <tr>
-                <th>{{ 'Student' | get_lang }}</th>
-                <th>{{ 'SkillsAcquired' | get_lang }}</th>
-                <th>{{ 'Date' | get_lang }}</th>
-                <th>{{ 'Course' | get_lang }}</th>
+                <th>{{ 'Student' | trans }}</th>
+                <th>{{ 'SkillsAcquired' | trans }}</th>
+                <th>{{ 'Date' | trans }}</th>
+                <th>{{ 'Course' | trans }}</th>
             </tr>
         </thead>
         <tbody>
@@ -40,6 +42,6 @@
     </table>
 {% else %}
     <div class="alert alert-info">
-        {{ 'NoResults' | get_lang }}
+        {{ 'NoResults' | trans }}
     </div>
 {% endif %}

+ 6 - 6
main/template/default/skill/student_report.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/student_report.html.twig

@@ -1,18 +1,18 @@
 {% if allowSkillsTool %}
     <div class="btn-group">
-        <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">{{ 'SkillsWheel' | get_lang }}</a>
+        <a class="btn btn-default" href="{{ url('web.main') }}social/skills_wheel.php">{{ 'SkillsWheel' | trans }}</a>
     </div>
 {% endif %}
 
-<h1 class="page-header">{{ 'SkillsAcquired' | get_lang }}</h1>
+<h1 class="page-header">{{ 'SkillsAcquired' | trans }}</h1>
 
 {% if rows %}
     <table class="table">
         <thead>
             <tr>
-                <th>{{ 'Skill' | get_lang }}</th>
-                <th>{{ 'Date' | get_lang }}</th>
-                <th>{{ 'Course' | get_lang }}</th>
+                <th>{{ 'Skill' | trans }}</th>
+                <th>{{ 'Date' | trans }}</th>
+                <th>{{ 'Course' | trans }}</th>
             </tr>
         </thead>
         <tbody>
@@ -27,6 +27,6 @@
     </table>
 {% else %}
     <div class="alert alert-info">
-        {{ 'NoResults' | get_lang }}
+        {{ 'NoResults' | trans }}
     </div>
 {% endif %}

+ 5 - 5
main/template/default/skill/user_skills.tpl → src/Chamilo/CoreBundle/Resources/views/default/skill/user_skills.tpl

@@ -1,11 +1,11 @@
 {% if skills is not empty %}
 <ul class="skill-winner">
-    {%for skill in skills %}        
+    {% for skill in skills %}
         <li>
             <a class="" rel="{{ skill.id}}" href="#">{{ skill.name }}</a>
-        </li>        
+        </li>
     {% endfor %}
-</ul>    
+</ul>
 {% else %}
-    {{ 'YouHaveNotYetAchievedSkills' | get_lang }}
-{% endif %}
+    {{ 'YouHaveNotYetAchievedSkills' | trans }}
+{% endif %}