MDL-61589 Questions: Top question category naming improvement

Display the context name next to the top question category name.
This commit is contained in:
Shamim Rezaie
2018-03-15 18:47:25 +11:00
parent 1287039e62
commit c185e4fe21
4 changed files with 13 additions and 11 deletions
+2 -1
View File
@@ -1422,7 +1422,8 @@ function question_fix_top_names($categories) {
foreach ($categories as $id => $category) {
if ($category->parent == 0) {
$categories[$id]->name = get_string('top');
$context = context::instance_by_id($category->contextid);
$categories[$id]->name = get_string('topfor', 'question', $context->get_context_name(false));
}
}