MDL-26626 course competion block - fix hardcoded string
authorDan Poltawski <dan.poltawski@luns.net.uk>
Sun, 3 Jul 2011 21:50:44 +0000 (22:50 +0100)
committerDan Poltawski <dan.poltawski@luns.net.uk>
Sun, 3 Jul 2011 21:51:58 +0000 (22:51 +0100)
blocks/completionstatus/block_completionstatus.php
blocks/completionstatus/lang/en/block_completionstatus.php

index 2f84a3c..9e92f25 100644 (file)
@@ -152,7 +152,10 @@ class block_completionstatus extends block_base {
             $shtml .= '<tr><td>';
             $shtml .= get_string('activitiescompleted', 'completion');
             $shtml .= '</td><td style="text-align: right">';
-            $shtml .= $activities_complete.' of '.count($activities);
+            $a = new stdClass();
+            $a->first = $activities_complete;
+            $a->second = count($activities);
+            $shtml .= get_string('firstofsecond', 'block_completionstatus', $a);
             $shtml .= '</td></tr>';
         }
 
@@ -162,7 +165,10 @@ class block_completionstatus extends block_base {
             $phtml  = '<tr><td>';
             $phtml .= get_string('prerequisitescompleted', 'completion');
             $phtml .= '</td><td style="text-align: right">';
-            $phtml .= $prerequisites_complete.' of '.count($prerequisites);
+            $a = new stdClass();
+            $a->first = $prerequisites_complete;
+            $a->second = count($prerequisites);
+            $shtml .= get_string('firstofsecond', 'block_completionstatus', $a);
             $phtml .= '</td></tr>';
 
             $shtml = $phtml . $shtml;
index a24ec57..50bea4e 100644 (file)
@@ -3,5 +3,6 @@
 $string['completionprogressdetails'] = 'Completion progress details';
 $string['completionstatus'] = 'Course completion status';
 $string['criteriagroup'] = 'Criteria group';
+$string['firstofsecond'] = '{$a->first} of {$a->second}';
 $string['pluginname'] = 'Course completion status';
 $string['requirement'] = 'Requirement';