Fix translation for custom icon on course homepage - refs #8194 BT#11259

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent dd1b6f7e95
commit 6662c64b54
  1. 3
      main/course_info/tools.php
  2. 12
      main/inc/lib/course_home.lib.php

@ -44,7 +44,7 @@ switch ($action) {
}
$interbreadcrumb[] = array('url' => api_get_self().'?'.api_get_cidreq(), 'name' => get_lang('CustomizeIcons'));
$toolName = $tool['name'];
$toolName = Security::remove_XSS(stripslashes($tool['name']));
$currentUrl = api_get_self().'?action=edit_icon&id=' . $id.'&'.api_get_cidreq();
@ -115,6 +115,7 @@ switch ($action) {
$iconsTools .= Display::page_header(get_lang('CustomizeIcons'), null, 'h4');
$iconsTools .= '<div class="row">';
foreach ($toolList as $tool) {
$tool['name'] = Security::remove_XSS(stripslashes($tool['name']));
$toolIconName = 'Tool' . api_underscore_to_camel_case($tool['name']);
$toolIconName = isset($$toolIconName) ? get_lang($toolIconName) : $tool['name'];

@ -1053,10 +1053,16 @@ class CourseHome
'external_na.gif'
);
if (in_array($tool['image'], $already_translated_icons)) {
$toolName = Security::remove_XSS(stripslashes($tool['name']));
} else {
$toolName = get_lang('Tool'.api_underscore_to_camel_case($tool['name']));
if (in_array($tool['image'], $already_translated_icons)) {
return $toolName;
}
$toolName = api_underscore_to_camel_case($toolName);
if (isset($GLOBALS['Tool' . $toolName])) {
return get_lang('Tool' . $toolName);
}
return $toolName;

Loading…
Cancel
Save