MDL-29188 multilang Reviewed the uses of section name and ensured things were being...
authorSam Hemelryk <sam@moodle.com>
Tue, 30 Aug 2011 04:43:36 +0000 (16:43 +1200)
committerSam Hemelryk <sam@moodle.com>
Wed, 7 Sep 2011 21:27:38 +0000 (09:27 +1200)
backup/backup.php
course/format/topics/format.php
course/format/weeks/format.php

index 7d3170d..53e037e 100644 (file)
@@ -60,10 +60,12 @@ switch ($type) {
         $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);
index d4a5f4e..fe8fb3e 100644 (file)
@@ -96,7 +96,7 @@ if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing())
     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 @@ while ($section <= $course->numsections) {
             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) {
index 68e66a4..cf48505 100644 (file)
@@ -88,7 +88,7 @@ defined('MOODLE_INTERNAL') || die();
         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 @@ defined('MOODLE_INTERNAL') || die();
 
             } 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');
                 }