MDL-28286 JavaScript: Convert all uses of M.str to M.util.get_string
This commit is contained in:
committed by
Sam Hemelryk
parent
d87bcfb325
commit
64e7aa4de1
@@ -53,9 +53,9 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
|
||||
// Create the capability search input.
|
||||
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
|
||||
// Create a label for the search input.
|
||||
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.str.moodle.filter+' </label>');
|
||||
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.util.get_string('filter', 'moodle')+' </label>');
|
||||
// Create a clear button to clear the input.
|
||||
this.button = Y.Node.create('<input type="button" value="'+M.str.moodle.clear+'" />').set('disabled', filtervalue=='');
|
||||
this.button = Y.Node.create('<input type="button" value="'+M.util.get_string('clear', 'moodle')+'" />').set('disabled', filtervalue=='');
|
||||
|
||||
// Tie it all together
|
||||
this.div.append(this.label).append(this.input).append(this.button);
|
||||
|
||||
@@ -55,7 +55,7 @@ M.tool_assignmentupgrade = {
|
||||
assignmentsinput = Y.one('input.selectedassignments');
|
||||
assignmentsinput.set('value', selectedassignments.join(','));
|
||||
if (selectedassignments.length == 0) {
|
||||
alert(M.str.tool_assignmentupgrade.noassignmentsselected);
|
||||
alert(M.util.get_string('noassignmentsselected', 'tool_assignmentupgrade'));
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ M.tool_spamcleaner = {
|
||||
del_all: function() {
|
||||
var context = M.tool_spamcleaner;
|
||||
|
||||
var yes = confirm(M.str.tool_spamcleaner.spamdeleteallconfirm);
|
||||
var yes = confirm(M.util.get_string('spamdeleteallconfirm', 'tool_spamcleaner'));
|
||||
if (yes) {
|
||||
var cfg = {
|
||||
method: "POST",
|
||||
@@ -15,7 +15,7 @@ M.tool_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(M.str.tool_spamcleaner.spaminvalidresult);
|
||||
alert(M.util.get_string('spaminvalidresult', 'tool_spamcleaner'));
|
||||
return;
|
||||
}
|
||||
if (resp == true) {
|
||||
@@ -36,7 +36,7 @@ M.tool_spamcleaner = {
|
||||
return;
|
||||
}
|
||||
|
||||
var yes = confirm(M.str.tool_spamcleaner.spamdeleteconfirm);
|
||||
var yes = confirm(M.util.get_string('spamdeleteconfirm', 'tool_spamcleaner'));
|
||||
if (yes) {
|
||||
context.row = obj;
|
||||
var cfg = {
|
||||
@@ -46,7 +46,7 @@ M.tool_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(M.str.tool_spamcleaner.spaminvalidresult);
|
||||
alert(M.util.get_string('spaminvalidresult', 'tool_spamcleaner'));
|
||||
return;
|
||||
}
|
||||
if (context.row) {
|
||||
@@ -57,7 +57,7 @@ M.tool_spamcleaner = {
|
||||
context.row.parentNode.removeChild(context.row);
|
||||
context.row = null;
|
||||
} else {
|
||||
alert(M.str.tool_spamcleaner.spamcannotdelete);
|
||||
alert(M.util.get_string('spamcannotdelete', 'tool_spamcleaner'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ M.tool_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(M.str.tool_spamcleaner.spaminvalidresult);
|
||||
alert(M.util.get_string('spaminvalidresult', 'tool_spamcleaner'));
|
||||
return;
|
||||
}
|
||||
if (context.row) {
|
||||
|
||||
+10
-11
@@ -25,22 +25,21 @@ M.availability_completion.form.initInner = function(cms) {
|
||||
|
||||
M.availability_completion.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_completion;
|
||||
var html = strings.title + ' <span class="availability-group"><label>' +
|
||||
'<span class="accesshide">' + strings.label_cm + ' </span>' +
|
||||
'<select name="cm" title="' + strings.label_cm + '">' +
|
||||
'<option value="0">' + M.str.moodle.choosedots + '</option>';
|
||||
var html = M.util.get_string('title', 'availability_completion') + ' <span class="availability-group"><label>' +
|
||||
'<span class="accesshide">' + M.util.get_string('label_cm', 'availability_completion') + ' </span>' +
|
||||
'<select name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.cms.length; i++) {
|
||||
var cm = this.cms[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + cm.id + '">' + cm.name + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_completion +
|
||||
' </span><select name="e" title="' + strings.label_completion + '">' +
|
||||
'<option value="1">' + strings.option_complete + '</option>' +
|
||||
'<option value="0">' + strings.option_incomplete + '</option>' +
|
||||
'<option value="2">' + strings.option_pass + '</option>' +
|
||||
'<option value="3">' + strings.option_fail + '</option>' +
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_completion', 'availability_completion') +
|
||||
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
|
||||
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
|
||||
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
|
||||
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
|
||||
'</select></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n=M.str.availability_completion,r=n.title+' <span class="availability-group"><label>'+'<span class="accesshide">'+n.label_cm+" </span>"+'<select name="cm" title="'+n.label_cm+'">'+'<option value="0">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.cms.length;i++){var s=this.cms[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+='</select></label> <label><span class="accesshide">'+n.label_completion+' </span><select name="e" title="'+n.label_completion+'">'+'<option value="1">'+n.option_complete+"</option>"+'<option value="0">'+n.option_incomplete+"</option>"+'<option value="2">'+n.option_pass+"</option>"+'<option value="3">'+n.option_fail+"</option>"+"</select></label></span>";var o=e.Node.create("<span>"+r+"</span>");t.cm!==undefined&&o.one("select[name=cm] > option[value="+t.cm+"]")&&o.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&o.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var u=e.one("#fitem_id_availabilityconditionsjson");u.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return o},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n=M.util.get_string("title","availability_completion")+' <span class="availability-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create("<span>"+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+10
-11
@@ -25,22 +25,21 @@ M.availability_completion.form.initInner = function(cms) {
|
||||
|
||||
M.availability_completion.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_completion;
|
||||
var html = strings.title + ' <span class="availability-group"><label>' +
|
||||
'<span class="accesshide">' + strings.label_cm + ' </span>' +
|
||||
'<select name="cm" title="' + strings.label_cm + '">' +
|
||||
'<option value="0">' + M.str.moodle.choosedots + '</option>';
|
||||
var html = M.util.get_string('title', 'availability_completion') + ' <span class="availability-group"><label>' +
|
||||
'<span class="accesshide">' + M.util.get_string('label_cm', 'availability_completion') + ' </span>' +
|
||||
'<select name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.cms.length; i++) {
|
||||
var cm = this.cms[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + cm.id + '">' + cm.name + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_completion +
|
||||
' </span><select name="e" title="' + strings.label_completion + '">' +
|
||||
'<option value="1">' + strings.option_complete + '</option>' +
|
||||
'<option value="0">' + strings.option_incomplete + '</option>' +
|
||||
'<option value="2">' + strings.option_pass + '</option>' +
|
||||
'<option value="3">' + strings.option_fail + '</option>' +
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_completion', 'availability_completion') +
|
||||
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
|
||||
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
|
||||
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
|
||||
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
|
||||
'</select></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
|
||||
+10
-11
@@ -23,22 +23,21 @@ M.availability_completion.form.initInner = function(cms) {
|
||||
|
||||
M.availability_completion.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_completion;
|
||||
var html = strings.title + ' <span class="availability-group"><label>' +
|
||||
'<span class="accesshide">' + strings.label_cm + ' </span>' +
|
||||
'<select name="cm" title="' + strings.label_cm + '">' +
|
||||
'<option value="0">' + M.str.moodle.choosedots + '</option>';
|
||||
var html = M.util.get_string('title', 'availability_completion') + ' <span class="availability-group"><label>' +
|
||||
'<span class="accesshide">' + M.util.get_string('label_cm', 'availability_completion') + ' </span>' +
|
||||
'<select name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.cms.length; i++) {
|
||||
var cm = this.cms[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + cm.id + '">' + cm.name + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_completion +
|
||||
' </span><select name="e" title="' + strings.label_completion + '">' +
|
||||
'<option value="1">' + strings.option_complete + '</option>' +
|
||||
'<option value="0">' + strings.option_incomplete + '</option>' +
|
||||
'<option value="2">' + strings.option_pass + '</option>' +
|
||||
'<option value="3">' + strings.option_fail + '</option>' +
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_completion', 'availability_completion') +
|
||||
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
|
||||
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
|
||||
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
|
||||
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
|
||||
'</select></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
|
||||
+6
-7
@@ -29,12 +29,11 @@ M.availability_date.form.initInner = function(html, defaultTime) {
|
||||
};
|
||||
|
||||
M.availability_date.form.getNode = function(json) {
|
||||
var strings = M.str.availability_date;
|
||||
var html = strings.direction_before + ' <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + strings.direction_label + ' </span>' +
|
||||
var html = M.util.get_string('direction_before', 'availability_date') + ' <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + M.util.get_string('direction_label', 'availability_date') + ' </span>' +
|
||||
'<select name="direction">' +
|
||||
'<option value=">=">' + strings.direction_from + '</option>' +
|
||||
'<option value="<">' + strings.direction_until + '</option>' +
|
||||
'<option value=">=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
|
||||
'<option value="<">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
|
||||
'</select></label></span> ' + this.html;
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
@@ -58,7 +57,7 @@ M.availability_date.form.getNode = function(json) {
|
||||
}
|
||||
},
|
||||
failure : function() {
|
||||
window.alert(M.str.availability_date.ajaxerror);
|
||||
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
|
||||
}
|
||||
}});
|
||||
} else {
|
||||
@@ -132,7 +131,7 @@ M.availability_date.form.updateTime = function(node) {
|
||||
M.core_availability.form.update();
|
||||
},
|
||||
failure : function() {
|
||||
window.alert(M.str.availability_date.ajaxerror);
|
||||
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
|
||||
}
|
||||
}});
|
||||
};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_date-form",function(e,t){M.availability_date=M.availability_date||{},M.availability_date.form=e.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,t){this.html=e,this.defaultTime=t},M.availability_date.form.getNode=function(t){var n=M.str.availability_date,r=n.direction_before+' <span class="availability-group">'+'<label><span class="accesshide">'+n.direction_label+" </span>"+'<select name="direction">'+'<option value=">=">'+n.direction_from+"</option>"+'<option value="<">'+n.direction_until+"</option>"+"</select></label></span> "+this.html,i=e.Node.create("<span>"+r+"</span>");if(t.t!==undefined){i.setData("time",t.t),i.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)});var s=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime"+"&time="+t.t;e.io(s,{on:{success:function(t,n){var r=e.JSON.parse(n.responseText);for(var s in r){var o=i.one("select[name=x\\["+s+"\\]]");o.set("value",""+r[s]),o.set("disabled",!1)}},failure:function(){window.alert(M.str.availability_date.ajaxerror)}}})}else i.setData("time",this.defaultTime);t.d!==undefined&&i.one("select[name=direction]").set("value",t.d);if(!M.availability_date.form.addedEvents){M.availability_date.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),o.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")}if(i.one("a[href=#]")){M.form.dateselector.init_single_date_selector(i);var u=i.one("select[name=x\\[year\\]]"),a=u.set;u.set=function(e,t){a.call(u,e,t),e==="selectedIndex"&&setTimeout(function(){M.availability_date.form.updateTime(i)},0)}}return i},M.availability_date.form.updateTime=function(t){var n=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime"+"&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");e.io(n,{on:{success:function(e,n){t.setData("time",n.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.str.availability_date.ajaxerror)}}})},M.availability_date.form.fillValue=function(e,t){e.d=t.one("select[name=direction]").get("value"),e.t=parseInt(t.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_date-form",function(e,t){M.availability_date=M.availability_date||{},M.availability_date.form=e.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,t){this.html=e,this.defaultTime=t},M.availability_date.form.getNode=function(t){var n=M.util.get_string("direction_before","availability_date")+' <span class="availability-group">'+'<label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+" </span>"+'<select name="direction">'+'<option value=">=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="<">'+M.util.get_string("direction_until","availability_date")+"</option>"+"</select></label></span> "+this.html,r=e.Node.create("<span>"+n+"</span>");if(t.t!==undefined){r.setData("time",t.t),r.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)});var i=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime"+"&time="+t.t;e.io(i,{on:{success:function(t,n){var i=e.JSON.parse(n.responseText);for(var s in i){var o=r.one("select[name=x\\["+s+"\\]]");o.set("value",""+i[s]),o.set("disabled",!1)}},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})}else r.setData("time",this.defaultTime);t.d!==undefined&&r.one("select[name=direction]").set("value",t.d);if(!M.availability_date.form.addedEvents){M.availability_date.form.addedEvents=!0;var s=e.one("#fitem_id_availabilityconditionsjson");s.delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),s.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")}if(r.one("a[href=#]")){M.form.dateselector.init_single_date_selector(r);var o=r.one("select[name=x\\[year\\]]"),u=o.set;o.set=function(e,t){u.call(o,e,t),e==="selectedIndex"&&setTimeout(function(){M.availability_date.form.updateTime(r)},0)}}return r},M.availability_date.form.updateTime=function(t){var n=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime"+"&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");e.io(n,{on:{success:function(e,n){t.setData("time",n.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,t){e.d=t.one("select[name=direction]").get("value"),e.t=parseInt(t.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
|
||||
|
||||
availability/condition/date/yui/build/moodle-availability_date-form/moodle-availability_date-form.js
Vendored
+6
-7
@@ -29,12 +29,11 @@ M.availability_date.form.initInner = function(html, defaultTime) {
|
||||
};
|
||||
|
||||
M.availability_date.form.getNode = function(json) {
|
||||
var strings = M.str.availability_date;
|
||||
var html = strings.direction_before + ' <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + strings.direction_label + ' </span>' +
|
||||
var html = M.util.get_string('direction_before', 'availability_date') + ' <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + M.util.get_string('direction_label', 'availability_date') + ' </span>' +
|
||||
'<select name="direction">' +
|
||||
'<option value=">=">' + strings.direction_from + '</option>' +
|
||||
'<option value="<">' + strings.direction_until + '</option>' +
|
||||
'<option value=">=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
|
||||
'<option value="<">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
|
||||
'</select></label></span> ' + this.html;
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
@@ -58,7 +57,7 @@ M.availability_date.form.getNode = function(json) {
|
||||
}
|
||||
},
|
||||
failure : function() {
|
||||
window.alert(M.str.availability_date.ajaxerror);
|
||||
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
|
||||
}
|
||||
}});
|
||||
} else {
|
||||
@@ -132,7 +131,7 @@ M.availability_date.form.updateTime = function(node) {
|
||||
M.core_availability.form.update();
|
||||
},
|
||||
failure : function() {
|
||||
window.alert(M.str.availability_date.ajaxerror);
|
||||
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
|
||||
}
|
||||
}});
|
||||
};
|
||||
|
||||
+6
-7
@@ -27,12 +27,11 @@ M.availability_date.form.initInner = function(html, defaultTime) {
|
||||
};
|
||||
|
||||
M.availability_date.form.getNode = function(json) {
|
||||
var strings = M.str.availability_date;
|
||||
var html = strings.direction_before + ' <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + strings.direction_label + ' </span>' +
|
||||
var html = M.util.get_string('direction_before', 'availability_date') + ' <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + M.util.get_string('direction_label', 'availability_date') + ' </span>' +
|
||||
'<select name="direction">' +
|
||||
'<option value=">=">' + strings.direction_from + '</option>' +
|
||||
'<option value="<">' + strings.direction_until + '</option>' +
|
||||
'<option value=">=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
|
||||
'<option value="<">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
|
||||
'</select></label></span> ' + this.html;
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
@@ -56,7 +55,7 @@ M.availability_date.form.getNode = function(json) {
|
||||
}
|
||||
},
|
||||
failure : function() {
|
||||
window.alert(M.str.availability_date.ajaxerror);
|
||||
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
|
||||
}
|
||||
}});
|
||||
} else {
|
||||
@@ -130,7 +129,7 @@ M.availability_date.form.updateTime = function(node) {
|
||||
M.core_availability.form.update();
|
||||
},
|
||||
failure : function() {
|
||||
window.alert(M.str.availability_date.ajaxerror);
|
||||
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
|
||||
}
|
||||
}});
|
||||
};
|
||||
|
||||
+8
-9
@@ -37,24 +37,23 @@ M.availability_grade.form.getNode = function(json) {
|
||||
this.nodesSoFar++;
|
||||
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_grade;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.str.moodle.choosedots + '</option>';
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grade') + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.grades.length; i++) {
|
||||
var grade = this.grades[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + grade.id + '">' + grade.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label> <span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="min"/>' + strings.option_min +
|
||||
'</label> <label><span class="accesshide">' + strings.label_min +
|
||||
'<label><input type="checkbox" name="min"/>' + M.util.get_string('option_min', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_min', 'availability_grade') +
|
||||
'</span><input type="text" name="minval" title="' +
|
||||
strings.label_min + '"/></label>%</span>' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span>' +
|
||||
'<span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="max"/>' + strings.option_max +
|
||||
'</label> <label><span class="accesshide">' + strings.label_max +
|
||||
'<label><input type="checkbox" name="max"/>' + M.util.get_string('option_max', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
|
||||
'</span><input type="text" name="maxval" title="' +
|
||||
strings.label_max + '"/></label>%</span>';
|
||||
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
// Set initial values.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n=M.str.availability_grade,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.grades.length;i++){var s=this.grades[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+n.option_min+'</label> <label><span class="accesshide">'+n.label_min+'</span><input type="text" name="minval" title="'+n.label_min+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+n.option_max+'</label> <label><span class="accesshide">'+n.label_max+'</span><input type="text" name="maxval" title="'+n.label_max+'"/></label>%</span>';var o=e.Node.create("<span>"+r+"</span>");t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")&&o.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(o.one("input[name=min]").set("checked",!0),o.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(o.one("input[name=max]").set("checked",!0),o.one("input[name=maxval]").set("value",t.max));var u=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};o.all("input[type=checkbox]").each(u);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){u(this,!0)},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return o},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n="<label>"+M.util.get_string("title","availability_grade")+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.grades.length;r++){var i=this.grades[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>';var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(s.one("input[name=min]").set("checked",!0),s.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(s.one("input[name=max]").set("checked",!0),s.one("input[name=maxval]").set("value",t.max));var o=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};s.all("input[type=checkbox]").each(o);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var u=e.one("#fitem_id_availabilityconditionsjson");u.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),u.delegate("click",function(){o(this,!0)},".availability_grade input[type=checkbox]"),u.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return s},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+8
-9
@@ -37,24 +37,23 @@ M.availability_grade.form.getNode = function(json) {
|
||||
this.nodesSoFar++;
|
||||
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_grade;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.str.moodle.choosedots + '</option>';
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grade') + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.grades.length; i++) {
|
||||
var grade = this.grades[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + grade.id + '">' + grade.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label> <span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="min"/>' + strings.option_min +
|
||||
'</label> <label><span class="accesshide">' + strings.label_min +
|
||||
'<label><input type="checkbox" name="min"/>' + M.util.get_string('option_min', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_min', 'availability_grade') +
|
||||
'</span><input type="text" name="minval" title="' +
|
||||
strings.label_min + '"/></label>%</span>' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span>' +
|
||||
'<span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="max"/>' + strings.option_max +
|
||||
'</label> <label><span class="accesshide">' + strings.label_max +
|
||||
'<label><input type="checkbox" name="max"/>' + M.util.get_string('option_max', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
|
||||
'</span><input type="text" name="maxval" title="' +
|
||||
strings.label_max + '"/></label>%</span>';
|
||||
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
// Set initial values.
|
||||
|
||||
+8
-9
@@ -35,24 +35,23 @@ M.availability_grade.form.getNode = function(json) {
|
||||
this.nodesSoFar++;
|
||||
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_grade;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.str.moodle.choosedots + '</option>';
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grade') + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.grades.length; i++) {
|
||||
var grade = this.grades[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + grade.id + '">' + grade.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label> <span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="min"/>' + strings.option_min +
|
||||
'</label> <label><span class="accesshide">' + strings.label_min +
|
||||
'<label><input type="checkbox" name="min"/>' + M.util.get_string('option_min', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_min', 'availability_grade') +
|
||||
'</span><input type="text" name="minval" title="' +
|
||||
strings.label_min + '"/></label>%</span>' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span>' +
|
||||
'<span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="max"/>' + strings.option_max +
|
||||
'</label> <label><span class="accesshide">' + strings.label_max +
|
||||
'<label><input type="checkbox" name="max"/>' + M.util.get_string('option_max', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
|
||||
'</span><input type="text" name="maxval" title="' +
|
||||
strings.label_max + '"/></label>%</span>';
|
||||
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
// Set initial values.
|
||||
|
||||
+3
-4
@@ -33,11 +33,10 @@ M.availability_group.form.initInner = function(groups) {
|
||||
|
||||
M.availability_group.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_group;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_group') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>' +
|
||||
'<option value="any">' + strings.anygroup + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>' +
|
||||
'<option value="any">' + M.util.get_string('anygroup', 'availability_group') + '</option>';
|
||||
for (var i = 0; i < this.groups.length; i++) {
|
||||
var group = this.groups[i];
|
||||
// String has already been escaped using format_string.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_group-form",function(e,t){M.availability_group=M.availability_group||{},M.availability_group.form=e.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(e){this.groups=e},M.availability_group.form.getNode=function(t){var n=M.str.availability_group,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>"+'<option value="any">'+n.anygroup+"</option>";for(var i=0;i<this.groups.length;i++){var s=this.groups[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+="</select></span></label>";var o=e.Node.create("<span>"+r+"</span>");t.creating===undefined&&(t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")?o.one("select[name=id]").set("value",""+t.id):t.id===undefined&&o.one("select[name=id]").set("value","any"));if(!M.availability_group.form.addedEvents){M.availability_group.form.addedEvents=!0;var u=e.one("#fitem_id_availabilityconditionsjson");u.delegate("change",function(){M.core_availability.form.update()},".availability_group select")}return o},M.availability_group.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":n!=="any"&&(e.id=parseInt(n,10))},M.availability_group.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id&&n.id==="choose"&&e.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_group-form",function(e,t){M.availability_group=M.availability_group||{},M.availability_group.form=e.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(e){this.groups=e},M.availability_group.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_group")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>"+'<option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>";for(var r=0;r<this.groups.length;r++){var i=this.groups[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.creating===undefined&&(t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")?s.one("select[name=id]").set("value",""+t.id):t.id===undefined&&s.one("select[name=id]").set("value","any"));if(!M.availability_group.form.addedEvents){M.availability_group.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_group select")}return s},M.availability_group.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":n!=="any"&&(e.id=parseInt(n,10))},M.availability_group.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id&&n.id==="choose"&&e.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+3
-4
@@ -33,11 +33,10 @@ M.availability_group.form.initInner = function(groups) {
|
||||
|
||||
M.availability_group.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_group;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_group') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>' +
|
||||
'<option value="any">' + strings.anygroup + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>' +
|
||||
'<option value="any">' + M.util.get_string('anygroup', 'availability_group') + '</option>';
|
||||
for (var i = 0; i < this.groups.length; i++) {
|
||||
var group = this.groups[i];
|
||||
// String has already been escaped using format_string.
|
||||
|
||||
+3
-4
@@ -31,11 +31,10 @@ M.availability_group.form.initInner = function(groups) {
|
||||
|
||||
M.availability_group.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_group;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_group') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>' +
|
||||
'<option value="any">' + strings.anygroup + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>' +
|
||||
'<option value="any">' + M.util.get_string('anygroup', 'availability_group') + '</option>';
|
||||
for (var i = 0; i < this.groups.length; i++) {
|
||||
var group = this.groups[i];
|
||||
// String has already been escaped using format_string.
|
||||
|
||||
+2
-3
@@ -33,10 +33,9 @@ M.availability_grouping.form.initInner = function(groupings) {
|
||||
|
||||
M.availability_grouping.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_grouping;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grouping') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.groupings.length; i++) {
|
||||
var grouping = this.groupings[i];
|
||||
// String has already been escaped using format_string.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_grouping-form",function(e,t){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=e.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(e){this.groupings=e},M.availability_grouping.form.getNode=function(t){var n=M.str.availability_grouping,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.groupings.length;i++){var s=this.groupings[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+="</select></span></label>";var o=e.Node.create("<span>"+r+"</span>");t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")&&o.one("select[name=id]").set("value",""+t.id);if(!M.availability_grouping.form.addedEvents){M.availability_grouping.form.addedEvents=!0;var u=e.one("#fitem_id_availabilityconditionsjson");u.delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")}return o},M.availability_grouping.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":e.id=parseInt(n,10)},M.availability_grouping.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id==="choose"&&e.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_grouping-form",function(e,t){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=e.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(e){this.groupings=e},M.availability_grouping.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_grouping")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.groupings.length;r++){var i=this.groupings[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id);if(!M.availability_grouping.form.addedEvents){M.availability_grouping.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")}return s},M.availability_grouping.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":e.id=parseInt(n,10)},M.availability_grouping.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id==="choose"&&e.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+2
-3
@@ -33,10 +33,9 @@ M.availability_grouping.form.initInner = function(groupings) {
|
||||
|
||||
M.availability_grouping.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_grouping;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grouping') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.groupings.length; i++) {
|
||||
var grouping = this.groupings[i];
|
||||
// String has already been escaped using format_string.
|
||||
|
||||
+2
-3
@@ -31,10 +31,9 @@ M.availability_grouping.form.initInner = function(groupings) {
|
||||
|
||||
M.availability_grouping.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_grouping;
|
||||
var html = '<label>' + strings.title + ' <span class="availability-group">' +
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grouping') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.groupings.length; i++) {
|
||||
var grouping = this.groupings[i];
|
||||
// String has already been escaped using format_string.
|
||||
|
||||
+7
-8
@@ -35,10 +35,9 @@ M.availability_profile.form.initInner = function(standardFields, customFields) {
|
||||
|
||||
M.availability_profile.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_profile;
|
||||
var html = '<span class="availability-group"><label>' + strings.conditiontitle + ' ' +
|
||||
var html = '<span class="availability-group"><label>' + M.util.get_string('conditiontitle', 'availability_profile') + ' ' +
|
||||
'<select name="field">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var fieldInfo;
|
||||
for (var i = 0; i < this.standardFields.length; i++) {
|
||||
fieldInfo = this.standardFields[i];
|
||||
@@ -50,17 +49,17 @@ M.availability_profile.form.getNode = function(json) {
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="cf_' + fieldInfo.field + '">' + fieldInfo.display + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_operator +
|
||||
' </span><select name="op" title="' + strings.label_operator + '">';
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_operator', 'availability_profile') +
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '">';
|
||||
var operators = ['isequalto', 'contains', 'doesnotcontain', 'startswith', 'endswith',
|
||||
'isempty', 'isnotempty'];
|
||||
for (i = 0; i < operators.length; i++) {
|
||||
html += '<option value="' + operators[i] + '">' +
|
||||
strings['op_' + operators[i]] + '</option>';
|
||||
M.util.get_string('op_' + operators[i], 'availability_profile') + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_value +
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_value', 'availability_profile') +
|
||||
'</span><input name="value" type="text" style="width: 10em" title="' +
|
||||
strings.label_value + '"/></label></span>';
|
||||
M.util.get_string('label_value', 'availability_profile') + '"/></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
// Set initial values if specified.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n=M.str.availability_profile,r='<span class="availability-group"><label>'+n.conditiontitle+" "+'<select name="field">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>",i;for(var s=0;s<this.standardFields.length;s++)i=this.standardFields[s],r+='<option value="sf_'+i.field+'">'+i.display+"</option>";for(s=0;s<this.customFields.length;s++)i=this.customFields[s],r+='<option value="cf_'+i.field+'">'+i.display+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_operator+' </span><select name="op" title="'+n.label_operator+'">';var o=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(s=0;s<o.length;s++)r+='<option value="'+o[s]+'">'+n["op_"+o[s]]+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_value+'</span><input name="value" type="text" style="width: 10em" title="'+n.label_value+'"/></label></span>';var u=e.Node.create("<span>"+r+"</span>");t.sf!==undefined&&u.one("select[name=field] > option[value=sf_"+t.sf+"]")?u.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&u.one("select[name=field] > option[value=cf_"+t.cf+"]")&&u.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&u.one("select[name=op] > option[value="+t.op+"]")&&(u.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&u.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&u.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var a=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},f=e.one("#fitem_id_availabilityconditionsjson");f.delegate("change",function(){a(this)},".availability_profile select"),f.delegate("change",function(){a(this)},".availability_profile input[name=value]")}return u},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n='<span class="availability-group"><label>'+M.util.get_string("conditiontitle","availability_profile")+" "+'<select name="field">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",r;for(var i=0;i<this.standardFields.length;i++)r=this.standardFields[i],n+='<option value="sf_'+r.field+'">'+r.display+"</option>";for(i=0;i<this.customFields.length;i++)r=this.customFields[i],n+='<option value="cf_'+r.field+'">'+r.display+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'">';var s=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(i=0;i<s.length;i++)n+='<option value="'+s[i]+'">'+M.util.get_string("op_"+s[i],"availability_profile")+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>';var o=e.Node.create("<span>"+n+"</span>");t.sf!==undefined&&o.one("select[name=field] > option[value=sf_"+t.sf+"]")?o.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&o.one("select[name=field] > option[value=cf_"+t.cf+"]")&&o.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&o.one("select[name=op] > option[value="+t.op+"]")&&(o.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&o.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&o.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var u=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){u(this)},".availability_profile select"),a.delegate("change",function(){u(this)},".availability_profile input[name=value]")}return o},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+7
-8
@@ -35,10 +35,9 @@ M.availability_profile.form.initInner = function(standardFields, customFields) {
|
||||
|
||||
M.availability_profile.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_profile;
|
||||
var html = '<span class="availability-group"><label>' + strings.conditiontitle + ' ' +
|
||||
var html = '<span class="availability-group"><label>' + M.util.get_string('conditiontitle', 'availability_profile') + ' ' +
|
||||
'<select name="field">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var fieldInfo;
|
||||
for (var i = 0; i < this.standardFields.length; i++) {
|
||||
fieldInfo = this.standardFields[i];
|
||||
@@ -50,17 +49,17 @@ M.availability_profile.form.getNode = function(json) {
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="cf_' + fieldInfo.field + '">' + fieldInfo.display + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_operator +
|
||||
' </span><select name="op" title="' + strings.label_operator + '">';
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_operator', 'availability_profile') +
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '">';
|
||||
var operators = ['isequalto', 'contains', 'doesnotcontain', 'startswith', 'endswith',
|
||||
'isempty', 'isnotempty'];
|
||||
for (i = 0; i < operators.length; i++) {
|
||||
html += '<option value="' + operators[i] + '">' +
|
||||
strings['op_' + operators[i]] + '</option>';
|
||||
M.util.get_string('op_' + operators[i], 'availability_profile') + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_value +
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_value', 'availability_profile') +
|
||||
'</span><input name="value" type="text" style="width: 10em" title="' +
|
||||
strings.label_value + '"/></label></span>';
|
||||
M.util.get_string('label_value', 'availability_profile') + '"/></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
// Set initial values if specified.
|
||||
|
||||
+7
-8
@@ -33,10 +33,9 @@ M.availability_profile.form.initInner = function(standardFields, customFields) {
|
||||
|
||||
M.availability_profile.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var strings = M.str.availability_profile;
|
||||
var html = '<span class="availability-group"><label>' + strings.conditiontitle + ' ' +
|
||||
var html = '<span class="availability-group"><label>' + M.util.get_string('conditiontitle', 'availability_profile') + ' ' +
|
||||
'<select name="field">' +
|
||||
'<option value="choose">' + M.str.moodle.choosedots + '</option>';
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var fieldInfo;
|
||||
for (var i = 0; i < this.standardFields.length; i++) {
|
||||
fieldInfo = this.standardFields[i];
|
||||
@@ -48,17 +47,17 @@ M.availability_profile.form.getNode = function(json) {
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="cf_' + fieldInfo.field + '">' + fieldInfo.display + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_operator +
|
||||
' </span><select name="op" title="' + strings.label_operator + '">';
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_operator', 'availability_profile') +
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '">';
|
||||
var operators = ['isequalto', 'contains', 'doesnotcontain', 'startswith', 'endswith',
|
||||
'isempty', 'isnotempty'];
|
||||
for (i = 0; i < operators.length; i++) {
|
||||
html += '<option value="' + operators[i] + '">' +
|
||||
strings['op_' + operators[i]] + '</option>';
|
||||
M.util.get_string('op_' + operators[i], 'availability_profile') + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + strings.label_value +
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_value', 'availability_profile') +
|
||||
'</span><input name="value" type="text" style="width: 10em" title="' +
|
||||
strings.label_value + '"/></label></span>';
|
||||
M.util.get_string('label_value', 'availability_profile') + '"/></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
|
||||
// Set initial values if specified.
|
||||
|
||||
Vendored
+45
-45
@@ -260,24 +260,23 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
if (root !== undefined) {
|
||||
this.root = root;
|
||||
}
|
||||
var strings = M.str.availability;
|
||||
// Create DIV structure (without kids).
|
||||
this.node = Y.Node.create('<div class="availability-list"><h3 class="accesshide"></h3>' +
|
||||
'<div class="availability-inner">' +
|
||||
'<div class="availability-header">' + strings.listheader_sign_before +
|
||||
' <label><span class="accesshide">' + strings.label_sign +
|
||||
' </span><select class="availability-neg" title="' + strings.label_sign + '">' +
|
||||
'<option value="">' + strings.listheader_sign_pos + '</option>' +
|
||||
'<option value="!">' + strings.listheader_sign_neg + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + strings.listheader_single + '</span>' +
|
||||
'<span class="availability-multi">' + strings.listheader_multi_before +
|
||||
' <label><span class="accesshide">' + strings.label_multi + ' </span>' +
|
||||
'<select class="availability-op" title="' + strings.label_multi + '"><option value="&">' +
|
||||
strings.listheader_multi_and + '</option>' +
|
||||
'<option value="|">' + strings.listheader_multi_or + '</option></select></label> ' +
|
||||
strings.listheader_multi_after + '</span></div>' +
|
||||
'<div class="availability-header">' + M.util.get_string('listheader_sign_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_sign', 'availability') +
|
||||
' </span><select class="availability-neg" title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
'<option value="">' + M.util.get_string('listheader_sign_pos', 'availability') + '</option>' +
|
||||
'<option value="!">' + M.util.get_string('listheader_sign_neg', 'availability') + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + M.util.get_string('listheader_single', 'availability') + '</span>' +
|
||||
'<span class="availability-multi">' + M.util.get_string('listheader_multi_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_multi', 'availability') + ' </span>' +
|
||||
'<select class="availability-op" title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
M.util.get_string('listheader_multi_and', 'availability') + '</option>' +
|
||||
'<option value="|">' + M.util.get_string('listheader_multi_or', 'availability') + '</option></select></label> ' +
|
||||
M.util.get_string('listheader_multi_after', 'availability') + '</span></div>' +
|
||||
'<div class="availability-children"></div>' +
|
||||
'<div class="availability-none">' + M.str.moodle.none + '</div>' +
|
||||
'<div class="availability-none">' + M.util.get_string('none', 'moodle') + '</div>' +
|
||||
'<div class="availability-button"></div></div></div>');
|
||||
if (!root) {
|
||||
this.node.addClass('availability-childlist');
|
||||
@@ -313,12 +312,12 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
|
||||
// Also if it's not the root, none is actually invalid, so add a label.
|
||||
noneNode.appendChild(Y.Node.create('<span class="label label-warning">' +
|
||||
M.str.availability.invalid + '</span>'));
|
||||
M.util.get_string('invalid', 'availability') + '</span>'));
|
||||
}
|
||||
|
||||
// Create the button and add it.
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
|
||||
M.str.availability.addrestriction + '</button>');
|
||||
M.util.get_string('addrestriction', 'availability') + '</button>');
|
||||
button.on("click", function() { this.clickAdd(); }, this);
|
||||
this.node.one('div.availability-button').appendChild(button);
|
||||
|
||||
@@ -509,9 +508,9 @@ M.core_availability.List.prototype.updateHtml = function() {
|
||||
// Update connector text.
|
||||
var connectorText;
|
||||
if (this.inner.one('.availability-op').get('value') === '&') {
|
||||
connectorText = M.str.availability.and;
|
||||
connectorText = M.util.get_string('and', 'availability');
|
||||
} else {
|
||||
connectorText = M.str.availability.or;
|
||||
connectorText = M.util.get_string('or', 'availability');
|
||||
}
|
||||
this.inner.all('> .availability-children > .availability-connector span.label').each(function(span) {
|
||||
span.set('innerHTML', connectorText);
|
||||
@@ -573,7 +572,7 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
var content = Y.Node.create('<div>' +
|
||||
'<ul class="list-unstyled"></ul>' +
|
||||
'<div class="availability-buttons mdl-align">' +
|
||||
'<button type="button" class="btn btn-default">' + M.str.moodle.cancel +
|
||||
'<button type="button" class="btn btn-default">' + M.util.get_string('cancel', 'moodle') +
|
||||
'</button></div></div>');
|
||||
var cancel = content.one('button');
|
||||
|
||||
@@ -589,13 +588,12 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
// Add entry for plugin.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
id = 'availability_addrestriction_' + type;
|
||||
var pluginStrings = M.str['availability_' + type];
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
'id="' + id + '">' + pluginStrings.title + '</button>');
|
||||
'id="' + id + '">' + M.util.get_string('title', 'availability_' + type) + '</button>');
|
||||
button.on('click', this.getAddHandler(type, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
pluginStrings.description + '</label>');
|
||||
M.util.get_string('description', 'availability_' + type) + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
@@ -603,16 +601,16 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
id = 'availability_addrestriction_list_';
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
'id="' + id + '">' + M.str.availability.condition_group + '</button>');
|
||||
'id="' + id + '">' + M.util.get_string('condition_group', 'availability') + '</button>');
|
||||
button.on('click', this.getAddHandler(null, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
M.str.availability.condition_group_info + '</label>');
|
||||
M.util.get_string('condition_group_info', 'availability') + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
|
||||
var config = {
|
||||
headerContent : M.str.availability.addrestriction,
|
||||
headerContent : M.util.get_string('addrestriction', 'availability'),
|
||||
bodyContent : content,
|
||||
additionalBaseClass : 'availability-dialogue',
|
||||
draggable : true,
|
||||
@@ -766,7 +764,7 @@ M.core_availability.Item = function(json, root) {
|
||||
// Handle undefined plugins.
|
||||
this.plugin = null;
|
||||
this.pluginNode = Y.Node.create('<div class="availability-warning">' +
|
||||
M.str.availability.missingplugin + '</div>');
|
||||
M.util.get_string('missingplugin', 'availability') + '</div>');
|
||||
} else {
|
||||
// Plugin is known.
|
||||
this.plugin = M.core_availability.form.plugins[json.type];
|
||||
@@ -837,7 +835,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
|
||||
// If any errors were added, add the marker to this item.
|
||||
var errorLabel = this.node.one('> .label-warning');
|
||||
if (errors.length !== before && !errorLabel.get('firstChild')) {
|
||||
errorLabel.appendChild(document.createTextNode(M.str.availability.invalid));
|
||||
errorLabel.appendChild(document.createTextNode(M.util.get_string('invalid', 'availability')));
|
||||
} else if (errors.length === before && errorLabel.get('firstChild')) {
|
||||
errorLabel.get('firstChild').remove();
|
||||
}
|
||||
@@ -853,7 +851,7 @@ M.core_availability.Item.prototype.renumber = function(number) {
|
||||
// Update heading for item.
|
||||
var headingParams = { number: number };
|
||||
if (this.plugin) {
|
||||
headingParams.type = M.str['availability_' + this.pluginType].title;
|
||||
headingParams.type = M.util.get_string('title', 'availability_' + this.pluginType);
|
||||
} else {
|
||||
headingParams.type = '[' + this.pluginType + ']';
|
||||
}
|
||||
@@ -932,19 +930,21 @@ M.core_availability.EyeIcon = function(individual, shown) {
|
||||
this.span.appendChild(icon);
|
||||
|
||||
// Set up button text and icon.
|
||||
var suffix = individual ? '_individual' : '_all';
|
||||
var setHidden = function() {
|
||||
icon.set('src', M.util.image_url('i/show', 'core'));
|
||||
icon.set('alt', M.str.availability['hidden' + suffix]);
|
||||
this.span.set('title', M.str.availability['hidden' + suffix] + ' \u2022 ' +
|
||||
M.str.availability.show_verb);
|
||||
};
|
||||
var setShown = function() {
|
||||
icon.set('src', M.util.image_url('i/hide', 'core'));
|
||||
icon.set('alt', M.str.availability['shown' + suffix]);
|
||||
this.span.set('title', M.str.availability['shown' + suffix] + ' \u2022 ' +
|
||||
M.str.availability.hide_verb);
|
||||
};
|
||||
var suffix = individual ? '_individual' : '_all',
|
||||
setHidden = function() {
|
||||
var hiddenStr = M.util.get_string('hidden' + suffix, 'availability');
|
||||
icon.set('src', M.util.image_url('i/show', 'core'));
|
||||
icon.set('alt', hiddenStr);
|
||||
this.span.set('title', hiddenStr + ' \u2022 ' +
|
||||
M.util.get_string('show_verb', 'availability'));
|
||||
},
|
||||
setShown = function() {
|
||||
var shownStr = M.util.get_string('shown' + suffix, 'availability');
|
||||
icon.set('src', M.util.image_url('i/hide', 'core'));
|
||||
icon.set('alt', shownStr);
|
||||
this.span.set('title', shownStr + ' \u2022 ' +
|
||||
M.util.get_string('hide_verb', 'availability'));
|
||||
};
|
||||
if(shown) {
|
||||
setShown.call(this);
|
||||
} else {
|
||||
@@ -989,8 +989,8 @@ M.core_availability.EyeIcon.prototype.span = null;
|
||||
* @return {Boolean} True if this icon is set to 'hidden'
|
||||
*/
|
||||
M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
var suffix = this.individual ? '_individual' : '_all';
|
||||
var compare = M.str.availability['hidden' + suffix];
|
||||
var suffix = this.individual ? '_individual' : '_all',
|
||||
compare = M.util.get_string('hidden' + suffix, 'availability');
|
||||
return this.span.one('img').get('alt') === compare;
|
||||
};
|
||||
|
||||
@@ -1004,9 +1004,9 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
*/
|
||||
M.core_availability.DeleteIcon = function(toDelete) {
|
||||
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
|
||||
M.str.moodle['delete'] + '" role="button">');
|
||||
M.util.get_string('delete', 'moodle') + '" role="button">');
|
||||
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
|
||||
'" alt="' + M.str.moodle['delete'] + '" />');
|
||||
'" alt="' + M.util.get_string('delete', 'moodle') + '" />');
|
||||
this.span.appendChild(img);
|
||||
var click = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+45
-45
@@ -260,24 +260,23 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
if (root !== undefined) {
|
||||
this.root = root;
|
||||
}
|
||||
var strings = M.str.availability;
|
||||
// Create DIV structure (without kids).
|
||||
this.node = Y.Node.create('<div class="availability-list"><h3 class="accesshide"></h3>' +
|
||||
'<div class="availability-inner">' +
|
||||
'<div class="availability-header">' + strings.listheader_sign_before +
|
||||
' <label><span class="accesshide">' + strings.label_sign +
|
||||
' </span><select class="availability-neg" title="' + strings.label_sign + '">' +
|
||||
'<option value="">' + strings.listheader_sign_pos + '</option>' +
|
||||
'<option value="!">' + strings.listheader_sign_neg + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + strings.listheader_single + '</span>' +
|
||||
'<span class="availability-multi">' + strings.listheader_multi_before +
|
||||
' <label><span class="accesshide">' + strings.label_multi + ' </span>' +
|
||||
'<select class="availability-op" title="' + strings.label_multi + '"><option value="&">' +
|
||||
strings.listheader_multi_and + '</option>' +
|
||||
'<option value="|">' + strings.listheader_multi_or + '</option></select></label> ' +
|
||||
strings.listheader_multi_after + '</span></div>' +
|
||||
'<div class="availability-header">' + M.util.get_string('listheader_sign_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_sign', 'availability') +
|
||||
' </span><select class="availability-neg" title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
'<option value="">' + M.util.get_string('listheader_sign_pos', 'availability') + '</option>' +
|
||||
'<option value="!">' + M.util.get_string('listheader_sign_neg', 'availability') + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + M.util.get_string('listheader_single', 'availability') + '</span>' +
|
||||
'<span class="availability-multi">' + M.util.get_string('listheader_multi_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_multi', 'availability') + ' </span>' +
|
||||
'<select class="availability-op" title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
M.util.get_string('listheader_multi_and', 'availability') + '</option>' +
|
||||
'<option value="|">' + M.util.get_string('listheader_multi_or', 'availability') + '</option></select></label> ' +
|
||||
M.util.get_string('listheader_multi_after', 'availability') + '</span></div>' +
|
||||
'<div class="availability-children"></div>' +
|
||||
'<div class="availability-none">' + M.str.moodle.none + '</div>' +
|
||||
'<div class="availability-none">' + M.util.get_string('none', 'moodle') + '</div>' +
|
||||
'<div class="availability-button"></div></div></div>');
|
||||
if (!root) {
|
||||
this.node.addClass('availability-childlist');
|
||||
@@ -313,12 +312,12 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
|
||||
// Also if it's not the root, none is actually invalid, so add a label.
|
||||
noneNode.appendChild(Y.Node.create('<span class="label label-warning">' +
|
||||
M.str.availability.invalid + '</span>'));
|
||||
M.util.get_string('invalid', 'availability') + '</span>'));
|
||||
}
|
||||
|
||||
// Create the button and add it.
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
|
||||
M.str.availability.addrestriction + '</button>');
|
||||
M.util.get_string('addrestriction', 'availability') + '</button>');
|
||||
button.on("click", function() { this.clickAdd(); }, this);
|
||||
this.node.one('div.availability-button').appendChild(button);
|
||||
|
||||
@@ -509,9 +508,9 @@ M.core_availability.List.prototype.updateHtml = function() {
|
||||
// Update connector text.
|
||||
var connectorText;
|
||||
if (this.inner.one('.availability-op').get('value') === '&') {
|
||||
connectorText = M.str.availability.and;
|
||||
connectorText = M.util.get_string('and', 'availability');
|
||||
} else {
|
||||
connectorText = M.str.availability.or;
|
||||
connectorText = M.util.get_string('or', 'availability');
|
||||
}
|
||||
this.inner.all('> .availability-children > .availability-connector span.label').each(function(span) {
|
||||
span.set('innerHTML', connectorText);
|
||||
@@ -573,7 +572,7 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
var content = Y.Node.create('<div>' +
|
||||
'<ul class="list-unstyled"></ul>' +
|
||||
'<div class="availability-buttons mdl-align">' +
|
||||
'<button type="button" class="btn btn-default">' + M.str.moodle.cancel +
|
||||
'<button type="button" class="btn btn-default">' + M.util.get_string('cancel', 'moodle') +
|
||||
'</button></div></div>');
|
||||
var cancel = content.one('button');
|
||||
|
||||
@@ -589,13 +588,12 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
// Add entry for plugin.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
id = 'availability_addrestriction_' + type;
|
||||
var pluginStrings = M.str['availability_' + type];
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
'id="' + id + '">' + pluginStrings.title + '</button>');
|
||||
'id="' + id + '">' + M.util.get_string('title', 'availability_' + type) + '</button>');
|
||||
button.on('click', this.getAddHandler(type, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
pluginStrings.description + '</label>');
|
||||
M.util.get_string('description', 'availability_' + type) + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
@@ -603,16 +601,16 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
id = 'availability_addrestriction_list_';
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
'id="' + id + '">' + M.str.availability.condition_group + '</button>');
|
||||
'id="' + id + '">' + M.util.get_string('condition_group', 'availability') + '</button>');
|
||||
button.on('click', this.getAddHandler(null, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
M.str.availability.condition_group_info + '</label>');
|
||||
M.util.get_string('condition_group_info', 'availability') + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
|
||||
var config = {
|
||||
headerContent : M.str.availability.addrestriction,
|
||||
headerContent : M.util.get_string('addrestriction', 'availability'),
|
||||
bodyContent : content,
|
||||
additionalBaseClass : 'availability-dialogue',
|
||||
draggable : true,
|
||||
@@ -766,7 +764,7 @@ M.core_availability.Item = function(json, root) {
|
||||
// Handle undefined plugins.
|
||||
this.plugin = null;
|
||||
this.pluginNode = Y.Node.create('<div class="availability-warning">' +
|
||||
M.str.availability.missingplugin + '</div>');
|
||||
M.util.get_string('missingplugin', 'availability') + '</div>');
|
||||
} else {
|
||||
// Plugin is known.
|
||||
this.plugin = M.core_availability.form.plugins[json.type];
|
||||
@@ -837,7 +835,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
|
||||
// If any errors were added, add the marker to this item.
|
||||
var errorLabel = this.node.one('> .label-warning');
|
||||
if (errors.length !== before && !errorLabel.get('firstChild')) {
|
||||
errorLabel.appendChild(document.createTextNode(M.str.availability.invalid));
|
||||
errorLabel.appendChild(document.createTextNode(M.util.get_string('invalid', 'availability')));
|
||||
} else if (errors.length === before && errorLabel.get('firstChild')) {
|
||||
errorLabel.get('firstChild').remove();
|
||||
}
|
||||
@@ -853,7 +851,7 @@ M.core_availability.Item.prototype.renumber = function(number) {
|
||||
// Update heading for item.
|
||||
var headingParams = { number: number };
|
||||
if (this.plugin) {
|
||||
headingParams.type = M.str['availability_' + this.pluginType].title;
|
||||
headingParams.type = M.util.get_string('title', 'availability_' + this.pluginType);
|
||||
} else {
|
||||
headingParams.type = '[' + this.pluginType + ']';
|
||||
}
|
||||
@@ -932,19 +930,21 @@ M.core_availability.EyeIcon = function(individual, shown) {
|
||||
this.span.appendChild(icon);
|
||||
|
||||
// Set up button text and icon.
|
||||
var suffix = individual ? '_individual' : '_all';
|
||||
var setHidden = function() {
|
||||
icon.set('src', M.util.image_url('i/show', 'core'));
|
||||
icon.set('alt', M.str.availability['hidden' + suffix]);
|
||||
this.span.set('title', M.str.availability['hidden' + suffix] + ' \u2022 ' +
|
||||
M.str.availability.show_verb);
|
||||
};
|
||||
var setShown = function() {
|
||||
icon.set('src', M.util.image_url('i/hide', 'core'));
|
||||
icon.set('alt', M.str.availability['shown' + suffix]);
|
||||
this.span.set('title', M.str.availability['shown' + suffix] + ' \u2022 ' +
|
||||
M.str.availability.hide_verb);
|
||||
};
|
||||
var suffix = individual ? '_individual' : '_all',
|
||||
setHidden = function() {
|
||||
var hiddenStr = M.util.get_string('hidden' + suffix, 'availability');
|
||||
icon.set('src', M.util.image_url('i/show', 'core'));
|
||||
icon.set('alt', hiddenStr);
|
||||
this.span.set('title', hiddenStr + ' \u2022 ' +
|
||||
M.util.get_string('show_verb', 'availability'));
|
||||
},
|
||||
setShown = function() {
|
||||
var shownStr = M.util.get_string('shown' + suffix, 'availability');
|
||||
icon.set('src', M.util.image_url('i/hide', 'core'));
|
||||
icon.set('alt', shownStr);
|
||||
this.span.set('title', shownStr + ' \u2022 ' +
|
||||
M.util.get_string('hide_verb', 'availability'));
|
||||
};
|
||||
if(shown) {
|
||||
setShown.call(this);
|
||||
} else {
|
||||
@@ -989,8 +989,8 @@ M.core_availability.EyeIcon.prototype.span = null;
|
||||
* @return {Boolean} True if this icon is set to 'hidden'
|
||||
*/
|
||||
M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
var suffix = this.individual ? '_individual' : '_all';
|
||||
var compare = M.str.availability['hidden' + suffix];
|
||||
var suffix = this.individual ? '_individual' : '_all',
|
||||
compare = M.util.get_string('hidden' + suffix, 'availability');
|
||||
return this.span.one('img').get('alt') === compare;
|
||||
};
|
||||
|
||||
@@ -1004,9 +1004,9 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
*/
|
||||
M.core_availability.DeleteIcon = function(toDelete) {
|
||||
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
|
||||
M.str.moodle['delete'] + '" role="button">');
|
||||
M.util.get_string('delete', 'moodle') + '" role="button">');
|
||||
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
|
||||
'" alt="' + M.str.moodle['delete'] + '" />');
|
||||
'" alt="' + M.util.get_string('delete', 'moodle') + '" />');
|
||||
this.span.appendChild(img);
|
||||
var click = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
Vendored
+45
-45
@@ -258,24 +258,23 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
if (root !== undefined) {
|
||||
this.root = root;
|
||||
}
|
||||
var strings = M.str.availability;
|
||||
// Create DIV structure (without kids).
|
||||
this.node = Y.Node.create('<div class="availability-list"><h3 class="accesshide"></h3>' +
|
||||
'<div class="availability-inner">' +
|
||||
'<div class="availability-header">' + strings.listheader_sign_before +
|
||||
' <label><span class="accesshide">' + strings.label_sign +
|
||||
' </span><select class="availability-neg" title="' + strings.label_sign + '">' +
|
||||
'<option value="">' + strings.listheader_sign_pos + '</option>' +
|
||||
'<option value="!">' + strings.listheader_sign_neg + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + strings.listheader_single + '</span>' +
|
||||
'<span class="availability-multi">' + strings.listheader_multi_before +
|
||||
' <label><span class="accesshide">' + strings.label_multi + ' </span>' +
|
||||
'<select class="availability-op" title="' + strings.label_multi + '"><option value="&">' +
|
||||
strings.listheader_multi_and + '</option>' +
|
||||
'<option value="|">' + strings.listheader_multi_or + '</option></select></label> ' +
|
||||
strings.listheader_multi_after + '</span></div>' +
|
||||
'<div class="availability-header">' + M.util.get_string('listheader_sign_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_sign', 'availability') +
|
||||
' </span><select class="availability-neg" title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
'<option value="">' + M.util.get_string('listheader_sign_pos', 'availability') + '</option>' +
|
||||
'<option value="!">' + M.util.get_string('listheader_sign_neg', 'availability') + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + M.util.get_string('listheader_single', 'availability') + '</span>' +
|
||||
'<span class="availability-multi">' + M.util.get_string('listheader_multi_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_multi', 'availability') + ' </span>' +
|
||||
'<select class="availability-op" title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
M.util.get_string('listheader_multi_and', 'availability') + '</option>' +
|
||||
'<option value="|">' + M.util.get_string('listheader_multi_or', 'availability') + '</option></select></label> ' +
|
||||
M.util.get_string('listheader_multi_after', 'availability') + '</span></div>' +
|
||||
'<div class="availability-children"></div>' +
|
||||
'<div class="availability-none">' + M.str.moodle.none + '</div>' +
|
||||
'<div class="availability-none">' + M.util.get_string('none', 'moodle') + '</div>' +
|
||||
'<div class="availability-button"></div></div></div>');
|
||||
if (!root) {
|
||||
this.node.addClass('availability-childlist');
|
||||
@@ -311,12 +310,12 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
|
||||
// Also if it's not the root, none is actually invalid, so add a label.
|
||||
noneNode.appendChild(Y.Node.create('<span class="label label-warning">' +
|
||||
M.str.availability.invalid + '</span>'));
|
||||
M.util.get_string('invalid', 'availability') + '</span>'));
|
||||
}
|
||||
|
||||
// Create the button and add it.
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
|
||||
M.str.availability.addrestriction + '</button>');
|
||||
M.util.get_string('addrestriction', 'availability') + '</button>');
|
||||
button.on("click", function() { this.clickAdd(); }, this);
|
||||
this.node.one('div.availability-button').appendChild(button);
|
||||
|
||||
@@ -507,9 +506,9 @@ M.core_availability.List.prototype.updateHtml = function() {
|
||||
// Update connector text.
|
||||
var connectorText;
|
||||
if (this.inner.one('.availability-op').get('value') === '&') {
|
||||
connectorText = M.str.availability.and;
|
||||
connectorText = M.util.get_string('and', 'availability');
|
||||
} else {
|
||||
connectorText = M.str.availability.or;
|
||||
connectorText = M.util.get_string('or', 'availability');
|
||||
}
|
||||
this.inner.all('> .availability-children > .availability-connector span.label').each(function(span) {
|
||||
span.set('innerHTML', connectorText);
|
||||
@@ -571,7 +570,7 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
var content = Y.Node.create('<div>' +
|
||||
'<ul class="list-unstyled"></ul>' +
|
||||
'<div class="availability-buttons mdl-align">' +
|
||||
'<button type="button" class="btn btn-default">' + M.str.moodle.cancel +
|
||||
'<button type="button" class="btn btn-default">' + M.util.get_string('cancel', 'moodle') +
|
||||
'</button></div></div>');
|
||||
var cancel = content.one('button');
|
||||
|
||||
@@ -587,13 +586,12 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
// Add entry for plugin.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
id = 'availability_addrestriction_' + type;
|
||||
var pluginStrings = M.str['availability_' + type];
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
'id="' + id + '">' + pluginStrings.title + '</button>');
|
||||
'id="' + id + '">' + M.util.get_string('title', 'availability_' + type) + '</button>');
|
||||
button.on('click', this.getAddHandler(type, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
pluginStrings.description + '</label>');
|
||||
M.util.get_string('description', 'availability_' + type) + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
@@ -601,16 +599,16 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
id = 'availability_addrestriction_list_';
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
'id="' + id + '">' + M.str.availability.condition_group + '</button>');
|
||||
'id="' + id + '">' + M.util.get_string('condition_group', 'availability') + '</button>');
|
||||
button.on('click', this.getAddHandler(null, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
M.str.availability.condition_group_info + '</label>');
|
||||
M.util.get_string('condition_group_info', 'availability') + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
|
||||
var config = {
|
||||
headerContent : M.str.availability.addrestriction,
|
||||
headerContent : M.util.get_string('addrestriction', 'availability'),
|
||||
bodyContent : content,
|
||||
additionalBaseClass : 'availability-dialogue',
|
||||
draggable : true,
|
||||
@@ -764,7 +762,7 @@ M.core_availability.Item = function(json, root) {
|
||||
// Handle undefined plugins.
|
||||
this.plugin = null;
|
||||
this.pluginNode = Y.Node.create('<div class="availability-warning">' +
|
||||
M.str.availability.missingplugin + '</div>');
|
||||
M.util.get_string('missingplugin', 'availability') + '</div>');
|
||||
} else {
|
||||
// Plugin is known.
|
||||
this.plugin = M.core_availability.form.plugins[json.type];
|
||||
@@ -835,7 +833,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
|
||||
// If any errors were added, add the marker to this item.
|
||||
var errorLabel = this.node.one('> .label-warning');
|
||||
if (errors.length !== before && !errorLabel.get('firstChild')) {
|
||||
errorLabel.appendChild(document.createTextNode(M.str.availability.invalid));
|
||||
errorLabel.appendChild(document.createTextNode(M.util.get_string('invalid', 'availability')));
|
||||
} else if (errors.length === before && errorLabel.get('firstChild')) {
|
||||
errorLabel.get('firstChild').remove();
|
||||
}
|
||||
@@ -851,7 +849,7 @@ M.core_availability.Item.prototype.renumber = function(number) {
|
||||
// Update heading for item.
|
||||
var headingParams = { number: number };
|
||||
if (this.plugin) {
|
||||
headingParams.type = M.str['availability_' + this.pluginType].title;
|
||||
headingParams.type = M.util.get_string('title', 'availability_' + this.pluginType);
|
||||
} else {
|
||||
headingParams.type = '[' + this.pluginType + ']';
|
||||
}
|
||||
@@ -930,19 +928,21 @@ M.core_availability.EyeIcon = function(individual, shown) {
|
||||
this.span.appendChild(icon);
|
||||
|
||||
// Set up button text and icon.
|
||||
var suffix = individual ? '_individual' : '_all';
|
||||
var setHidden = function() {
|
||||
icon.set('src', M.util.image_url('i/show', 'core'));
|
||||
icon.set('alt', M.str.availability['hidden' + suffix]);
|
||||
this.span.set('title', M.str.availability['hidden' + suffix] + ' \u2022 ' +
|
||||
M.str.availability.show_verb);
|
||||
};
|
||||
var setShown = function() {
|
||||
icon.set('src', M.util.image_url('i/hide', 'core'));
|
||||
icon.set('alt', M.str.availability['shown' + suffix]);
|
||||
this.span.set('title', M.str.availability['shown' + suffix] + ' \u2022 ' +
|
||||
M.str.availability.hide_verb);
|
||||
};
|
||||
var suffix = individual ? '_individual' : '_all',
|
||||
setHidden = function() {
|
||||
var hiddenStr = M.util.get_string('hidden' + suffix, 'availability');
|
||||
icon.set('src', M.util.image_url('i/show', 'core'));
|
||||
icon.set('alt', hiddenStr);
|
||||
this.span.set('title', hiddenStr + ' \u2022 ' +
|
||||
M.util.get_string('show_verb', 'availability'));
|
||||
},
|
||||
setShown = function() {
|
||||
var shownStr = M.util.get_string('shown' + suffix, 'availability');
|
||||
icon.set('src', M.util.image_url('i/hide', 'core'));
|
||||
icon.set('alt', shownStr);
|
||||
this.span.set('title', shownStr + ' \u2022 ' +
|
||||
M.util.get_string('hide_verb', 'availability'));
|
||||
};
|
||||
if(shown) {
|
||||
setShown.call(this);
|
||||
} else {
|
||||
@@ -987,8 +987,8 @@ M.core_availability.EyeIcon.prototype.span = null;
|
||||
* @return {Boolean} True if this icon is set to 'hidden'
|
||||
*/
|
||||
M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
var suffix = this.individual ? '_individual' : '_all';
|
||||
var compare = M.str.availability['hidden' + suffix];
|
||||
var suffix = this.individual ? '_individual' : '_all',
|
||||
compare = M.util.get_string('hidden' + suffix, 'availability');
|
||||
return this.span.one('img').get('alt') === compare;
|
||||
};
|
||||
|
||||
@@ -1002,9 +1002,9 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
*/
|
||||
M.core_availability.DeleteIcon = function(toDelete) {
|
||||
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
|
||||
M.str.moodle['delete'] + '" role="button">');
|
||||
M.util.get_string('delete', 'moodle') + '" role="button">');
|
||||
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
|
||||
'" alt="' + M.str.moodle['delete'] + '" />');
|
||||
'" alt="' + M.util.get_string('delete', 'moodle') + '" />');
|
||||
this.span.appendChild(img);
|
||||
var click = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
+2
-2
@@ -750,8 +750,8 @@ BRANCH.prototype = {
|
||||
url = M.cfg.wwwroot+'/course/index.php?categoryid=' + branch.get('key');
|
||||
}
|
||||
branch.addChild({
|
||||
name : M.str.moodle.viewallcourses,
|
||||
title : M.str.moodle.viewallcourses,
|
||||
name : M.util.get_string('viewallcourses', 'moodle'),
|
||||
title : M.util.get_string('viewallcourses', 'moodle'),
|
||||
link : url,
|
||||
haschildren : false,
|
||||
icon : {'pix':"i/navigationitem",'component':'moodle'}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js
Vendored
+2
-2
@@ -745,8 +745,8 @@ BRANCH.prototype = {
|
||||
url = M.cfg.wwwroot+'/course/index.php?categoryid=' + branch.get('key');
|
||||
}
|
||||
branch.addChild({
|
||||
name : M.str.moodle.viewallcourses,
|
||||
title : M.str.moodle.viewallcourses,
|
||||
name : M.util.get_string('viewallcourses', 'moodle'),
|
||||
title : M.util.get_string('viewallcourses', 'moodle'),
|
||||
link : url,
|
||||
haschildren : false,
|
||||
icon : {'pix':"i/navigationitem",'component':'moodle'}
|
||||
|
||||
+2
-2
@@ -748,8 +748,8 @@ BRANCH.prototype = {
|
||||
url = M.cfg.wwwroot+'/course/index.php?categoryid=' + branch.get('key');
|
||||
}
|
||||
branch.addChild({
|
||||
name : M.str.moodle.viewallcourses,
|
||||
title : M.str.moodle.viewallcourses,
|
||||
name : M.util.get_string('viewallcourses', 'moodle'),
|
||||
title : M.util.get_string('viewallcourses', 'moodle'),
|
||||
link : url,
|
||||
haschildren : false,
|
||||
icon : {'pix':"i/navigationitem",'component':'moodle'}
|
||||
|
||||
@@ -18,17 +18,19 @@ M.core_completion.init = function(Y) {
|
||||
|
||||
} else {
|
||||
var current = args.state.get('value');
|
||||
var modulename = args.modulename.get('value');
|
||||
var modulename = args.modulename.get('value'),
|
||||
altstr,
|
||||
titlestr;
|
||||
if (current == 1) {
|
||||
var altstr = M.str.completion['completion-alt-manual-y'].replace('{$a}', modulename);
|
||||
var titlestr = M.str.completion['completion-title-manual-y'].replace('{$a}', modulename);
|
||||
altstr = M.util.get_string('completion-alt-manual-y', 'completion', modulename);
|
||||
titlestr = M.util.get_string('completion-title-manual-y', 'completion', modulename);
|
||||
args.state.set('value', 0);
|
||||
args.image.set('src', M.util.image_url('i/completion-manual-y', 'moodle'));
|
||||
args.image.set('alt', altstr);
|
||||
args.image.set('title', titlestr);
|
||||
} else {
|
||||
var altstr = M.str.completion['completion-alt-manual-n'].replace('{$a}', modulename);
|
||||
var titlestr = M.str.completion['completion-title-manual-n'].replace('{$a}', modulename);
|
||||
altstr = M.util.get_string('completion-alt-manual-n', 'completion', modulename);
|
||||
titlestr = M.util.get_string('completion-title-manual-n', 'completion', modulename);
|
||||
args.state.set('value', 1);
|
||||
args.image.set('src', M.util.image_url('i/completion-manual-n', 'moodle'));
|
||||
args.image.set('alt', altstr);
|
||||
|
||||
+20
-20
@@ -89,7 +89,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
var recovergrades = null;
|
||||
if (this.get(UEP.DISABLEGRADEHISTORY) != true) {
|
||||
recovergrades = create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.RECOVERGRADES+'"></div>')
|
||||
.append(create('<label class="'+CSS.RECOVERGRADESTITLE+'" for="'+CSS.RECOVERGRADES+'">'+M.str.enrol.recovergrades+'</label>'))
|
||||
.append(create('<label class="'+CSS.RECOVERGRADESTITLE+'" for="'+CSS.RECOVERGRADES+'">'+M.util.get_string('recovergrades', 'enrol')+'</label>'))
|
||||
.append(create('<input type="checkbox" id="'+CSS.RECOVERGRADES+'" name="'+CSS.RECOVERGRADES+'"'+ this.get(UEP.RECOVERGRADESDEFAULT) +' />'))
|
||||
}
|
||||
|
||||
@@ -97,21 +97,21 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
.append(create('<div class="'+CSS.WRAP+'"></div>')
|
||||
.append(create('<div class="'+CSS.HEADER+' header"></div>')
|
||||
.append(create('<div class="'+CSS.CLOSE+'"></div>'))
|
||||
.append(create('<h2>'+M.str.enrol.enrolusers+'</h2>')))
|
||||
.append(create('<h2>'+M.util.get_string('enrolusers', 'enrol')+'</h2>')))
|
||||
.append(create('<div class="'+CSS.CONTENT+'"></div>')
|
||||
.append(create('<div class="'+CSS.SEARCHCONTROLS+'"></div>')
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.ROLE+'"><label for="id_enrol_manual_assignable_roles">'+M.str.role.assignroles+'</label></div>')
|
||||
.append(create('<select id="id_enrol_manual_assignable_roles"><option value="">'+M.str.enrol.none+'</option></select>'))
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.ROLE+'"><label for="id_enrol_manual_assignable_roles">'+M.util.get_string('assignroles', 'role')+'</label></div>')
|
||||
.append(create('<select id="id_enrol_manual_assignable_roles"><option value="">'+M.util.get_string('none', 'enrol')+'</option></select>'))
|
||||
)
|
||||
.append(create('<div class="'+CSS.ENTITYSELECTOR+'"></div>'))
|
||||
.append(create('<div class="'+CSS.SEARCHOPTIONS+'"></div>')
|
||||
.append(create('<div class="'+CSS.COLLAPSIBLEHEADING+'"><img alt="" />'+M.str.enrol.enrolmentoptions+'</div>'))
|
||||
.append(create('<div class="'+CSS.COLLAPSIBLEHEADING+'"><img alt="" />'+M.util.get_string('enrolmentoptions', 'enrol')+'</div>'))
|
||||
.append(create('<div class="'+CSS.COLLAPSIBLEAREA+' '+CSS.HIDDEN+'"></div>')
|
||||
.append(recovergrades)
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.STARTDATE+'">'+M.str.moodle.startingfrom+'</div>')
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.STARTDATE+'">'+M.util.get_string('startingfrom', 'moodle')+'</div>')
|
||||
.append(create('<select></select>')))
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.DURATION+'">'+M.str.enrol.enrolperiod+'</div>')
|
||||
.append(create('<select><option value="0" selected="selected">'+M.str.enrol.unlimitedduration+'</option></select>')))
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.DURATION+'">'+M.util.get_string('enrolperiod', 'enrol')+'</div>')
|
||||
.append(create('<select><option value="0" selected="selected">'+M.util.get_string('unlimitedduration', 'enrol')+'</option></select>')))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -121,12 +121,12 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
.setAttribute('src', M.util.image_url('i/loading', 'moodle')))
|
||||
.setStyle('opacity', 0.5)))
|
||||
.append(create('<div class="'+CSS.FOOTER+'"></div>')
|
||||
.append(create('<div class="'+CSS.SEARCH+'"><label for="enrolusersearch" class="accesshide">'+M.str.enrol.usersearch+'</label></div>')
|
||||
.append(create('<div class="'+CSS.SEARCH+'"><label for="enrolusersearch" class="accesshide">'+M.util.get_string('usersearch', 'enrol')+'</label></div>')
|
||||
.append(create('<input type="text" id="enrolusersearch" value="" />'))
|
||||
.append(create('<input type="button" id="searchbtn" class="'+CSS.SEARCHBTN+'" value="'+M.str.enrol.usersearch+'" />'))
|
||||
.append(create('<input type="button" id="searchbtn" class="'+CSS.SEARCHBTN+'" value="'+M.util.get_string('usersearch', 'enrol')+'" />'))
|
||||
)
|
||||
.append(create('<div class="'+CSS.CLOSEBTN+'"></div>')
|
||||
.append(create('<input type="button" value="'+M.str.enrol.finishenrollingusers+'" />'))
|
||||
.append(create('<input type="button" value="'+M.util.get_string('finishenrollingusers', 'enrol')+'" />'))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -152,9 +152,9 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
if (this.get(UEP.COHORTSAVAILABLE)) {
|
||||
this.get(UEP.BASE).one('.'+CSS.ENTITYSELECTOR)
|
||||
.append(create('<input type="radio" id="id_enrol_manual_entity_users" name="enrol_manual_entity" value="users" checked="checked"/>'))
|
||||
.append(create('<label for="id_enrol_manual_entity_users">'+ M.str.enrol_manual.browseusers+'</label>'))
|
||||
.append(create('<label for="id_enrol_manual_entity_users">'+ M.util.get_string('browseusers', 'enrol_manual')+'</label>'))
|
||||
.append(create('<input type="radio" id="id_enrol_manual_entity_cohorts" name="enrol_manual_entity" value="cohorts"/>'))
|
||||
.append(create('<label for="id_enrol_manual_entity_cohorts">'+M.str.enrol_manual.browsecohorts+'</label>'));
|
||||
.append(create('<label for="id_enrol_manual_entity_cohorts">'+M.util.get_string('browsecohorts', 'enrol_manual')+'</label>'));
|
||||
this.get(UEP.BASE).one('#id_enrol_manual_entity_cohorts').on('change', this.search, this);
|
||||
this.get(UEP.BASE).one('#id_enrol_manual_entity_users').on('change', this.search, this);
|
||||
} else {
|
||||
@@ -380,7 +380,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
new M.core.exception(e);
|
||||
}
|
||||
if (!result.success) {
|
||||
this.setContent = M.str.enrol.errajaxsearch;
|
||||
this.setContent = M.util.get_string('errajaxsearch', 'enrol');
|
||||
}
|
||||
var users;
|
||||
if (!args.append) {
|
||||
@@ -401,17 +401,17 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
.append(create('<div class="'+CSS.FULLNAME+'">'+user.fullname+'</div>'))
|
||||
.append(create('<div class="'+CSS.EXTRAFIELDS+'">'+user.extrafields+'</div>')))
|
||||
.append(create('<div class="'+CSS.OPTIONS+'"></div>')
|
||||
.append(create('<input type="button" class="'+CSS.ENROL+'" value="'+M.str.enrol.enrol+'" />')))
|
||||
.append(create('<input type="button" class="'+CSS.ENROL+'" value="'+M.util.get_string('enrol', 'enrol')+'" />')))
|
||||
);
|
||||
}
|
||||
this.set(UEP.USERCOUNT, count);
|
||||
if (!args.append) {
|
||||
var usersstr = (result.response.totalusers == '1')?M.str.enrol.ajaxoneuserfound:M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||
var usersstr = (result.response.totalusers == '1')?M.util.get_string('ajaxoneuserfound', 'enrol'):M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||
var content = create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
|
||||
.append(create('<div class="'+CSS.TOTALUSERS+'">'+usersstr+'</div>'))
|
||||
.append(users);
|
||||
if (result.response.totalusers > (this.get(UEP.PAGE)+1)*this.get(UEP.PERPAGE)) {
|
||||
var fetchmore = create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol.ajaxnext25+'</a></div>');
|
||||
var fetchmore = create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.util.get_string('ajaxnext25', 'enrol')+'</a></div>');
|
||||
fetchmore.on('click', this.search, this, true);
|
||||
content.append(fetchmore)
|
||||
}
|
||||
@@ -433,7 +433,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
new M.core.exception(e);
|
||||
}
|
||||
if (!result.success) {
|
||||
this.setContent = M.str.enrol.errajaxsearch;
|
||||
this.setContent = M.util.get_string('errajaxsearch', 'enrol');
|
||||
}
|
||||
var cohorts;
|
||||
if (!args.append) {
|
||||
@@ -456,13 +456,13 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
}
|
||||
this.set(UEP.COHORTCOUNT, count);
|
||||
if (!args.append) {
|
||||
//var usersstr = (result.response.totalusers == '1')?M.str.enrol.ajaxoneuserfound:M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||
//var usersstr = (result.response.totalusers == '1')?M.util.get_string('ajaxoneuserfound', 'enrol'):M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||
var cohortsstr = 'Found '+result.response.totalcohorts+' cohorts'; // TODO
|
||||
var content = create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
|
||||
.append(create('<div class="'+CSS.TOTALCOHORTS+'">'+cohortsstr+'</div>'))
|
||||
.append(cohorts);
|
||||
if (result.response.totalcohorts > (this.get(UEP.PAGE)+1)*this.get(UEP.PERPAGE)) {
|
||||
var fetchmore = create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol.ajaxnext25+'</a></div>');
|
||||
var fetchmore = create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.util.get_string('ajaxnext25', 'enrol')+'</a></div>');
|
||||
fetchmore.on('click', this.search, this, true);
|
||||
content.append(fetchmore)
|
||||
}
|
||||
|
||||
+6
-6
@@ -58,7 +58,7 @@ YUI.add('moodle-enrol-otherusersmanager', function(Y) {
|
||||
.append(Y.Node.create('<div class="'+CSS.WRAP+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+CSS.HEADER+' header"></div>')
|
||||
.append(Y.Node.create('<div class="'+CSS.CLOSE+'"></div>'))
|
||||
.append(Y.Node.create('<h2>'+M.str.enrol.usersearch+'</h2>')))
|
||||
.append(Y.Node.create('<h2>'+M.util.get_string('usersearch', 'enrol')+'</h2>')))
|
||||
.append(Y.Node.create('<div class="'+CSS.CONTENT+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+CSS.AJAXCONTENT+'"></div>'))
|
||||
.append(Y.Node.create('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>')
|
||||
@@ -66,7 +66,7 @@ YUI.add('moodle-enrol-otherusersmanager', function(Y) {
|
||||
.setAttribute('src', M.util.image_url('i/loading', 'moodle')))
|
||||
.setStyle('opacity', 0.5)))
|
||||
.append(Y.Node.create('<div class="'+CSS.FOOTER+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol.usersearch+'</label></div>')
|
||||
.append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label>'+M.util.get_string('usersearch', 'enrol')+'</label></div>')
|
||||
.append(Y.Node.create('<input type="text" id="oump-usersearch" value="" />'))
|
||||
)
|
||||
)
|
||||
@@ -169,7 +169,7 @@ YUI.add('moodle-enrol-otherusersmanager', function(Y) {
|
||||
new M.core.exception(e);
|
||||
}
|
||||
if (!result.success) {
|
||||
this.setContent = M.str.enrol.errajaxsearch;
|
||||
this.setContent = M.util.get_string('errajaxsearch', 'enrol');
|
||||
}
|
||||
var usersnode, users = [], i=0, count=0, user;
|
||||
if (!args.append) {
|
||||
@@ -186,12 +186,12 @@ YUI.add('moodle-enrol-otherusersmanager', function(Y) {
|
||||
}
|
||||
this.set(USERCOUNT, count);
|
||||
if (!args.append) {
|
||||
var usersstr = (result.response.totalusers == '1')?M.str.enrol.ajaxoneuserfound:M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||
var usersstr = (result.response.totalusers == '1')?M.util.get_string('ajaxoneuserfound', 'enrol'):M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||
var content = Y.Node.create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+CSS.TOTALUSERS+'">'+usersstr+'</div>'))
|
||||
.append(usersnode);
|
||||
if (result.response.totalusers > (this.get(PAGE)+1)*25) {
|
||||
var fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol.ajaxnext25+'</a></div>');
|
||||
var fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.util.get_string('ajaxnext25', 'enrol')+'</a></div>');
|
||||
fetchmore.on('click', this.getUsers, this, true);
|
||||
content.append(fetchmore)
|
||||
}
|
||||
@@ -312,7 +312,7 @@ YUI.add('moodle-enrol-otherusersmanager', function(Y) {
|
||||
.append(Y.Node.create('<div class="'+CSS.FULLNAME+'">'+this.get(FULLNAME)+'</div>'))
|
||||
.append(Y.Node.create('<div class="'+CSS.EXTRAFIELDS+'">'+this.get(EXTRAFIELDS)+'</div>'))
|
||||
)
|
||||
.append(Y.Node.create('<div class="'+CSS.OPTIONS+'"><span class="label">'+M.str.role.assignrole+': </span></div>'))
|
||||
.append(Y.Node.create('<div class="'+CSS.OPTIONS+'"><span class="label">'+M.util.get_string('assignrole', 'role')+': </span></div>'))
|
||||
);
|
||||
var id = 0, roles = this._manager.get(ASSIGNABLEROLES);
|
||||
for (id in roles) {
|
||||
|
||||
Vendored
+6
-6
@@ -112,14 +112,14 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
|
||||
e.halt();
|
||||
var event = this.on('assignablerolesloaded', function(){
|
||||
event.detach();
|
||||
var s = M.str.role, confirmation = {
|
||||
var confirmation = {
|
||||
modal: true,
|
||||
visible : true,
|
||||
centered : true,
|
||||
title : s.confirmunassigntitle,
|
||||
question : s.confirmunassign,
|
||||
yesLabel : s.confirmunassignyes,
|
||||
noLabel : s.confirmunassignno
|
||||
title : M.util.get_string('confirmunassigntitle', 'role'),
|
||||
question : M.util.get_string('confirmunassign', 'role'),
|
||||
yesLabel : M.util.get_string('confirmunassignyes', 'role'),
|
||||
noLabel : M.util.get_string('confirmunassignno', 'role')
|
||||
};
|
||||
new M.core.confirm(confirmation).on('complete-yes', this.removeRoleCallback, this, user.get(USERID), roleid);
|
||||
}, this);
|
||||
@@ -347,7 +347,7 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
|
||||
submitevent : null,
|
||||
initializer : function() {
|
||||
var i, m = this.get(MANIPULATOR);
|
||||
var element = Y.Node.create('<div class="enrolpanel roleassign"><div class="container"><div class="header"><h2>'+M.str.role.assignroles+'</h2><div class="close"></div></div><div class="content"></div></div></div>');
|
||||
var element = Y.Node.create('<div class="enrolpanel roleassign"><div class="container"><div class="header"><h2>'+M.util.get_string('assignroles', 'role')+'</h2><div class="close"></div></div><div class="content"></div></div></div>');
|
||||
var content = element.one('.content');
|
||||
var roles = m.get(ASSIGNABLEROLES);
|
||||
for (i in roles) {
|
||||
|
||||
@@ -105,10 +105,10 @@ M.gradingform_guideeditor.editmode = function(el, editmode) {
|
||||
if (value.length) {
|
||||
taplain.removeClass('empty')
|
||||
} else if (ta.get('name').indexOf('[shortname]') > 1){
|
||||
value = M.str.gradingform_guide.clicktoeditname
|
||||
value = M.util.get_string('clicktoeditname', 'gradingform_guide')
|
||||
taplain.addClass('editname')
|
||||
} else {
|
||||
value = M.str.gradingform_guide.clicktoedit
|
||||
value = M.util.get_string('clicktoedit', 'gradingform_guide')
|
||||
taplain.addClass('empty')
|
||||
}
|
||||
taplain.one('.textvalue').set('innerHTML', Y.Escape.html(value))
|
||||
@@ -219,7 +219,7 @@ M.gradingform_guideeditor.buttonclick = function(e, confirmed) {
|
||||
Y.one('#'+name+'-'+section+'-'+chunks[2]).remove()
|
||||
M.gradingform_guideeditor.assignclasses(elements_str)
|
||||
} else {
|
||||
dialog_options['message'] = M.str.gradingform_guide.confirmdeletecriterion
|
||||
dialog_options['message'] = M.util.get_string('confirmdeletecriterion', 'gradingform_guide')
|
||||
M.util.show_confirm_dialog(e, dialog_options);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -90,7 +90,7 @@ M.gradingform_rubriceditor.editmode = function(el, editmode, focustb) {
|
||||
var value = ta.get('value')
|
||||
if (value.length) taplain.removeClass('empty')
|
||||
else {
|
||||
value = (el.hasClass('level')) ? M.str.gradingform_rubric.levelempty : M.str.gradingform_rubric.criterionempty
|
||||
value = (el.hasClass('level')) ? M.util.get_string('levelempty', 'gradingform_rubric') : M.util.get_string('criterionempty', 'gradingform_rubric')
|
||||
taplain.addClass('empty')
|
||||
}
|
||||
taplain.one('.textvalue').set('innerHTML', Y.Escape.html(value));
|
||||
@@ -201,7 +201,7 @@ M.gradingform_rubriceditor.buttonclick = function(e, confirmed) {
|
||||
Y.one('#'+name+'-criteria-'+chunks[2]).remove()
|
||||
M.gradingform_rubriceditor.assignclasses(elements_str)
|
||||
} else {
|
||||
dialog_options['message'] = M.str.gradingform_rubric.confirmdeletecriterion
|
||||
dialog_options['message'] = M.util.get_string('confirmdeletecriterion', 'gradingform_rubric')
|
||||
M.util.show_confirm_dialog(e, dialog_options);
|
||||
}
|
||||
} else if (chunks.length == 6 && action == 'delete') {
|
||||
@@ -210,7 +210,7 @@ M.gradingform_rubriceditor.buttonclick = function(e, confirmed) {
|
||||
Y.one('#'+name+'-criteria-'+chunks[2]+'-'+chunks[3]+'-'+chunks[4]).remove()
|
||||
M.gradingform_rubriceditor.assignclasses(elements_str)
|
||||
} else {
|
||||
dialog_options['message'] = M.str.gradingform_rubric.confirmdeletelevel
|
||||
dialog_options['message'] = M.util.get_string('confirmdeletelevel', 'gradingform_rubric')
|
||||
M.util.show_confirm_dialog(e, dialog_options);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -446,7 +446,7 @@ M.gradereport_grader.classes.ajax.prototype.submission_outcome = function(tid, o
|
||||
try {
|
||||
outcome = this.report.Y.JSON.parse(outcome.responseText);
|
||||
} catch(e) {
|
||||
var message = M.str.gradereport_grader.ajaxfailedupdate;
|
||||
var message = M.util.get_string('ajaxfailedupdate', 'gradereport_grader');
|
||||
message = message.replace(/\[1\]/, args.type);
|
||||
message = message.replace(/\[2\]/, this.report.users[args.properties.userid]);
|
||||
|
||||
@@ -506,7 +506,7 @@ M.gradereport_grader.classes.ajax.prototype.submission_outcome = function(tid, o
|
||||
// If we are here the grade value of the cell currently being edited has changed !!!!!!!!!
|
||||
// If the user has not actually changed the old value yet we will automatically correct it
|
||||
// otherwise we will prompt the user to choose to use their value or the new value!
|
||||
if (!this.current.has_changed() || confirm(M.str.gradereport_grader.ajaxfieldchanged)) {
|
||||
if (!this.current.has_changed() || confirm(M.util.get_string('ajaxfieldchanged', 'gradereport_grader'))) {
|
||||
this.current.set_grade(finalgrade);
|
||||
this.current.grade.set('value', finalgrade);
|
||||
}
|
||||
@@ -554,7 +554,7 @@ M.gradereport_grader.classes.ajax.prototype.submission_outcome = function(tid, o
|
||||
*/
|
||||
M.gradereport_grader.classes.ajax.prototype.display_submission_error = function(message, cell) {
|
||||
var erroroverlay = new this.report.Y.Overlay({
|
||||
headerContent : '<div><strong class="error">'+M.str.gradereport_grader.ajaxerror+'</strong> <em>'+M.str.gradereport_grader.ajaxclicktoclose+'</em></div>',
|
||||
headerContent : '<div><strong class="error">'+M.util.get_string('ajaxerror', 'gradereport_grader')+'</strong> <em>'+M.util.get_string('ajaxclicktoclose', 'gradereport_grader')+'</em></div>',
|
||||
bodyContent : message,
|
||||
visible : false,
|
||||
zIndex : 3
|
||||
@@ -1009,7 +1009,7 @@ M.gradereport_grader.classes.scalefield = function(report, node) {
|
||||
this.gradespan = node.one('.gradevalue');
|
||||
this.inputdiv = this.report.Y.Node.create('<div></div>');
|
||||
this.editfeedback = this.report.ajax.showquickfeedback;
|
||||
this.grade = this.report.Y.Node.create('<select type="text" class="text" /><option value="-1">'+M.str.gradereport_grader.ajaxchoosescale+'</option></select>');
|
||||
this.grade = this.report.Y.Node.create('<select type="text" class="text" /><option value="-1">'+M.util.get_string('ajaxchoosescale', 'gradereport_grader')+'</option></select>');
|
||||
this.gradetype = 'scale';
|
||||
this.inputdiv.append(this.grade);
|
||||
if (this.editfeedback) {
|
||||
|
||||
@@ -14,7 +14,7 @@ M.tinymce_managefiles.analysefiles = function(Y) {
|
||||
}
|
||||
if (missingfiles !== '') {
|
||||
form.addClass('hasmissingfiles')
|
||||
form.one('.managefilesstatus').setContent(M.str.tinymce_managefiles.hasmissingfiles + ' <ul>' + missingfiles + '</ul>').addClass('error');
|
||||
form.one('.managefilesstatus').setContent(M.util.get_string('hasmissingfiles', 'tinymce_managefiles') + ' <ul>' + missingfiles + '</ul>').addClass('error');
|
||||
}
|
||||
delfilesfieldset.all('.felement.fcheckbox').each(function(el) {
|
||||
var chb = el.one('input[type=checkbox]'),
|
||||
@@ -25,6 +25,6 @@ M.tinymce_managefiles.analysefiles = function(Y) {
|
||||
}
|
||||
});
|
||||
if (missingfiles === '' && !form.hasClass('hasunusedfiles')) {
|
||||
form.one('.managefilesstatus').setContent(M.str.tinymce_managefiles.allfilesok);
|
||||
form.one('.managefilesstatus').setContent(M.util.get_string('allfilesok', 'tinymce_managefiles'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,10 +543,10 @@ M.form_dndupload.init = function(Y, options) {
|
||||
* @param string type - 'error' or 'info'
|
||||
*/
|
||||
print_msg: function(msg, type) {
|
||||
var header = M.str.moodle.error;
|
||||
var header = M.util.get_string('error', 'moodle');
|
||||
if (type != 'error') {
|
||||
type = 'info'; // one of only two types excepted
|
||||
header = M.str.moodle.info;
|
||||
header = M.util.get_string('info', 'moodle');
|
||||
}
|
||||
if (!this.msg_dlg) {
|
||||
this.msg_dlg_node = Y.Node.createWithFilesSkin(M.core_filepicker.templates.message);
|
||||
@@ -684,7 +684,7 @@ M.form_dndupload.init = function(Y, options) {
|
||||
node.generateID();
|
||||
var process_dlg = new Y.Panel({
|
||||
srcNode : node,
|
||||
headerContent: M.str.repository.fileexistsdialogheader,
|
||||
headerContent: M.util.get_string('fileexistsdialogheader', 'repository'),
|
||||
zIndex : 8000,
|
||||
centered : true,
|
||||
modal : true,
|
||||
|
||||
+14
-14
@@ -111,7 +111,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
var labelid = 'fm-dialog-label_'+ this.selectnode.get('id');
|
||||
this.selectui = new M.core.dialogue({
|
||||
draggable : true,
|
||||
headerContent: '<h3 id="' + labelid +'">' + M.str.moodle.edit + '</h3>',
|
||||
headerContent: '<h3 id="' + labelid +'">' + M.util.get_string('edit', 'moodle') + '</h3>',
|
||||
bodyContent : this.selectnode,
|
||||
centered : true,
|
||||
width : '480px',
|
||||
@@ -163,8 +163,8 @@ M.form_filemanager.init = function(Y, options) {
|
||||
try {
|
||||
data = Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
scope.print_msg(M.str.repository.invalidjson, 'error');
|
||||
Y.error(M.str.repository.invalidjson+":\n"+o.responseText);
|
||||
scope.print_msg(M.util.get_string('invalidjson', 'repository'), 'error');
|
||||
Y.error(M.util.get_string('invalidjson', 'repository')+":\n"+o.responseText);
|
||||
return;
|
||||
}
|
||||
if (data && data.tree && scope.set_current_tree) {
|
||||
@@ -233,10 +233,10 @@ M.form_filemanager.init = function(Y, options) {
|
||||
},
|
||||
/** displays message in a popup */
|
||||
print_msg: function(msg, type) {
|
||||
var header = M.str.moodle.error;
|
||||
var header = M.util.get_string('error', 'moodle');
|
||||
if (type != 'error') {
|
||||
type = 'info'; // one of only two types excepted
|
||||
header = M.str.moodle.info;
|
||||
header = M.util.get_string('info', 'moodle');
|
||||
}
|
||||
if (!this.msg_dlg) {
|
||||
this.msg_dlg_node = Y.Node.createWithFilesSkin(M.form_filemanager.templates.message);
|
||||
@@ -346,7 +346,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
this.mkdir_dialog.show();
|
||||
|
||||
// Default folder name:
|
||||
var foldername = M.str.repository.newfolder;
|
||||
var foldername = M.util.get_string('newfolder', 'repository');
|
||||
while (this.has_folder(foldername)) {
|
||||
foldername = increment_filename(foldername, true);
|
||||
}
|
||||
@@ -391,7 +391,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
node.set('src', obj.fileurl);
|
||||
Y.one('body').appendChild(node);
|
||||
} else {
|
||||
scope.print_msg(M.str.repository.draftareanofiles, 'error');
|
||||
scope.print_msg(M.util.get_string('draftareanofiles', 'repository'), 'error');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -685,12 +685,12 @@ M.form_filemanager.init = function(Y, options) {
|
||||
var dialog_options = {callback:this.update_file, callbackargs:[true], scope:this};
|
||||
if (fileinfo.type == 'folder') {
|
||||
if (!newfilename) {
|
||||
this.print_msg(M.str.repository.entername, 'error');
|
||||
this.print_msg(M.util.get_string('entername', 'repository'), 'error');
|
||||
return;
|
||||
}
|
||||
if (filenamechanged || filepathchanged) {
|
||||
if (!confirmed) {
|
||||
dialog_options.message = M.str.repository.confirmrenamefolder;
|
||||
dialog_options.message = M.util.get_string('confirmrenamefolder', 'repository');
|
||||
this.show_confirm_dialog(dialog_options);
|
||||
return;
|
||||
}
|
||||
@@ -699,7 +699,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
}
|
||||
} else {
|
||||
if (!newfilename) {
|
||||
this.print_msg(M.str.repository.enternewname, 'error');
|
||||
this.print_msg(M.util.get_string('enternewname', 'repository'), 'error');
|
||||
return;
|
||||
}
|
||||
if ((filenamechanged || filepathchanged) && !confirmed && fileinfo.refcount) {
|
||||
@@ -818,13 +818,13 @@ M.form_filemanager.init = function(Y, options) {
|
||||
params.filepath = fileinfo.filepath;
|
||||
if (fileinfo.type == 'folder') {
|
||||
params.filename = '.';
|
||||
dialog_options.message = M.str.repository.confirmdeletefolder;
|
||||
dialog_options.message = M.util.get_string('confirmdeletefolder', 'repository');
|
||||
} else {
|
||||
params.filename = fileinfo.fullname;
|
||||
if (fileinfo.refcount) {
|
||||
dialog_options.message = M.util.get_string('confirmdeletefilewithhref', 'repository', fileinfo.refcount);
|
||||
} else {
|
||||
dialog_options.message = M.str.repository.confirmdeletefile;
|
||||
dialog_options.message = M.util.get_string('confirmdeletefile', 'repository');
|
||||
}
|
||||
}
|
||||
dialog_options.callbackargs = [params];
|
||||
@@ -988,7 +988,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
node.original = obj.original;
|
||||
selectnode.one('.fp-original .fp-value').setContent(Y.Escape.html(node.original));
|
||||
} else {
|
||||
selectnode.one('.fp-original .fp-value').setContent(M.str.repository.unknownsource);
|
||||
selectnode.one('.fp-original .fp-value').setContent(M.util.get_string('unknownsource', 'repository'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
if (nodename.length > namelength) {
|
||||
nodename = nodename.substring(0, namelength) + '...';
|
||||
}
|
||||
Y.one('#fm-dialog-label_'+selectnode.get('id')).setContent(Y.Escape.html(M.str.moodle.edit+' '+nodename));
|
||||
Y.one('#fm-dialog-label_'+selectnode.get('id')).setContent(Y.Escape.html(M.util.get_string('edit', 'moodle')+' '+nodename));
|
||||
// show panel
|
||||
this.selectui.show();
|
||||
Y.one('#'+selectnode.get('id')).focus();
|
||||
|
||||
+2
-2
@@ -84,9 +84,9 @@ Y.extend(SHOWADVANCED, Y.Base, {
|
||||
var morelesslink = Y.Node.create('<a href="#"></a>');
|
||||
morelesslink.addClass(CSS.MORELESSTOGGLER);
|
||||
if (statuselement.get('value') === '0') {
|
||||
morelesslink.setHTML(M.str.form.showmore);
|
||||
morelesslink.setHTML(M.util.get_string('showmore', 'form'));
|
||||
} else {
|
||||
morelesslink.setHTML(M.str.form.showless);
|
||||
morelesslink.setHTML(M.util.get_string('showless', 'form'));
|
||||
morelesslink.addClass(CSS.SHOWLESS);
|
||||
fieldset.all(SELECTORS.DIVFITEMADVANCED).addClass(CSS.SHOW);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-form-showadvanced",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}var r={FIELDSETCONTAINSADVANCED:"fieldset.containsadvancedelements",DIVFITEMADVANCED:"div.fitem.advanced",DIVFCONTAINER:"div.fcontainer",MORELESSLINK:"fieldset.containsadvancedelements .moreless-toggler"},i={SHOW:"show",MORELESSACTIONS:"moreless-actions",MORELESSTOGGLER:"moreless-toggler",SHOWLESS:"moreless-less"},s={FITEM:'<div class="fitem"></div>',FELEMENT:'<div class="felement"></div>'},o={};o.formid={value:null},e.extend(n,e.Base,{initializer:function(){var t=e.one("#"+this.get("formid")),n=t.all(r.FIELDSETCONTAINSADVANCED);n.each(this.processFieldset,this),t.delegate("click",this.switchState,r.MORELESSLINK),t.delegate("key",this.switchState,"down:enter,32",r.MORELESSLINK)},processFieldset:function(t){var n=e.one("input[name=mform_showmore_"+t.get("id")+"]");if(!n)return this;var o=e.Node.create('<a href="#"></a>');o.addClass(i.MORELESSTOGGLER),n.get("value")==="0"?o.setHTML(M.str.form.showmore):(o.setHTML(M.str.form.showless),o.addClass(i.SHOWLESS),t.all(r.DIVFITEMADVANCED).addClass(i.SHOW));var u=[];t.all(r.DIVFITEMADVANCED).each(function(e){u[u.length]=e.generateID()}),o.setAttribute("role","button"),o.setAttribute("aria-controls",u.join(" "));var a=e.Node.create(s.FITEM);a.addClass(i.MORELESSACTIONS);var f=e.Node.create(s.FELEMENT);return f.append(o),a.append(f),t.one(r.DIVFCONTAINER).append(a),this},switchState:function(t){t.preventDefault();var n=this.ancestor(r.FIELDSETCONTAINSADVANCED);n.all(r.DIVFITEMADVANCED).toggleClass(i.SHOW);var s=e.one("input[name=mform_showmore_"+n.get("id")+"]");s.get("value")==="0"?(s.set("value",1),this.addClass(i.SHOWLESS),this.setHTML(M.util.get_string("showless","form"))):(s.set("value",0),this.removeClass(i.SHOWLESS),this.setHTML(M.util.get_string("showmore","form")))}},{NAME:"moodle-form-showadvanced",ATTRS:o}),M.form=M.form||{},M.form.showadvanced=M.form.showadvanced||function(e){return new n(e)}},"@VERSION@",{requires:["node","base","selector-css3"]});
|
||||
YUI.add("moodle-form-showadvanced",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}var r={FIELDSETCONTAINSADVANCED:"fieldset.containsadvancedelements",DIVFITEMADVANCED:"div.fitem.advanced",DIVFCONTAINER:"div.fcontainer",MORELESSLINK:"fieldset.containsadvancedelements .moreless-toggler"},i={SHOW:"show",MORELESSACTIONS:"moreless-actions",MORELESSTOGGLER:"moreless-toggler",SHOWLESS:"moreless-less"},s={FITEM:'<div class="fitem"></div>',FELEMENT:'<div class="felement"></div>'},o={};o.formid={value:null},e.extend(n,e.Base,{initializer:function(){var t=e.one("#"+this.get("formid")),n=t.all(r.FIELDSETCONTAINSADVANCED);n.each(this.processFieldset,this),t.delegate("click",this.switchState,r.MORELESSLINK),t.delegate("key",this.switchState,"down:enter,32",r.MORELESSLINK)},processFieldset:function(t){var n=e.one("input[name=mform_showmore_"+t.get("id")+"]");if(!n)return this;var o=e.Node.create('<a href="#"></a>');o.addClass(i.MORELESSTOGGLER),n.get("value")==="0"?o.setHTML(M.util.get_string("showmore","form")):(o.setHTML(M.util.get_string("showless","form")),o.addClass(i.SHOWLESS),t.all(r.DIVFITEMADVANCED).addClass(i.SHOW));var u=[];t.all(r.DIVFITEMADVANCED).each(function(e){u[u.length]=e.generateID()}),o.setAttribute("role","button"),o.setAttribute("aria-controls",u.join(" "));var a=e.Node.create(s.FITEM);a.addClass(i.MORELESSACTIONS);var f=e.Node.create(s.FELEMENT);return f.append(o),a.append(f),t.one(r.DIVFCONTAINER).append(a),this},switchState:function(t){t.preventDefault();var n=this.ancestor(r.FIELDSETCONTAINSADVANCED);n.all(r.DIVFITEMADVANCED).toggleClass(i.SHOW);var s=e.one("input[name=mform_showmore_"+n.get("id")+"]");s.get("value")==="0"?(s.set("value",1),this.addClass(i.SHOWLESS),this.setHTML(M.util.get_string("showless","form"))):(s.set("value",0),this.removeClass(i.SHOWLESS),this.setHTML(M.util.get_string("showmore","form")))}},{NAME:"moodle-form-showadvanced",ATTRS:o}),M.form=M.form||{},M.form.showadvanced=M.form.showadvanced||function(e){return new n(e)}},"@VERSION@",{requires:["node","base","selector-css3"]});
|
||||
|
||||
@@ -82,9 +82,9 @@ Y.extend(SHOWADVANCED, Y.Base, {
|
||||
var morelesslink = Y.Node.create('<a href="#"></a>');
|
||||
morelesslink.addClass(CSS.MORELESSTOGGLER);
|
||||
if (statuselement.get('value') === '0') {
|
||||
morelesslink.setHTML(M.str.form.showmore);
|
||||
morelesslink.setHTML(M.util.get_string('showmore', 'form'));
|
||||
} else {
|
||||
morelesslink.setHTML(M.str.form.showless);
|
||||
morelesslink.setHTML(M.util.get_string('showless', 'form'));
|
||||
morelesslink.addClass(CSS.SHOWLESS);
|
||||
fieldset.all(SELECTORS.DIVFITEMADVANCED).addClass(CSS.SHOW);
|
||||
}
|
||||
|
||||
+2
-2
@@ -82,9 +82,9 @@ Y.extend(SHOWADVANCED, Y.Base, {
|
||||
var morelesslink = Y.Node.create('<a href="#"></a>');
|
||||
morelesslink.addClass(CSS.MORELESSTOGGLER);
|
||||
if (statuselement.get('value') === '0') {
|
||||
morelesslink.setHTML(M.str.form.showmore);
|
||||
morelesslink.setHTML(M.util.get_string('showmore', 'form'));
|
||||
} else {
|
||||
morelesslink.setHTML(M.str.form.showless);
|
||||
morelesslink.setHTML(M.util.get_string('showless', 'form'));
|
||||
morelesslink.addClass(CSS.SHOWLESS);
|
||||
fieldset.all(SELECTORS.DIVFITEMADVANCED).addClass(CSS.SHOW);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,8 @@ M.core.dock.fixTitleOrientation = function(title, text) {
|
||||
test,
|
||||
width,
|
||||
height,
|
||||
container;
|
||||
container,
|
||||
verticaldirection = M.util.get_string('thisdirectionvertical', 'langconfig');
|
||||
title = Y.one(title);
|
||||
|
||||
if (dock.get('orientation') !== 'vertical') {
|
||||
@@ -154,10 +155,10 @@ M.core.dock.fixTitleOrientation = function(title, text) {
|
||||
|
||||
if (Y.UA.ie > 0 && Y.UA.ie < 8) {
|
||||
// IE 6/7 can't rotate text so force ver
|
||||
M.str.langconfig.thisdirectionvertical = 'ver';
|
||||
verticaldirection = 'ver';
|
||||
}
|
||||
|
||||
switch (M.str.langconfig.thisdirectionvertical) {
|
||||
switch (verticaldirection) {
|
||||
case 'ver':
|
||||
// Stacked is easy
|
||||
return title.set('innerHTML', text.split('').join('<br />'));
|
||||
@@ -1720,7 +1721,7 @@ BLOCK.prototype = {
|
||||
blockcommands = this.cachedcontentnode.one('.title .commands').cloneNode(true);
|
||||
|
||||
movetoimg = Y.Node.create('<img />').setAttrs({
|
||||
alt : Y.Escape.html(M.str.block.undockitem),
|
||||
alt : Y.Escape.html(M.util.get_string('undockitem', 'block')),
|
||||
title : Y.Escape.html(M.util.get_string('undockblock', 'block', blocktitle.get('innerHTML'))),
|
||||
src : M.util.image_url(icon, 'moodle')
|
||||
});
|
||||
@@ -1944,7 +1945,7 @@ DOCKEDITEM.prototype = {
|
||||
dockitem.append(docktitle);
|
||||
dock.append(dockitem);
|
||||
|
||||
closeiconimg = create('<img alt="'+M.str.block.hidepanel+'" title="'+M.str.block.hidedockpanel+'" />');
|
||||
closeiconimg = create('<img alt="'+M.util.get_string('hidepanel', 'block')+'" title="'+M.util.get_string('hidedockpanel', 'block')+'" />');
|
||||
closeiconimg.setAttribute('src', M.util.image_url('t/dockclose', 'moodle'));
|
||||
closeicon = create('<span class="hidepanelicon" tabindex="0"></span>').append(closeiconimg);
|
||||
closeicon.on('forceclose|click', this.hide, this);
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
+6
-5
@@ -142,7 +142,8 @@ M.core.dock.fixTitleOrientation = function(title, text) {
|
||||
test,
|
||||
width,
|
||||
height,
|
||||
container;
|
||||
container,
|
||||
verticaldirection = M.util.get_string('thisdirectionvertical', 'langconfig');
|
||||
title = Y.one(title);
|
||||
|
||||
if (dock.get('orientation') !== 'vertical') {
|
||||
@@ -153,10 +154,10 @@ M.core.dock.fixTitleOrientation = function(title, text) {
|
||||
|
||||
if (Y.UA.ie > 0 && Y.UA.ie < 8) {
|
||||
// IE 6/7 can't rotate text so force ver
|
||||
M.str.langconfig.thisdirectionvertical = 'ver';
|
||||
verticaldirection = 'ver';
|
||||
}
|
||||
|
||||
switch (M.str.langconfig.thisdirectionvertical) {
|
||||
switch (verticaldirection) {
|
||||
case 'ver':
|
||||
// Stacked is easy
|
||||
return title.set('innerHTML', text.split('').join('<br />'));
|
||||
@@ -1706,7 +1707,7 @@ BLOCK.prototype = {
|
||||
blockcommands = this.cachedcontentnode.one('.title .commands').cloneNode(true);
|
||||
|
||||
movetoimg = Y.Node.create('<img />').setAttrs({
|
||||
alt : Y.Escape.html(M.str.block.undockitem),
|
||||
alt : Y.Escape.html(M.util.get_string('undockitem', 'block')),
|
||||
title : Y.Escape.html(M.util.get_string('undockblock', 'block', blocktitle.get('innerHTML'))),
|
||||
src : M.util.image_url(icon, 'moodle')
|
||||
});
|
||||
@@ -1928,7 +1929,7 @@ DOCKEDITEM.prototype = {
|
||||
dockitem.append(docktitle);
|
||||
dock.append(dockitem);
|
||||
|
||||
closeiconimg = create('<img alt="'+M.str.block.hidepanel+'" title="'+M.str.block.hidedockpanel+'" />');
|
||||
closeiconimg = create('<img alt="'+M.util.get_string('hidepanel', 'block')+'" title="'+M.util.get_string('hidedockpanel', 'block')+'" />');
|
||||
closeiconimg.setAttribute('src', M.util.image_url('t/dockclose', 'moodle'));
|
||||
closeicon = create('<span class="hidepanelicon" tabindex="0"></span>').append(closeiconimg);
|
||||
closeicon.on('forceclose|click', this.hide, this);
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, {
|
||||
updatetimer: function() {
|
||||
this.timeleftinsec -= 1;
|
||||
if (this.timeleftinsec <= 0) {
|
||||
this.maintenancenode.set('text', M.str.admin.sitemaintenance);
|
||||
this.maintenancenode.set('text', M.util.get_string('sitemaintenance', 'admin'));
|
||||
} else {
|
||||
var a = {};
|
||||
a.sec = this.timeleftinsec % 60;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-core-maintenancemodetimer",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{timeleftinsec:0,maintenancenode:e.one(".box.maintenancewarning"),initializer:function(t){this.maintenancenode&&(this.timeleftinsec=t.timeleftinsec,this.maintenancenode.setAttribute("aria-live","polite"),e.later(1e3,this,"updatetimer",null,!0))},updatetimer:function(){this.timeleftinsec-=1;if(this.timeleftinsec<=0)this.maintenancenode.set("text",M.str.admin.sitemaintenance);else{var e={};e.sec=this.timeleftinsec%60,e.min=Math.floor(this.timeleftinsec/60),this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduled","admin",e))}this.timeleftinsec<30?this.maintenancenode.addClass("error").removeClass("warning"):this.maintenancenode.addClass("warning").removeClass("error")}}),M.core=M.core||{},M.core.maintenancemodetimer=M.core.maintenancemodetimer||function(e){return new n(e)}},"@VERSION@",{requires:["base","node"]});
|
||||
YUI.add("moodle-core-maintenancemodetimer",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{timeleftinsec:0,maintenancenode:e.one(".box.maintenancewarning"),initializer:function(t){this.maintenancenode&&(this.timeleftinsec=t.timeleftinsec,this.maintenancenode.setAttribute("aria-live","polite"),e.later(1e3,this,"updatetimer",null,!0))},updatetimer:function(){this.timeleftinsec-=1;if(this.timeleftinsec<=0)this.maintenancenode.set("text",M.util.get_string("sitemaintenance","admin"));else{var e={};e.sec=this.timeleftinsec%60,e.min=Math.floor(this.timeleftinsec/60),this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduled","admin",e))}this.timeleftinsec<30?this.maintenancenode.addClass("error").removeClass("warning"):this.maintenancenode.addClass("warning").removeClass("error")}}),M.core=M.core||{},M.core.maintenancemodetimer=M.core.maintenancemodetimer||function(e){return new n(e)}},"@VERSION@",{requires:["base","node"]});
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, {
|
||||
updatetimer: function() {
|
||||
this.timeleftinsec -= 1;
|
||||
if (this.timeleftinsec <= 0) {
|
||||
this.maintenancenode.set('text', M.str.admin.sitemaintenance);
|
||||
this.maintenancenode.set('text', M.util.get_string('sitemaintenance', 'admin'));
|
||||
} else {
|
||||
var a = {};
|
||||
a.sec = this.timeleftinsec % 60;
|
||||
|
||||
Vendored
+1
-1
@@ -137,7 +137,7 @@ BLOCK.prototype = {
|
||||
blockcommands = this.cachedcontentnode.one('.title .commands').cloneNode(true);
|
||||
|
||||
movetoimg = Y.Node.create('<img />').setAttrs({
|
||||
alt : Y.Escape.html(M.str.block.undockitem),
|
||||
alt : Y.Escape.html(M.util.get_string('undockitem', 'block')),
|
||||
title : Y.Escape.html(M.util.get_string('undockblock', 'block', blocktitle.get('innerHTML'))),
|
||||
src : M.util.image_url(icon, 'moodle')
|
||||
});
|
||||
|
||||
Vendored
+4
-3
@@ -141,7 +141,8 @@ M.core.dock.fixTitleOrientation = function(title, text) {
|
||||
test,
|
||||
width,
|
||||
height,
|
||||
container;
|
||||
container,
|
||||
verticaldirection = M.util.get_string('thisdirectionvertical', 'langconfig');
|
||||
title = Y.one(title);
|
||||
|
||||
if (dock.get('orientation') !== 'vertical') {
|
||||
@@ -152,10 +153,10 @@ M.core.dock.fixTitleOrientation = function(title, text) {
|
||||
|
||||
if (Y.UA.ie > 0 && Y.UA.ie < 8) {
|
||||
// IE 6/7 can't rotate text so force ver
|
||||
M.str.langconfig.thisdirectionvertical = 'ver';
|
||||
verticaldirection = 'ver';
|
||||
}
|
||||
|
||||
switch (M.str.langconfig.thisdirectionvertical) {
|
||||
switch (verticaldirection) {
|
||||
case 'ver':
|
||||
// Stacked is easy
|
||||
return title.set('innerHTML', text.split('').join('<br />'));
|
||||
|
||||
Vendored
+1
-1
@@ -105,7 +105,7 @@ DOCKEDITEM.prototype = {
|
||||
dockitem.append(docktitle);
|
||||
dock.append(dockitem);
|
||||
|
||||
closeiconimg = create('<img alt="'+M.str.block.hidepanel+'" title="'+M.str.block.hidedockpanel+'" />');
|
||||
closeiconimg = create('<img alt="'+M.util.get_string('hidepanel', 'block')+'" title="'+M.util.get_string('hidedockpanel', 'block')+'" />');
|
||||
closeiconimg.setAttribute('src', M.util.image_url('t/dockclose', 'moodle'));
|
||||
closeicon = create('<span class="hidepanelicon" tabindex="0"></span>').append(closeiconimg);
|
||||
closeicon.on('forceclose|click', this.hide, this);
|
||||
|
||||
@@ -33,7 +33,7 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, {
|
||||
updatetimer: function() {
|
||||
this.timeleftinsec -= 1;
|
||||
if (this.timeleftinsec <= 0) {
|
||||
this.maintenancenode.set('text', M.str.admin.sitemaintenance);
|
||||
this.maintenancenode.set('text', M.util.get_string('sitemaintenance', 'admin'));
|
||||
} else {
|
||||
var a = {};
|
||||
a.sec = this.timeleftinsec % 60;
|
||||
|
||||
@@ -141,7 +141,7 @@ M.mod_chat_ajax.init = function(Y, cfg) {
|
||||
|
||||
send : function(e, beep) {
|
||||
if((this.messageinput.get('value') != '') || (typeof beep != 'undefined')) {
|
||||
this.sendbutton.set('value', M.str.chat.sending);
|
||||
this.sendbutton.set('value', M.util.get_string('sending', 'chat'));
|
||||
var data = {
|
||||
chat_message : (!beep) ? this.messageinput.get('value') : '',
|
||||
chat_sid : this.cfg.sid,
|
||||
@@ -169,7 +169,7 @@ M.mod_chat_ajax.init = function(Y, cfg) {
|
||||
} catch (ex) {
|
||||
return;
|
||||
}
|
||||
this.sendbutton.set('value', M.str.chat.send);
|
||||
this.sendbutton.set('value', M.util.get_string('send', 'chat'));
|
||||
this.messageinput.set('value', '');
|
||||
clearInterval(this.interval);
|
||||
this.update_messages();
|
||||
@@ -243,9 +243,9 @@ M.mod_chat_ajax.init = function(Y, cfg) {
|
||||
li.all('td').item(1).append(Y.Node.create('<strong><a target="_blank" href="' + users[i].url + '">' + users[i].name + '</a></strong>'));
|
||||
} else {
|
||||
li.all('td').item(1).append(Y.Node.create('<div><a target="_blank" href="' + users[i].url + '">' + users[i].name + '</a></div>'));
|
||||
var talk = Y.Node.create('<a href="###">' + M.str.chat.talk + '</a>');
|
||||
var talk = Y.Node.create('<a href="###">' + M.util.get_string('talk', 'chat') + '</a>');
|
||||
talk.on('click', this.talkto, this, users[i].name);
|
||||
var beep = Y.Node.create('<a href="###">' + M.str.chat.beep + '</a>');
|
||||
var beep = Y.Node.create('<a href="###">' + M.util.get_string('beep', 'chat') + '</a>');
|
||||
beep.on('click', this.send, this, users[i].id);
|
||||
li.all('td').item(1).append(Y.Node.create('<div></div>').append(talk).append(' ').append(beep));
|
||||
}
|
||||
|
||||
+3
-3
@@ -188,14 +188,14 @@ M.mod_imscp.init = function(Y) {
|
||||
|
||||
|
||||
// layout
|
||||
Y.YUI2.widget.LayoutUnit.prototype.STR_COLLAPSE = M.str.moodle.hide;
|
||||
Y.YUI2.widget.LayoutUnit.prototype.STR_EXPAND = M.str.moodle.show;
|
||||
Y.YUI2.widget.LayoutUnit.prototype.STR_COLLAPSE = M.util.get_string('hide', 'moodle');
|
||||
Y.YUI2.widget.LayoutUnit.prototype.STR_EXPAND = M.util.get_string('show', 'moodle');
|
||||
|
||||
imscp_layout_widget = new Y.YUI2.widget.Layout('imscp_layout', {
|
||||
minWidth: 600,
|
||||
minHeight: 400,
|
||||
units: [
|
||||
{ position: 'left', body: 'imscp_toc', header: M.str.imscp.toc, width: 250, resize: true, gutter: '2px 5px 5px 2px', collapse: true, minWidth:150},
|
||||
{ position: 'left', body: 'imscp_toc', header: M.util.get_string('toc', 'imscp'), width: 250, resize: true, gutter: '2px 5px 5px 2px', collapse: true, minWidth:150},
|
||||
{ position: 'center', body: '<div id="imscp_content"></div>', gutter: '2px 5px 5px 2px', scroll: true}
|
||||
]
|
||||
});
|
||||
|
||||
+15
-15
@@ -151,10 +151,10 @@
|
||||
var domainRegex = /(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i;
|
||||
var match = domainRegex.exec(url);
|
||||
if(match && match[1] && match[1].toLowerCase() === selectedOption.getAttribute('domain').toLowerCase()){
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.green_check_icon_url + '" />' + M.str.lti.using_tool_configuration + selectedOption.get('text'));
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.green_check_icon_url + '" />' + M.util.get_string('using_tool_configuration', 'lti') + selectedOption.get('text'));
|
||||
} else {
|
||||
// The entered URL does not match the domain of the tool configuration
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.warning_icon_url + '" />' + M.str.lti.domain_mismatch);
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.warning_icon_url + '" />' + M.util.get_string('domain_mismatch', 'lti'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
// Indicate the tool is manually configured
|
||||
// We still check the Launch URL with the server as course/site tools may override privacy settings
|
||||
if(key.get('value') !== '' && secret.get('value') !== ''){
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.green_check_icon_url + '" />' + M.str.lti.custom_config);
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.green_check_icon_url + '" />' + M.util.get_string('custom_config', 'lti'));
|
||||
}
|
||||
|
||||
var continuation = function(toolInfo, inputfield){
|
||||
@@ -172,11 +172,11 @@
|
||||
self.updatePrivacySettings(toolInfo);
|
||||
}
|
||||
if(toolInfo.toolname){
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.green_check_icon_url + '" />' + M.str.lti.using_tool_configuration + toolInfo.toolname);
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.green_check_icon_url + '" />' + M.util.get_string('using_tool_configuration', 'lti') + toolInfo.toolname);
|
||||
} else if(!selectedToolType) {
|
||||
// Inform them custom configuration is in use
|
||||
if(key.get('value') === '' || secret.get('value') === ''){
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.warning_icon_url + '" />' + M.str.lti.tool_config_not_found);
|
||||
automatchToolDisplay.set('innerHTML', '<img style="vertical-align:text-bottom" src="' + self.settings.warning_icon_url + '" />' + M.util.get_string('tool_config_not_found', 'lti'));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -253,11 +253,11 @@
|
||||
if(settingValue == M.mod_lti.LTI_SETTING_NEVER){
|
||||
control.set('disabled', true);
|
||||
control.set('checked', false);
|
||||
control.set('title', M.str.lti.forced_help);
|
||||
control.set('title', M.util.get_string('forced_help', 'lti'));
|
||||
} else if(settingValue == M.mod_lti.LTI_SETTING_ALWAYS){
|
||||
control.set('disabled', true);
|
||||
control.set('checked', true);
|
||||
control.set('title', M.str.lti.forced_help);
|
||||
control.set('title', M.util.get_string('forced_help', 'lti'));
|
||||
} else if(settingValue == M.mod_lti.LTI_SETTING_DELEGATE){
|
||||
control.set('disabled', false);
|
||||
|
||||
@@ -289,11 +289,11 @@
|
||||
|
||||
var globalGroup = Y.Node.create('<optgroup />')
|
||||
.set('id', 'global_tool_group')
|
||||
.set('label', M.str.lti.global_tool_types);
|
||||
.set('label', M.util.get_string('global_tool_types', 'lti'));
|
||||
|
||||
var courseGroup = Y.Node.create('<optgroup />')
|
||||
.set('id', 'course_tool_group')
|
||||
.set('label', M.str.lti.course_tool_types);
|
||||
.set('label', M.util.get_string('course_tool_types', 'lti'));
|
||||
|
||||
var globalOptions = typeSelector.all('option[globalTool=1]').remove().each(function(node){
|
||||
globalGroup.append(node);
|
||||
@@ -331,9 +331,9 @@
|
||||
.append(Y.Node.create('<img src="' + iconUrl + '" />'));
|
||||
}
|
||||
|
||||
var addIcon = createIcon('lti_add_tool_type', M.str.lti.addtype, this.settings.add_icon_url);
|
||||
var editIcon = createIcon('lti_edit_tool_type', M.str.lti.edittype, this.settings.edit_icon_url);
|
||||
var deleteIcon = createIcon('lti_delete_tool_type', M.str.lti.deletetype, this.settings.delete_icon_url);
|
||||
var addIcon = createIcon('lti_add_tool_type', M.util.get_string('addtype', 'lti'), this.settings.add_icon_url);
|
||||
var editIcon = createIcon('lti_edit_tool_type', M.util.get_string('edittype', 'lti'), this.settings.edit_icon_url);
|
||||
var deleteIcon = createIcon('lti_delete_tool_type', M.util.get_string('deletetype', 'lti'), this.settings.delete_icon_url);
|
||||
|
||||
editIcon.on('click', function(e){
|
||||
var toolTypeId = typeSelector.get('value');
|
||||
@@ -341,7 +341,7 @@
|
||||
if(self.getSelectedToolTypeOption().getAttribute('editable')){
|
||||
window.open(self.settings.instructor_tool_type_edit_url + '&action=edit&typeid=' + toolTypeId, 'edit_tool');
|
||||
} else {
|
||||
alert(M.str.lti.cannot_edit);
|
||||
alert(M.util.get_string('cannot_edit', 'lti'));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -353,11 +353,11 @@
|
||||
var toolTypeId = typeSelector.get('value');
|
||||
|
||||
if(self.getSelectedToolTypeOption().getAttribute('editable')){
|
||||
if(confirm(M.str.lti.delete_confirmation)){
|
||||
if(confirm(M.util.get_string('delete_confirmation', 'lti'))){
|
||||
self.deleteTool(toolTypeId);
|
||||
}
|
||||
} else {
|
||||
alert(M.str.lti.cannot_delete);
|
||||
alert(M.util.get_string('cannot_delete', 'lti'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+3
-3
@@ -99,7 +99,7 @@ M.mod_quiz.timer = {
|
||||
// If time has expired, set the hidden form field that says time has expired and submit
|
||||
if (secondsleft < 0) {
|
||||
M.mod_quiz.timer.stop(null);
|
||||
Y.one('#quiz-time-left').setContent(M.str.quiz.timesup);
|
||||
Y.one('#quiz-time-left').setContent(M.util.get_string('timesup', 'quiz'));
|
||||
var input = Y.one('input[name=timeup]');
|
||||
input.set('value', 1);
|
||||
var form = input.ancestor('form');
|
||||
@@ -141,7 +141,7 @@ M.mod_quiz.nav.update_flag_state = function(attemptid, questionid, newstate) {
|
||||
navlink.removeClass('flagged');
|
||||
if (newstate == 1) {
|
||||
navlink.addClass('flagged');
|
||||
navlink.one('.accesshide .flagstate').setContent(M.str.question.flagged);
|
||||
navlink.one('.accesshide .flagstate').setContent(M.util.get_string('flagged', 'question'));
|
||||
} else {
|
||||
navlink.one('.accesshide .flagstate').setContent('');
|
||||
}
|
||||
@@ -262,7 +262,7 @@ M.mod_quiz.secure_window = {
|
||||
},
|
||||
|
||||
prevent: function(e) {
|
||||
alert(M.str.quiz.functiondisabledbysecuremode);
|
||||
alert(M.util.get_string('functiondisabledbysecuremode', 'quiz'));
|
||||
e.halt();
|
||||
},
|
||||
|
||||
|
||||
+1
-1
@@ -313,7 +313,7 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
|
||||
this.groups = ['resource'];
|
||||
this.samenodeclass = CSS.ACTIVITY;
|
||||
this.parentnodeclass = CSS.SECTION;
|
||||
this.resourcedraghandle = this.get_drag_handle(M.str.moodle.move, CSS.EDITINGMOVE, CSS.ICONCLASS, true);
|
||||
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('move', 'moodle'), CSS.EDITINGMOVE, CSS.ICONCLASS, true);
|
||||
|
||||
this.samenodelabel = {
|
||||
identifier: 'dragtoafter',
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -308,7 +308,7 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
|
||||
this.groups = ['resource'];
|
||||
this.samenodeclass = CSS.ACTIVITY;
|
||||
this.parentnodeclass = CSS.SECTION;
|
||||
this.resourcedraghandle = this.get_drag_handle(M.str.moodle.move, CSS.EDITINGMOVE, CSS.ICONCLASS, true);
|
||||
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('move', 'moodle'), CSS.EDITINGMOVE, CSS.ICONCLASS, true);
|
||||
|
||||
this.samenodelabel = {
|
||||
identifier: 'dragtoafter',
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
|
||||
this.groups = ['resource'];
|
||||
this.samenodeclass = CSS.ACTIVITY;
|
||||
this.parentnodeclass = CSS.SECTION;
|
||||
this.resourcedraghandle = this.get_drag_handle(M.str.moodle.move, CSS.EDITINGMOVE, CSS.ICONCLASS, true);
|
||||
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('move', 'moodle'), CSS.EDITINGMOVE, CSS.ICONCLASS, true);
|
||||
|
||||
this.samenodelabel = {
|
||||
identifier: 'dragtoafter',
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ M.mod_scorm.init = function(Y, nav_display, navposition_left, navposition_top, h
|
||||
if (window_name) {
|
||||
var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
|
||||
if(! mine) {
|
||||
alert(M.str.scorm.popupsblocked);
|
||||
alert(M.util.get_string('popupsblocked', 'scorm'));
|
||||
}
|
||||
mine.close();
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ M.mod_scormform.init = function(Y) {
|
||||
}
|
||||
// Hide the intro and display a message to the user if the window is closed.
|
||||
var scormintro = Y.one('#intro');
|
||||
scormintro.setHTML('<a href="' + course_url + '">' + M.str.scorm.popuplaunched + '</a>');
|
||||
scormintro.setHTML('<a href="' + course_url + '">' + M.util.get_string('popuplaunched', 'scorm') + '</a>');
|
||||
}
|
||||
|
||||
// When pop-up is closed return to course homepage.
|
||||
@@ -60,7 +60,7 @@ M.mod_scormform.init = function(Y) {
|
||||
setTimeout(function() {
|
||||
if (!winobj) {
|
||||
var scormintro = Y.one('#intro');
|
||||
scormintro.setHTML(M.str.scorm.popupsblocked);
|
||||
scormintro.setHTML(M.util.get_string('popupsblocked', 'scorm'));
|
||||
}}, 800);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ M.mod_survey.init = function(Y) {
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
alert(M.str.survey.questionsnotanswered);
|
||||
alert(M.util.get_string('questionsnotanswered', 'survey'));
|
||||
Y.YUI2.util.Event.preventDefault(e);
|
||||
return false;
|
||||
} else {
|
||||
|
||||
+18
-18
@@ -331,13 +331,13 @@ YUI.add('moodle-core_filepicker', function(Y) {
|
||||
/** initialize table view */
|
||||
var initialize_table_view = function() {
|
||||
var cols = [
|
||||
{key: "displayname", label: M.str.moodle.name, allowHTML: true, formatter: formatTitle,
|
||||
{key: "displayname", label: M.util.get_string('name', 'moodle'), allowHTML: true, formatter: formatTitle,
|
||||
sortable: true, sortFn: sortFoldersFirst},
|
||||
{key: "datemodified", label: M.str.moodle.lastmodified, allowHTML: true, formatter: formatValue,
|
||||
{key: "datemodified", label: M.util.get_string('lastmodified', 'moodle'), allowHTML: true, formatter: formatValue,
|
||||
sortable: true, sortFn: sortFoldersFirst},
|
||||
{key: "size", label: M.str.repository.size, allowHTML: true, formatter: formatValue,
|
||||
{key: "size", label: M.util.get_string('size', 'repository'), allowHTML: true, formatter: formatValue,
|
||||
sortable: true, sortFn: sortFoldersFirst},
|
||||
{key: "mimetype", label: M.str.repository.type, allowHTML: true,
|
||||
{key: "mimetype", label: M.util.get_string('type', 'repository'), allowHTML: true,
|
||||
sortable: true, sortFn: sortFoldersFirst}
|
||||
];
|
||||
scope.tableview = new Y.DataTable({columns: cols, data: fileslist});
|
||||
@@ -722,7 +722,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
this.process_dlg = new M.core.dialogue({
|
||||
draggable : true,
|
||||
bodyContent : node,
|
||||
headerContent: M.str.repository.fileexistsdialogheader,
|
||||
headerContent: M.util.get_string('fileexistsdialogheader', 'repository'),
|
||||
centered : true,
|
||||
modal : true,
|
||||
visible : false,
|
||||
@@ -732,9 +732,9 @@ M.core_filepicker.init = function(Y, options) {
|
||||
node.one('.fp-dlg-butrename').on('click', handleRename, this);
|
||||
node.one('.fp-dlg-butcancel').on('click', handleCancel, this);
|
||||
if (this.options.env == 'editor') {
|
||||
node.one('.fp-dlg-text').setContent(M.str.repository.fileexistsdialog_editor);
|
||||
node.one('.fp-dlg-text').setContent(M.util.get_string('fileexistsdialog_editor', 'repository'));
|
||||
} else {
|
||||
node.one('.fp-dlg-text').setContent(M.str.repository.fileexistsdialog_filemanager);
|
||||
node.one('.fp-dlg-text').setContent(M.util.get_string('fileexistsdialog_filemanager', 'repository'));
|
||||
}
|
||||
}
|
||||
this.selectnode.removeClass('loading');
|
||||
@@ -751,10 +751,10 @@ M.core_filepicker.init = function(Y, options) {
|
||||
},
|
||||
/** displays message in a popup */
|
||||
print_msg: function(msg, type) {
|
||||
var header = M.str.moodle.error;
|
||||
var header = M.util.get_string('error', 'moodle');
|
||||
if (type != 'error') {
|
||||
type = 'info'; // one of only two types excepted
|
||||
header = M.str.moodle.info;
|
||||
header = M.util.get_string('info', 'moodle');
|
||||
}
|
||||
if (!this.msg_dlg) {
|
||||
this.msg_dlg_node = Y.Node.createWithFilesSkin(M.core_filepicker.templates.message);
|
||||
@@ -785,7 +785,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
/*if ((appenditems == null) && (!this.filelist || !this.filelist.length) && !this.active_repo.hasmorepages) {
|
||||
// TODO do it via classes and adjust for each view mode!
|
||||
// If there are no items and no next page, just display status message and quit
|
||||
this.display_error(M.str.repository.nofilesavailable, 'nofilesavailable');
|
||||
this.display_error(M.util.get_string('nofilesavailable', 'repository'), 'nofilesavailable');
|
||||
return;
|
||||
}*/
|
||||
if (this.viewmode == 2) {
|
||||
@@ -920,7 +920,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
var list = (appenditems != null) ? appenditems : this.filelist;
|
||||
this.viewmode = 2;
|
||||
if (!this.filelist || this.filelist.length==0 && (!this.filepath || !this.filepath.length)) {
|
||||
this.display_error(M.str.repository.nofilesavailable, 'nofilesavailable');
|
||||
this.display_error(M.util.get_string('nofilesavailable', 'repository'), 'nofilesavailable');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -964,7 +964,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
var list = (appenditems != null) ? appenditems : this.filelist;
|
||||
var element_template = Y.Node.create(M.core_filepicker.templates.iconfilename);
|
||||
if ((appenditems == null) && (!this.filelist || !this.filelist.length)) {
|
||||
this.display_error(M.str.repository.nofilesavailable, 'nofilesavailable');
|
||||
this.display_error(M.util.get_string('nofilesavailable', 'repository'), 'nofilesavailable');
|
||||
return;
|
||||
}
|
||||
var options = {
|
||||
@@ -998,7 +998,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
this.viewmode = 3;
|
||||
var list = (appenditems != null) ? appenditems : this.filelist;
|
||||
if (!appenditems && (!this.filelist || this.filelist.length==0) && !this.active_repo.hasmorepages) {
|
||||
this.display_error(M.str.repository.nofilesavailable, 'nofilesavailable');
|
||||
this.display_error(M.util.get_string('nofilesavailable', 'repository'), 'nofilesavailable');
|
||||
return;
|
||||
}
|
||||
var element_template = Y.Node.create(M.core_filepicker.templates.listfilename);
|
||||
@@ -1074,7 +1074,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
if (argstitle.length > titlelength) {
|
||||
argstitle = argstitle.substring(0, titlelength) + '...';
|
||||
}
|
||||
Y.one('#fp-file_label_'+this.options.client_id).setContent(Y.Escape.html(M.str.repository.select+' '+argstitle));
|
||||
Y.one('#fp-file_label_'+this.options.client_id).setContent(Y.Escape.html(M.util.get_string('select', 'repository')+' '+argstitle));
|
||||
this.selectui.show();
|
||||
Y.one('#'+this.selectnode.get('id')).focus();
|
||||
var client_id = this.options.client_id;
|
||||
@@ -1305,7 +1305,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
extraClasses : ['filepicker'],
|
||||
draggable : true,
|
||||
bodyContent : this.fpnode,
|
||||
headerContent: '<h3 id="'+ labelid +'">'+ M.str.repository.filepicker +'</h3>',
|
||||
headerContent: '<h3 id="'+ labelid +'">'+ M.util.get_string('filepicker', 'repository') +'</h3>',
|
||||
centered : true,
|
||||
modal : true,
|
||||
visible : false,
|
||||
@@ -1323,7 +1323,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
|
||||
var fplabel = 'fp-file_label_'+ client_id;
|
||||
this.selectui = new M.core.dialogue({
|
||||
headerContent: '<h3 id="' + fplabel +'">'+M.str.repository.select+'</h3>',
|
||||
headerContent: '<h3 id="' + fplabel +'">'+M.util.get_string('select', 'repository')+'</h3>',
|
||||
draggable : true,
|
||||
width : '450px',
|
||||
bodyContent : this.selectnode,
|
||||
@@ -1393,7 +1393,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
}
|
||||
// display error if no repositories found
|
||||
if (sorted_repositories.length==0) {
|
||||
this.display_error(M.str.repository.norepositoriesavailable, 'norepositoriesavailable')
|
||||
this.display_error(M.util.get_string('norepositoriesavailable', 'repository'), 'norepositoriesavailable')
|
||||
}
|
||||
// display repository that was used last time
|
||||
this.mainui.show();
|
||||
@@ -1698,7 +1698,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
|
||||
this.set_preference('recentlicense', license.get('value'));
|
||||
if (!content.one('.fp-file input').get('value')) {
|
||||
scope.print_msg(M.str.repository.nofilesattached, 'error');
|
||||
scope.print_msg(M.util.get_string('nofilesattached', 'repository'), 'error');
|
||||
return false;
|
||||
}
|
||||
this.hide_header();
|
||||
|
||||
+4
-4
@@ -32,13 +32,13 @@ YUI().use('yui2-autocomplete', 'yui2-datasource', 'yui2-animation', 'yui2-connec
|
||||
function ctags_checkinput(val) {
|
||||
var len = val.length;
|
||||
if (len < 2 || len > 50) {
|
||||
alert(M.str.block_tags.jserror1);
|
||||
alert(M.util.get_string('jserror1', 'block_tags'));
|
||||
return false;
|
||||
} else if (val.indexOf("<") > 0) {
|
||||
alert(M.str.block_tags.jserror2);
|
||||
alert(M.util.get_string('jserror2', 'block_tags'));
|
||||
return false;
|
||||
} else if (val.indexOf(">") > 0) {
|
||||
alert(M.str.block_tags.jserror2);
|
||||
alert(M.util.get_string('jserror2', 'block_tags'));
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
@@ -69,4 +69,4 @@ function add_tag_footer_link(eid, ltitle, laction, ltext) {
|
||||
}
|
||||
e.appendChild(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,13 +215,13 @@ M.core_user.init_user_selector = function (Y, name, hash, extrafields, lastsearc
|
||||
count ++;
|
||||
}
|
||||
if (!count) {
|
||||
var searchstr = (this.lastsearch != '') ? this.insert_search_into_str(M.str.moodle.nomatchingusers, this.lastsearch) : M.str.moodle.none;
|
||||
var searchstr = (this.lastsearch != '') ? this.insert_search_into_str(M.util.get_string('nomatchingusers', 'moodle'), this.lastsearch) : M.util.get_string('none', 'moodle');
|
||||
this.output_group(searchstr, {}, selectedusers, true)
|
||||
}
|
||||
|
||||
// If there were previously selected users who do not match the search, show them too.
|
||||
if (this.get_option('preserveselected') && selectedusers) {
|
||||
this.output_group(this.insert_search_into_str(M.str.moodle.previouslyselectedusers, this.lastsearch), selectedusers, true, false);
|
||||
this.output_group(this.insert_search_into_str(M.util.get_string('previouslyselectedusers', 'moodle'), this.lastsearch), selectedusers, true, false);
|
||||
}
|
||||
this.handle_selection_change();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user