diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php
index b96bad254ea..2f04bceabfd 100644
--- a/backup/util/ui/renderer.php
+++ b/backup/util/ui/renderer.php
@@ -629,7 +629,7 @@ class core_backup_renderer extends plugin_renderer_base {
}
$row->cells = array(
html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'targetid', 'value'=>$category->id)),
- $category->name,
+ format_string($category->name, true, array('context' => get_context_instance(CONTEXT_COURSECAT, $category->id))),
format_text($category->description, $category->descriptionformat, array('overflowdiv'=>true))
);
$table->data[] = $row;
diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php
index 52fc1826149..7ea2ff6a2e1 100644
--- a/blocks/course_list/block_course_list.php
+++ b/blocks/course_list/block_course_list.php
@@ -56,8 +56,9 @@ class block_course_list extends block_list {
if ($categories) { //Check we have categories
if (count($categories) > 1 || (count($categories) == 1 && $DB->count_records('course') > 200)) { // Just print top level category links
foreach ($categories as $category) {
+ $categoryname = format_string($category->name, true, array('context' => get_context_instance(CONTEXT_COURSECAT, $category->id)));
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="wwwroot/course/category.php?id=$category->id\">".$icon . format_string($category->name) . "";
+ $this->content->items[]="wwwroot/course/category.php?id=$category->id\">".$icon . $categoryname . "";
}
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || empty($CFG->block_course_list_hideallcourseslink)) {
@@ -75,7 +76,7 @@ class block_course_list extends block_list {
$this->content->items[]="shortname)."\" ".
"href=\"$CFG->wwwroot/course/view.php?id=$course->id\">"
- .$icon. format_string($course->fullname) . "";
+ .$icon. format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))) . "";
}
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || empty($CFG->block_course_list_hideallcourseslink)) {
diff --git a/course/category.php b/course/category.php
index 12558aa2372..9ed7ebca867 100644
--- a/course/category.php
+++ b/course/category.php
@@ -232,7 +232,7 @@
}
$catlinkcss = $subcategory->visible ? '' : ' class="dimmed" ';
echo ''.
- format_string($subcategory->name).'
';
+ format_string($subcategory->name, true, array('context' => get_context_instance(CONTEXT_COURSECAT, $subcategory->id))).'
';
}
}
if (!$firstentry) {
diff --git a/course/delete.php b/course/delete.php
index c0a60ca8872..a59a4e847f5 100644
--- a/course/delete.php
+++ b/course/delete.php
@@ -30,10 +30,11 @@
}
$category = $DB->get_record("course_categories", array("id"=>$course->category));
+ $categoryname = format_string($category->name, true, array('context' => get_context_instance(CONTEXT_COURSECAT, $category->id)));
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php/'));
$PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'));
- $PAGE->navbar->add($category->name, new moodle_url('/course/category.php', array('id'=>$course->category)));
+ $PAGE->navbar->add($categoryname, new moodle_url('/course/category.php', array('id'=>$course->category)));
if (! $delete) {
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
$strdeletecoursecheck = get_string("deletecoursecheck");
diff --git a/course/delete_category_form.php b/course/delete_category_form.php
index 7681bffb28e..f2d394cd907 100644
--- a/course/delete_category_form.php
+++ b/course/delete_category_form.php
@@ -78,11 +78,11 @@ class delete_category_form extends moodleform {
}
/// Now build the form.
- $mform->addElement('header','general', get_string('categorycurrentcontents', '', format_string($category->name)));
+ $mform->addElement('header','general', get_string('categorycurrentcontents', '', format_string($category->name, true, array('context' => $categorycontext))));
if ($containscourses || $containscategories || $containsquestions) {
if (empty($options)) {
- print_error('youcannotdeletecategory', 'error', 'index.php', format_string($category->name));
+ print_error('youcannotdeletecategory', 'error', 'index.php', format_string($category->name, true, array('context' => $categorycontext)));
}
/// Describe the contents of this category.
diff --git a/course/index.php b/course/index.php
index b1998ef8fa6..f0a0c104893 100644
--- a/course/index.php
+++ b/course/index.php
@@ -125,7 +125,7 @@ if (!empty($delete) and confirm_sesskey()) {
require_capability('moodle/category:manage', $context);
require_capability('moodle/category:manage', get_category_or_system_context($deletecat->parent));
- $heading = get_string('deletecategory', 'moodle', format_string($deletecat->name));
+ $heading = get_string('deletecategory', 'moodle', format_string($deletecat->name, true, array('context' => $context)));
require_once('delete_category_form.php');
$mform = new delete_category_form(null, $deletecat);
$mform->set_data(array('delete'=>$delete));
@@ -151,7 +151,7 @@ if (!empty($delete) and confirm_sesskey()) {
foreach($deletedcourses as $course) {
echo $OUTPUT->notification(get_string('coursedeleted', '', $course->shortname), 'notifysuccess');
}
- echo $OUTPUT->notification(get_string('coursecategorydeleted', '', format_string($deletecat->name)), 'notifysuccess');
+ echo $OUTPUT->notification(get_string('coursecategorydeleted', '', format_string($deletecat->name, true, array('context' => $context))), 'notifysuccess');
} else {
category_delete_move($deletecat, $data->newparent, true);
@@ -315,7 +315,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
$linkcss = $category->visible ? '' : ' class="dimmed" ';
echo ''.
- format_string($category->name).'';
+ format_string($category->name, true, array('context' => $category->context)).'';
echo '';
echo '