Set skill levels name, then later it will be parsed using get_lang BT#13586

pull/2487/head
jmontoyaa 8 years ago
parent 11e473bcbe
commit 95cbe85d0e
  1. 21
      main/badge/assign.php
  2. 8
      main/install/configuration.dist.php

@ -128,7 +128,17 @@ $currentUrl = api_get_self().'?user='.$userId.'&current='.$currentLevel;
$form = new FormValidator('assign_skill', 'POST', $currentUrl);
$form->addHeader(get_lang('AssignSkill'));
$form->addText('user_name', get_lang('UserName'), false);
$form->addSelect('skill', get_lang('Skill'), $skillsOptions, ['id' => 'skill']);
$levels = api_get_configuration_value('skill_levels_names');
$levelName = get_lang('Skill');
if (!empty($levels)) {
if (isset($levels['levels'][1])) {
$levelName = get_lang($levels['levels'][1]);
}
}
$form->addSelect('skill', $levelName, $skillsOptions, ['id' => 'skill']);
if (!empty($skillIdFromGet)) {
if (empty($subSkillList)) {
@ -155,9 +165,16 @@ if (!empty($skillIdFromGet)) {
$skillsOptions[$child['id']] = $child['data']['name'];
}
$levelName = get_lang('SubSkill');
if (!empty($levels)) {
if (isset($levels['levels'][$counter + 2])) {
$levelName = get_lang($levels['levels'][$counter + 2]);
}
}
$form->addSelect(
'sub_skill_id_'.($counter+1),
get_lang('SubSkill'),
$levelName,
$skillsOptions,
[
'id' => 'sub_skill_id_'.($counter+1),

@ -681,3 +681,11 @@ $_configuration['gradebook_badge_sidebar'] = [
//$_configuration['disabled_edit_session_coaches_course_editing_course'] = false;
// Show sender's email when receiving email notifications.
//$_configuration['show_user_email_in_notification'] = false;
// Set skill levels name, then later it will be parsed using get_lang BT#13586
/*$_configuration['skill_levels_names'] = [
'levels' => [
1 => 'Skills',
2 => 'Capability',
3 => 'Dimension',
]
];*/

Loading…
Cancel
Save