Permalink
Browse files

MDL-33448 enrol_manual: Reduced JS get_string calls for the yui widget

  • Loading branch information...
1 parent dc5c56e commit 7a4b7c5e180dc8fb2bcf6962df9d4749d23bd034 Sam Hemelryk committed with danpoltawski Nov 1, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 enrol/manual/yui/quickenrolment/quickenrolment.js
View
3 enrol/manual/yui/quickenrolment/quickenrolment.js
@@ -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;
}

0 comments on commit 7a4b7c5

Please sign in to comment.