List the skills with their badges - refs BT#9082

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent 97fb308583
commit 268040ff99
  1. 4
      main/admin/openbadges/create.php
  2. 37
      main/admin/openbadges/list.php
  3. 2
      main/inc/lib/skill.lib.php
  4. 2
      main/template/default/openbadges/create.tpl
  5. 3
      main/template/default/openbadges/index.tpl
  6. 3
      main/template/default/openbadges/issuer.tpl
  7. 56
      main/template/default/openbadges/list.tpl
  8. BIN
      main/upload/data/badges/ac267bb97ace374bfb53cc3cb71daa07bf4f0988.png

@ -45,7 +45,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'id' => $skillId
);
$objSkill->update($params);
if ($objSkill->update($params)) {
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'admin/openbadges/list.php');
}
}
$interbreadcrumb = array(

@ -0,0 +1,37 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show information about Mozilla OpenBadges
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.admin.openbadges
*/
$cidReset = true;
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();
$interbreadcrumb = array(
array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
'name' => get_lang('Administration')
),
array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/openbadges/index.php',
'name' => get_lang('OpenBadges')
)
);
$tpl = new Template('Skills');
$tpl->assign('platformAdminEmail', get_setting('emailAdministrator'));
$tpl->assign('skills', $skills);
$contentTemplate = $tpl->get_template('openbadges/list.tpl');
$tpl->display($contentTemplate);

@ -445,7 +445,7 @@ class Skill extends Model
}
}
$sql = "SELECT s.id, s.name, s.description, ss.parent_id, ss.relation_type
$sql = "SELECT s.id, s.name, s.description, ss.parent_id, ss.relation_type, s.icon
FROM {$this->table} s INNER JOIN {$this->table_skill_rel_skill} ss ON (s.id = ss.skill_id) $id_condition
ORDER BY ss.id, ss.parent_id";

@ -52,7 +52,7 @@
<a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
</li>
<li class="active">
<a href="{{ _p.web_main }}admin/openbadges/create.php">{{ 'Edit' | get_lang }}</a>
<a href="#">{{ 'Edit' | get_lang }}</a>
</li>
</ul>
<div class="tab-content">

@ -13,9 +13,6 @@
<li>
<a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
</li>
<li>
<a href="{{ _p.web_main }}admin/openbadges/create.php">{{ 'Edit' | get_lang }}</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active">

@ -13,9 +13,6 @@
<li>
<a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
</li>
<li>
<a href="{{ _p.web_main }}admin/openbadges/create.php">{{ 'Edit' | get_lang }}</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active">

@ -0,0 +1,56 @@
{% extends "default/layout/main.tpl" %}
{% block body %}
<div class="span12">
<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>
</li>
<li>
<a href="{{ _p.web_main }}admin/openbadges/issuer.php">{{ 'IssuerInfo' | get_lang }}</a>
</li>
<li class="active">
<a href="{{ _p.web_main }}admin/openbadges/list.php">{{ 'Skills' | get_lang }}</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{{ 'Name' | get_lang }}</th>
<th>{{ 'Description' | get_lang }}</th>
<th>{{ 'Actions' | get_lang }}</th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ 'Name' | get_lang }}</th>
<th>{{ 'Description' | get_lang }}</th>
<th>{{ 'Actions' | get_lang }}</th>
</tr>
</tfoot>
<tbody>
{% for skill in skills %}
<tr>
<td>
{% if skill.icon %}
<img src="{{ [_p.web_main, skill.icon] | join('') }}" width="50" alt="{{ skill.name }}">
{% endif %}
{{ skill.name }}
</td>
<td>{{ skill.description }}</td>
<td>
<a href="{{ _p.web_main }}admin/openbadges/create.php?id={{ skill.id }}" title="{{ 'Edit' | get_lang }}">
<img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}">
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Loading…
Cancel
Save