Browse files

MDL-29188 multilang Reviewed the uses of section name and ensured thi…

…ngs were being formatted consistently
  • Loading branch information...
1 parent 5d2db8a commit 71e0b3b5c71e68ebcd02becb622b37d26397c8aa Sam Hemelryk committed Aug 30, 2011
Showing with 9 additions and 7 deletions.
  1. +5 −3 backup/backup.php
  2. +2 −2 course/format/topics/format.php
  3. +2 −2 course/format/weeks/format.php
View
8 backup/backup.php
@@ -60,10 +60,12 @@
$heading = get_string('backupcourse', 'backup', $course->shortname);
break;
case backup::TYPE_1SECTION :
- require_capability('moodle/backup:backupsection', get_context_instance(CONTEXT_COURSE, $course->id));
+ $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+ require_capability('moodle/backup:backupsection', $coursecontext);
if (!empty($section->name)) {
- $heading = get_string('backupsection', 'backup', $section->name);
- $PAGE->navbar->add($section->name);
+ $sectionname = format_string($section->name, true, array('context' => $coursecontext));
+ $heading = get_string('backupsection', 'backup', $sectionname);
+ $PAGE->navbar->add($sectionname);
} else {
$heading = get_string('backupsection', 'backup', $section->section);
$PAGE->navbar->add(get_string('section').' '.$section->section);
View
4 course/format/topics/format.php
@@ -96,7 +96,7 @@
echo '<div class="right side" >&nbsp;</div>';
echo '<div class="content">';
if (!is_null($thissection->name)) {
- echo $OUTPUT->heading($thissection->name, 3, 'sectionname');
+ echo $OUTPUT->heading(format_string($thissection->name, true, array('context' => $context)), 3, 'sectionname');
}
echo '<div class="summary">';
@@ -218,7 +218,7 @@
echo get_string('notavailable');
} else {
if (!is_null($thissection->name)) {
- echo $OUTPUT->heading($thissection->name, 3, 'sectionname');
+ echo $OUTPUT->heading(format_string($thissection->name, true, array('context' => $context)), 3, 'sectionname');
}
echo '<div class="summary">';
if ($thissection->summary) {
View
4 course/format/weeks/format.php
@@ -88,7 +88,7 @@
echo '<div class="content">';
if (!empty($thissection->name)) {
- echo $OUTPUT->heading($thissection->name, 3, 'sectionname');
+ echo $OUTPUT->heading(format_string($thissection->name, true, array('context' => $context)), 3, 'sectionname');
}
echo '<div class="summary">';
@@ -220,7 +220,7 @@
} else {
if (isset($thissection->name) && ($thissection->name !== NULL)) { // empty string is ok
- echo $OUTPUT->heading($thissection->name, 3, 'weekdates');
+ echo $OUTPUT->heading(format_string($thissection->name, true, array('context' => $context)), 3, 'weekdates');
} else {
echo $OUTPUT->heading($currenttext.$weekperiod, 3, 'weekdates');
}

0 comments on commit 71e0b3b

Please sign in to comment.