Browse Source

Move openbadges directory to skill directory - refs BT#9082

Angel Fernando Quiroz Campos 10 years ago
parent
commit
c5c13e135f

+ 1 - 1
main/admin/index.php

@@ -293,7 +293,7 @@ if (api_is_platform_admin()) {
         //$items[] = array('url'=>'skills_profile.php',   'label' => get_lang('SkillsProfile'));
         $items[] = array('url'=>api_get_path(WEB_CODE_PATH).'social/skills_ranking.php',   'label' => get_lang('SkillsRanking'));
         $items[] = array('url'=>'skills_gradebook.php', 'label' => get_lang('SkillsAndGradebooks'));
-        $items[] = array('url'=> api_get_path(WEB_CODE_PATH) . 'admin/openbadges/index.php', 'label' => get_lang('OpenBadges'));
+        $items[] = array('url'=> api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php', 'label' => get_lang('Bagdes'));
         $blocks['skills']['items'] = $items;
         $blocks['skills']['extra'] = null;
         $blocks['skills']['search_form'] = null;

+ 3 - 3
main/admin/openbadges/index.php → main/admin/skill_badge.php

@@ -7,7 +7,7 @@
  */
 $cidReset = true;
 
-require_once '../../inc/global.inc.php';
+require_once '../inc/global.inc.php';
 
 $this_section = SECTION_PLATFORM_ADMIN;
 
@@ -18,8 +18,8 @@ $interbreadcrumb = array(
     )
 );
 
-$tpl = new Template('OpenBadges');
+$tpl = new Template(get_lang('Badges'));
 
-$contentTemplate = $tpl->get_template('openbadges/index.tpl');
+$contentTemplate = $tpl->get_template('skill/badge.tpl');
 
 $tpl->display($contentTemplate);

+ 8 - 8
main/admin/openbadges/create.php → main/admin/skill_badge_create.php

@@ -7,8 +7,8 @@
  */
 $cidReset = true;
 
-require_once '../../inc/global.inc.php';
-require_once '../../inc/lib/fileUpload.lib.php';
+require_once '../inc/global.inc.php';
+require_once '../inc/lib/fileUpload.lib.php';
 
 $this_section = SECTION_PLATFORM_ADMIN;
 
@@ -30,7 +30,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         }
 
         if ($_FILES['image']['error'] == 0) {
-            unlink($sysCodePath . $skill['info']);
+            unlink($sysCodePath . $skill['icon']);
 
             $imageExtraField = new Image($_FILES['image']['tmp_name']);
             $imageExtraField->send_image($sysCodePath . $fileDir . $fileName, -1, 'png');
@@ -46,7 +46,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     );
 
     if ($objSkill->update($params)) {
-        header('Location: ' . api_get_path(WEB_CODE_PATH) . 'admin/openbadges/list.php');
+        header('Location: ' . api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php');
     }
 }
 
@@ -56,15 +56,15 @@ $interbreadcrumb = array(
         'name' => get_lang('Administration')
     ),
     array(
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/openbadges/index.php',
-        'name' => get_lang('OpenBadges')
+        'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
+        'name' => get_lang('Badges')
     )
 );
 
-$tpl = new Template('CreateOpenBadge');
+$tpl = new Template(get_lang('CreateBadge'));
 $tpl->assign('platformAdminEmail', get_setting('emailAdministrator'));
 $tpl->assign('skill', $skill);
 
-$contentTemplate = $tpl->get_template('openbadges/create.tpl');
+$contentTemplate = $tpl->get_template('skill/badge_create.tpl');
 
 $tpl->display($contentTemplate);

+ 5 - 5
main/admin/openbadges/issuer.php → main/admin/skill_badge_issuer.php

@@ -7,7 +7,7 @@
  */
 $cidReset = true;
 
-require_once '../../inc/global.inc.php';
+require_once '../inc/global.inc.php';
 
 $this_section = SECTION_PLATFORM_ADMIN;
 
@@ -17,13 +17,13 @@ $interbreadcrumb = array(
         'name' => get_lang('Administration')
     ),
     array(
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/openbadges/index.php',
-        'name' => get_lang('OpenBadges')
+        'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
+        'name' => get_lang('Badges')
     )
 );
 
-$tpl = new Template('OpenBadges');
+$tpl = new Template(get_lang('IssuerInfo'));
 
-$contentTemplate = $tpl->get_template('openbadges/issuer.tpl');
+$contentTemplate = $tpl->get_template('skill/badge_issuer.tpl');
 
 $tpl->display($contentTemplate);

+ 6 - 8
main/admin/openbadges/list.php → main/admin/skill_badge_list.php

@@ -7,13 +7,11 @@
  */
 $cidReset = true;
 
-require_once '../../inc/global.inc.php';
-require_once '../../inc/lib/fileUpload.lib.php';
+require_once '../inc/global.inc.php';
+require_once '../inc/lib/fileUpload.lib.php';
 
 $this_section = SECTION_PLATFORM_ADMIN;
 
-$skillId = intval($_GET['id']);
-
 $objSkill = new Skill();
 $skills = $objSkill->get_all();
 
@@ -23,15 +21,15 @@ $interbreadcrumb = array(
         'name' => get_lang('Administration')
     ),
     array(
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/openbadges/index.php',
-        'name' => get_lang('OpenBadges')
+        'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
+        'name' => get_lang('Badges')
     )
 );
 
-$tpl = new Template('Skills');
+$tpl = new Template(get_lang('Skills'));
 $tpl->assign('platformAdminEmail', get_setting('emailAdministrator'));
 $tpl->assign('skills', $skills);
 
-$contentTemplate = $tpl->get_template('openbadges/list.tpl');
+$contentTemplate = $tpl->get_template('skill/badge_list.tpl');
 
 $tpl->display($contentTemplate);

+ 3 - 3
main/template/default/openbadges/index.tpl → main/template/default/skill/badge.tpl

@@ -5,13 +5,13 @@
         <h1 class="page-header">{{ 'Badges' | get_lang }}</h1>
         <ul class="nav nav-tabs">
             <li class="active">
-                <a href="{{ _p.web_main }}admin/openbadges/index.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ 'Skills' | get_lang }}</a>
             </li>
         </ul>
         <div class="tab-content">

+ 3 - 3
main/template/default/openbadges/create.tpl → main/template/default/skill/badge_create.tpl

@@ -43,13 +43,13 @@
         <h1 class="page-header">{{ 'Badges' | get_lang }}</h1>
         <ul class="nav nav-tabs">
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/index.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ 'Skills' | get_lang }}</a>
             </li>
             <li class="active">
                 <a href="#">{{ 'Edit' | get_lang }}</a>

+ 3 - 3
main/template/default/openbadges/issuer.tpl → main/template/default/skill/badge_issuer.tpl

@@ -5,13 +5,13 @@
         <h1 class="page-header">{{ 'Badges' | get_lang }}</h1>
         <ul class="nav nav-tabs">
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/index.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
             </li>
             <li class="active">
-                <a href="{{ _p.web_main }}admin/openbadges/issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ 'Skills' | get_lang }}</a>
             </li>
         </ul>
         <div class="tab-content">

+ 4 - 4
main/template/default/openbadges/list.tpl → main/template/default/skill/badge_list.tpl

@@ -5,13 +5,13 @@
         <h1 class="page-header">{{ 'Badges' | get_lang }}</h1>
         <ul class="nav nav-tabs">
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/index.php">{{ 'Home' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge.php">{{ 'Home' | get_lang }}</a>
             </li>
             <li>
-                <a href="{{ _p.web_main }}admin/openbadges/issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
             </li>
             <li class="active">
-                <a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
+                <a href="{{ _p.web_main }}admin/skill_badge_list.php">{{ 'Skills' | get_lang }}</a>
             </li>
         </ul>
         <div class="tab-content">
@@ -42,7 +42,7 @@
                                 </td>
                                 <td>{{ skill.description }}</td>
                                 <td>
-                                    <a href="{{ _p.web_main }}admin/openbadges/create.php?id={{ skill.id }}" title="{{ 'Edit' | get_lang }}">
+                                    <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" title="{{ 'Edit' | get_lang }}">
                                         <img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}">
                                     </a>
                                 </td>