MDL-33448 enrol_manual: Reduced JS get_string calls for the yui widget
authorSam Hemelryk <sam@moodle.com>
Thu, 1 Nov 2012 21:35:50 +0000 (10:35 +1300)
committerDan Poltawski <dan@moodle.com>
Wed, 12 Dec 2012 01:37:27 +0000 (09:37 +0800)
enrol/manual/yui/quickenrolment/quickenrolment.js

index f57c75d..84a4d90 100644 (file)
@@ -207,9 +207,10 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
             var select = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.DURATION+' select');
             var defaultvalue = this.get(UEP.DEFAULTDURATION);
             var index = 0, count = 0;
+            var durationdays = M.util.get_string('durationdays', 'enrol', '{a}');
             for (var i = 1; i <= 365; i++) {
                 count++;
-                var option = create('<option value="'+i+'">'+M.util.get_string('durationdays', 'enrol', i)+'</option>');
+                var option = create('<option value="'+i+'">'+durationdays.replace('{a}', i)+'</option>');
                 if (i == defaultvalue) {
                     index = count;
                 }