mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-21420 finally moving old global mstr to new M.str.
This commit is contained in:
parent
87ad1edcd6
commit
2b728cb5e1
@ -6,7 +6,7 @@ M.report_spamcleaner = {
|
||||
del_all: function() {
|
||||
var context = M.report_spamcleaner;
|
||||
|
||||
var yes = confirm(mstr.report_spamcleaner.spamdeleteallconfirm);
|
||||
var yes = confirm(M.str.report_spamcleaner.spamdeleteallconfirm);
|
||||
if (yes) {
|
||||
var cfg = {
|
||||
method: "POST",
|
||||
@ -15,7 +15,7 @@ M.report_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(mstr.report_spamcleaner.spaminvalidresult);
|
||||
alert(M.str.report_spamcleaner.spaminvalidresult);
|
||||
return;
|
||||
}
|
||||
if (resp == true) {
|
||||
@ -36,7 +36,7 @@ M.report_spamcleaner = {
|
||||
return;
|
||||
}
|
||||
|
||||
var yes = confirm(mstr.report_spamcleaner.spamdeleteconfirm);
|
||||
var yes = confirm(M.str.report_spamcleaner.spamdeleteconfirm);
|
||||
if (yes) {
|
||||
context.row = obj;
|
||||
var cfg = {
|
||||
@ -46,7 +46,7 @@ M.report_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(mstr.report_spamcleaner.spaminvalidresult);
|
||||
alert(M.str.report_spamcleaner.spaminvalidresult);
|
||||
return;
|
||||
}
|
||||
if (context.row) {
|
||||
@ -57,7 +57,7 @@ M.report_spamcleaner = {
|
||||
context.row.parentNode.removeChild(context.row);
|
||||
context.row = null;
|
||||
} else {
|
||||
alert(mstr.report_spamcleaner.spamcannotdelete);
|
||||
alert(M.str.report_spamcleaner.spamcannotdelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -83,7 +83,7 @@ M.report_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(mstr.report_spamcleaner.spaminvalidresult);
|
||||
alert(M.str.report_spamcleaner.spaminvalidresult);
|
||||
return;
|
||||
}
|
||||
if (context.row) {
|
||||
|
@ -136,7 +136,7 @@ M.core_dock = {
|
||||
this.node.setStyle('height', this.node.get('winHeight')+'px');
|
||||
}
|
||||
var dockcontrol = this.Y.Node.create('<div class="'+M.core_dock.cfg.css.controls+'"></div>');
|
||||
var removeall = this.Y.Node.create('<img src="'+this.cfg.display.removeallicon+'" alt="'+mstr.block.undockall+'" title="'+mstr.block.undockall+'" />');
|
||||
var removeall = this.Y.Node.create('<img src="'+this.cfg.display.removeallicon+'" alt="'+M.str.block.undockall+'" title="'+M.str.block.undockall+'" />');
|
||||
removeall.on('removeall|click', this.remove_all, this);
|
||||
dockcontrol.appendChild(removeall);
|
||||
this.node.appendChild(dockcontrol);
|
||||
@ -336,7 +336,7 @@ M.core_dock = {
|
||||
}
|
||||
|
||||
var moveto = this.Y.Node.create('<a class="moveto customcommand requiresjs"></a>');
|
||||
moveto.append(this.Y.Node.create('<img src="'+M.util.image_url('t/dock_to_block', 'moodle')+'" alt="'+mstr.block.undockitem+'" title="'+mstr.block.undockitem+'" />'));
|
||||
moveto.append(this.Y.Node.create('<img src="'+M.util.image_url('t/dock_to_block', 'moodle')+'" alt="'+M.str.block.undockitem+'" title="'+M.str.block.undockitem+'" />'));
|
||||
if (location.href.match(/\?/)) {
|
||||
moveto.set('href', location.href+'&dock='+this.id);
|
||||
} else {
|
||||
@ -381,8 +381,8 @@ M.core_dock = {
|
||||
if (moveto.hasClass('customcommand')) {
|
||||
moveto.all('img').each(function(movetoimg){
|
||||
movetoimg.setAttribute('src', M.util.image_url('t/dock_to_block', 'moodle'));
|
||||
movetoimg.setAttribute('alt', mstr.block.undockitem);
|
||||
movetoimg.setAttribute('title', mstr.block.undockitem);
|
||||
movetoimg.setAttribute('alt', M.str.block.undockitem);
|
||||
movetoimg.setAttribute('title', M.str.block.undockitem);
|
||||
}, this);
|
||||
}
|
||||
}, this);
|
||||
@ -489,8 +489,8 @@ M.core_dock = {
|
||||
if (moveto.hasClass('customcommand')) {
|
||||
moveto.all('img').each(function(movetoimg){
|
||||
movetoimg.setAttribute('src', M.util.image_url('t/block_to_dock', 'moodle'));
|
||||
movetoimg.setAttribute('alt', mstr.block.addtodock);
|
||||
movetoimg.setAttribute('title', mstr.block.addtodock);
|
||||
movetoimg.setAttribute('alt', M.str.block.addtodock);
|
||||
movetoimg.setAttribute('title', M.str.block.addtodock);
|
||||
}, this);
|
||||
}
|
||||
}, this);
|
||||
|
@ -56,7 +56,7 @@ M.core_comment = {
|
||||
var ta = Y.one('#dlg-content-'+this.client_id);
|
||||
var scope = this;
|
||||
var value = ta.get('value');
|
||||
if (value && value != mstr.moodle.addcomment) {
|
||||
if (value && value != M.str.moodle.addcomment) {
|
||||
var params = {'content': value};
|
||||
this.request({
|
||||
action: 'add',
|
||||
@ -73,7 +73,7 @@ M.core_comment = {
|
||||
container.appendChild(newcomment);
|
||||
var ids = result.ids;
|
||||
var linktext = Y.one('#comment-link-text-'+cid);
|
||||
linktext.set('innerHTML', mstr.moodle.comments + ' ('+obj.count+')');
|
||||
linktext.set('innerHTML', M.str.moodle.comments + ' ('+obj.count+')');
|
||||
for(var i in ids) {
|
||||
var attributes = {
|
||||
color: { to: '#06e' },
|
||||
@ -158,7 +158,7 @@ M.core_comment = {
|
||||
var val = template.get('innerHTML');
|
||||
val = val.replace('___name___', list[i].username);
|
||||
if (list[i]['delete']||newcmt) {
|
||||
list[i].content = '<div class="comment-delete"><a href="###" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+mstr.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
|
||||
list[i].content = '<div class="comment-delete"><a href="###" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
|
||||
}
|
||||
val = val.replace('___time___', list[i].time);
|
||||
val = val.replace('___picture___', list[i].avatar);
|
||||
@ -181,7 +181,7 @@ M.core_comment = {
|
||||
params: params,
|
||||
callback: function(id, ret, args) {
|
||||
var linktext = Y.one('#comment-link-text-'+scope.client_id);
|
||||
linktext.set('innerHTML', mstr.moodle.comments + ' ('+ret.count+')');
|
||||
linktext.set('innerHTML', M.str.moodle.comments + ' ('+ret.count+')');
|
||||
var container = Y.one('#comment-list-'+scope.client_id);
|
||||
var pagination = Y.one('#comment-pagination-'+scope.client_id);
|
||||
if (ret.pagination) {
|
||||
@ -305,13 +305,13 @@ M.core_comment = {
|
||||
toggle_textarea: function(focus) {
|
||||
var t = Y.one('#dlg-content-'+this.client_id);
|
||||
if (focus) {
|
||||
if (t.get('value') == mstr.moodle.addcomment) {
|
||||
if (t.get('value') == M.str.moodle.addcomment) {
|
||||
t.set('value', '');
|
||||
t.setStyle('color', 'black');
|
||||
}
|
||||
}else{
|
||||
if (t.get('value') == '') {
|
||||
t.set('value', mstr.moodle.addcomment);
|
||||
t.set('value', M.str.moodle.addcomment);
|
||||
t.setStyle('color','grey');
|
||||
t.set('rows', 1);
|
||||
}
|
||||
|
@ -22,13 +22,13 @@ M.core_completion.init = function(Y) {
|
||||
if (current == 1) {
|
||||
args.state.set('value', 0);
|
||||
args.image.set('src', M.util.image_url('i/completion-manual-y', 'moodle'));
|
||||
args.image.set('alt', mstr.completion['completion-alt-manual-y']);
|
||||
args.image.set('title', mstr.completion['completion-title-manual-y']);
|
||||
args.image.set('alt', M.str.completion['completion-alt-manual-y']);
|
||||
args.image.set('title', M.str.completion['completion-title-manual-y']);
|
||||
} else {
|
||||
args.state.set('value', 1);
|
||||
args.image.set('src', M.util.image_url('i/completion-manual-n', 'moodle'));
|
||||
args.image.set('alt', mstr.completion['completion-alt-manual-n']);
|
||||
args.image.set('title', mstr.completion['completion-title-manual-n']);
|
||||
args.image.set('alt', M.str.completion['completion-alt-manual-n']);
|
||||
args.image.set('title', M.str.completion['completion-title-manual-n']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ abstract class grade_export {
|
||||
$sep = '&';
|
||||
}
|
||||
|
||||
$link = $CFG->wwwroot.'/grade/export/'.$this->plugin.'/dump.php'.$paramstr.'&key='.$this->userkey;
|
||||
$link = $CFG->wwwroot.'/grade/export/'.$this->plugin.'/dump.php'.$paraM.str.'&key='.$this->userkey;
|
||||
|
||||
echo get_string('download', 'admin').': ' . $OUTPUT->link($link, $link);
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
});
|
||||
}
|
||||
if (!Y.one('#fm-mkdir-dlg')) {
|
||||
var dialog = Y.Node.create('<div id="fm-mkdir-dlg"><div class="hd">'+mstr.repository.entername+'</div><div class="bd"><input type="text" id="fm-newname" /></div></div>');
|
||||
var dialog = Y.Node.create('<div id="fm-mkdir-dlg"><div class="hd">'+M.str.repository.entername+'</div><div class="bd"><input type="text" id="fm-newname" /></div></div>');
|
||||
Y.one(document.body).appendChild(dialog);
|
||||
this.mkdir_dialog = new YAHOO.widget.Dialog("fm-mkdir-dlg", {
|
||||
width: "300px",
|
||||
@ -189,8 +189,8 @@ M.form_filemanager.init = function(Y, options) {
|
||||
});
|
||||
|
||||
}
|
||||
var buttons = [ { text:mstr.moodle.ok, handler:perform_action, isDefault:true },
|
||||
{ text:mstr.moodle.cancel, handler:function(){this.cancel();}}];
|
||||
var buttons = [ { text:M.str.moodle.ok, handler:perform_action, isDefault:true },
|
||||
{ text:M.str.moodle.cancel, handler:function(){this.cancel();}}];
|
||||
|
||||
this.mkdir_dialog.cfg.queueProperty("buttons", buttons);
|
||||
this.mkdir_dialog.render();
|
||||
@ -212,7 +212,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
scope.refresh(obj.filepath);
|
||||
var win = window.open(obj.fileurl, 'fm-download-folder');
|
||||
if (!win) {
|
||||
alert(mstr.repository.popupblockeddownload);
|
||||
alert(M.str.repository.popupblockeddownload);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -231,7 +231,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
for(var p in path) {
|
||||
var arrow = '';
|
||||
if (count==0) {
|
||||
arrow = Y.Node.create('<span>'+mstr.moodle.path + ': </span>');
|
||||
arrow = Y.Node.create('<span>'+M.str.moodle.path + ': </span>');
|
||||
} else {
|
||||
arrow = Y.Node.create('<span> ▶ </span>');
|
||||
}
|
||||
@ -400,7 +400,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
var file = data[node.get('id')];
|
||||
|
||||
var menuitems = [
|
||||
{text: mstr.moodle.download, url:file.url}
|
||||
{text: M.str.moodle.download, url:file.url}
|
||||
];
|
||||
this.create_menu(e, 'filemenu', menuitems, file, data);
|
||||
},
|
||||
@ -423,7 +423,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
});
|
||||
}
|
||||
var menuitems = [
|
||||
{text: mstr.editor.zip, onclick: {fn: archive_folder, obj: data, scope: this}},
|
||||
{text: M.str.editor.zip, onclick: {fn: archive_folder, obj: data, scope: this}},
|
||||
];
|
||||
this.create_menu(e, 'foldermenu', menuitems, fileinfo, data);
|
||||
},
|
||||
@ -446,8 +446,8 @@ M.form_filemanager.init = function(Y, options) {
|
||||
});
|
||||
}
|
||||
var menuitems = [
|
||||
{text: mstr.moodle.download, url:fileinfo.url},
|
||||
{text: mstr.moodle.unzip, onclick: {fn: unzip, obj: data, scope: this}}
|
||||
{text: M.str.moodle.download, url:fileinfo.url},
|
||||
{text: M.str.moodle.unzip, onclick: {fn: unzip, obj: data, scope: this}}
|
||||
];
|
||||
this.create_menu(e, 'zipmenu', menuitems, fileinfo, data);
|
||||
},
|
||||
@ -457,7 +457,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
function remove(type, ev, obj) {
|
||||
var dialog_options = {};
|
||||
var params = {};
|
||||
dialog_options.message = mstr.repository.confirmdeletefile;
|
||||
dialog_options.message = M.str.repository.confirmdeletefile;
|
||||
dialog_options.scope = this;
|
||||
var filename = '';
|
||||
var filepath = '';
|
||||
@ -519,7 +519,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
|
||||
var dialog = Y.one('#fm-rename-dlg');
|
||||
if (!dialog) {
|
||||
dialog = Y.Node.create('<div id="fm-rename-dlg"><div class="hd">'+mstr.repository.enternewname+'</div><div class="bd"><input type="text" id="fm-rename-input" /></div></div>');
|
||||
dialog = Y.Node.create('<div id="fm-rename-dlg"><div class="hd">'+M.str.repository.enternewname+'</div><div class="bd"><input type="text" id="fm-rename-input" /></div></div>');
|
||||
Y.one(document.body).appendChild(dialog);
|
||||
this.rename_dialog = new YAHOO.widget.Dialog("fm-rename-dlg", {
|
||||
width: "300px",
|
||||
@ -529,8 +529,8 @@ M.form_filemanager.init = function(Y, options) {
|
||||
});
|
||||
|
||||
}
|
||||
var buttons = [ { text:mstr.moodle.rename, handler:perform, isDefault:true},
|
||||
{ text:mstr.moodle.cancel, handler:function(){this.cancel();}}];
|
||||
var buttons = [ { text:M.str.moodle.rename, handler:perform, isDefault:true},
|
||||
{ text:M.str.moodle.cancel, handler:function(){this.cancel();}}];
|
||||
|
||||
this.rename_dialog.cfg.queueProperty('buttons', buttons);
|
||||
this.rename_dialog.render();
|
||||
@ -551,7 +551,7 @@ M.form_filemanager.init = function(Y, options) {
|
||||
dialog = Y.one('#fm-move-dlg');
|
||||
}
|
||||
|
||||
dialog.set('innerHTML', '<div class="hd">Moving</div><div class="bd"><div id="fm-move-div">'+mstr.repository.nopathselected+'</div><div id="fm-tree"></div></div>');
|
||||
dialog.set('innerHTML', '<div class="hd">Moving</div><div class="bd"><div id="fm-move-div">'+M.str.repository.nopathselected+'</div><div id="fm-tree"></div></div>');
|
||||
|
||||
this.movefile_dialog = new YAHOO.widget.Dialog("fm-move-dlg", {
|
||||
width : "600px",
|
||||
@ -591,8 +591,8 @@ M.form_filemanager.init = function(Y, options) {
|
||||
});
|
||||
}
|
||||
|
||||
var buttons = [ { text:mstr.moodle.move, handler:_move, isDefault:true },
|
||||
{ text:mstr.moodle.cancel, handler:function(){this.cancel();}}];
|
||||
var buttons = [ { text:M.str.moodle.move, handler:_move, isDefault:true },
|
||||
{ text:M.str.moodle.cancel, handler:function(){this.cancel();}}];
|
||||
|
||||
this.movefile_dialog.cfg.queueProperty("buttons", buttons);
|
||||
this.movefile_dialog.render();
|
||||
@ -640,10 +640,10 @@ M.form_filemanager.init = function(Y, options) {
|
||||
this.movefile_dialog.show();
|
||||
}
|
||||
var shared_items = [
|
||||
{text: mstr.moodle.rename+'...', onclick: {fn: rename, obj: options, scope: this}},
|
||||
{text: mstr.moodle.move+'...', onclick: {fn: move, obj: options, scope: this}},
|
||||
{text: M.str.moodle.rename+'...', onclick: {fn: rename, obj: options, scope: this}},
|
||||
{text: M.str.moodle.move+'...', onclick: {fn: move, obj: options, scope: this}},
|
||||
// delete is reserve word in Javascript
|
||||
{text: mstr.moodle['delete']+'...', onclick: {fn: remove, obj: options, scope: this}}
|
||||
{text: M.str.moodle['delete']+'...', onclick: {fn: remove, obj: options, scope: this}}
|
||||
];
|
||||
var menu = new YAHOO.widget.Menu(menuid, {xy:position, clicktohide:true});
|
||||
menu.clearContent();
|
||||
|
@ -17,6 +17,11 @@ M.yui.add_module = function(modules) {
|
||||
*/
|
||||
M.util = {};
|
||||
|
||||
/**
|
||||
* Language strings - initialised from page footer.
|
||||
*/
|
||||
M.str = {};
|
||||
|
||||
/**
|
||||
* Returns url for images.
|
||||
* @param {String} imagename
|
||||
@ -271,7 +276,7 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||
}
|
||||
);
|
||||
|
||||
simpledialog.setHeader(mstr.admin.confirmation);
|
||||
simpledialog.setHeader(M.str.admin.confirmation);
|
||||
simpledialog.setBody(args.message);
|
||||
simpledialog.cfg.setProperty('icon', YAHOO.widget.SimpleDialog.ICON_WARN);
|
||||
|
||||
@ -320,8 +325,8 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||
}
|
||||
};
|
||||
|
||||
var buttons = [ { text: mstr.moodle.cancel, handler: handle_cancel, isDefault: true },
|
||||
{ text: mstr.moodle.yes, handler: handle_yes } ];
|
||||
var buttons = [ { text: M.str.moodle.cancel, handler: handle_cancel, isDefault: true },
|
||||
{ text: M.str.moodle.yes, handler: handle_yes } ];
|
||||
|
||||
simpledialog.cfg.queueProperty('buttons', buttons);
|
||||
|
||||
@ -779,8 +784,8 @@ function showAdvancedInit(addBefore, nameAttr, buttonLabel, hideText, showText)
|
||||
showHideButton.value = buttonLabel;
|
||||
showHideButton.name = nameAttr;
|
||||
showHideButton.moodle = {
|
||||
hideLabel: mstr.form.hideadvanced,
|
||||
showLabel: mstr.form.showadvanced
|
||||
hideLabel: M.str.form.hideadvanced,
|
||||
showLabel: M.str.form.showadvanced
|
||||
};
|
||||
YAHOO.util.Event.addListener(showHideButton, 'click', showAdvancedOnClick);
|
||||
el = document.getElementById(addBefore);
|
||||
|
@ -599,9 +599,9 @@ class page_requirements_manager {
|
||||
/**
|
||||
* Make a language string available to JavaScript.
|
||||
*
|
||||
* All the strings will be available in a mstr object in the global namespace.
|
||||
* All the strings will be available in a M.str object in the global namespace.
|
||||
* So, for example, after a call to $PAGE->requires->string_for_js('course', 'moodle');
|
||||
* then the JavaScript variable mstr.moodle.course will be 'Course', or the
|
||||
* then the JavaScript variable M.str.moodle.course will be 'Course', or the
|
||||
* equivalent in the current language.
|
||||
*
|
||||
* The arguments to this function are just like the arguments to get_string
|
||||
@ -934,7 +934,7 @@ class page_requirements_manager {
|
||||
|
||||
// add all needed strings
|
||||
if (!empty($this->stringsforjs)) {
|
||||
$output .= html_writer::script(js_writer::set_variable('mstr', $this->stringsforjs));
|
||||
$output .= html_writer::script(js_writer::set_variable('M.str', $this->stringsforjs));
|
||||
}
|
||||
|
||||
// add variables
|
||||
|
@ -103,7 +103,7 @@ YAHOO.moodle.chat.talkto = function(name) {
|
||||
YAHOO.moodle.chat.send_callback = {
|
||||
success: function(o) {
|
||||
if(o.responseText == 200){
|
||||
document.getElementById('button-send').value = mstr.chat.send;
|
||||
document.getElementById('button-send').value = M.str.chat.send;
|
||||
document.getElementById('input-message').value = '';
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ YAHOO.moodle.chat.send_message = function(ev) {
|
||||
if (!msg) {
|
||||
return;
|
||||
}
|
||||
el_send.value = mstr.chat.sending;
|
||||
el_send.value = M.str.chat.sending;
|
||||
var params = {};
|
||||
params.chat_message=msg;
|
||||
params.chat_sid=chat_cfg.sid;
|
||||
@ -158,8 +158,8 @@ YAHOO.moodle.chat.update_users = function(users) {
|
||||
}
|
||||
html += '<br />';
|
||||
if (users[i].id!=chat_cfg.userid) {
|
||||
html += ' <a href="###" onclick="YAHOO.moodle.chat.talkto(\''+users[i].name+'\')">'+mstr.chat.talk+'</a> ';
|
||||
html += ' <a href="###" onclick="YAHOO.moodle.chat.send_beep('+users[i].id+')">'+mstr.chat.beep+'</a>';
|
||||
html += ' <a href="###" onclick="YAHOO.moodle.chat.talkto(\''+users[i].name+'\')">'+M.str.chat.talk+'</a> ';
|
||||
html += ' <a href="###" onclick="YAHOO.moodle.chat.send_beep('+users[i].id+')">'+M.str.chat.beep+'</a>';
|
||||
}
|
||||
html += '</td>';
|
||||
html += '</tr>';
|
||||
|
@ -167,14 +167,14 @@ M.mod_imscp.init = function(Y) {
|
||||
|
||||
|
||||
// layout
|
||||
YAHOO.widget.LayoutUnit.prototype.STR_COLLAPSE = mstr.moodle.hide;
|
||||
YAHOO.widget.LayoutUnit.prototype.STR_EXPAND = mstr.moodle.show;
|
||||
YAHOO.widget.LayoutUnit.prototype.STR_COLLAPSE = M.str.moodle.hide;
|
||||
YAHOO.widget.LayoutUnit.prototype.STR_EXPAND = M.str.moodle.show;
|
||||
|
||||
imscp_layout_widget = new YAHOO.widget.Layout('imscp_layout', {
|
||||
minWidth: 600,
|
||||
minHeight: 400,
|
||||
units: [
|
||||
{ position: 'left', body: 'imscp_toc', header: mstr.imscp.toc, width: 250, resize: true, gutter: '2px 5px 5px 2px', collapse: true, minWidth:150},
|
||||
{ position: 'left', body: 'imscp_toc', header: M.str.imscp.toc, 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}
|
||||
]
|
||||
});
|
||||
@ -225,7 +225,7 @@ M.mod_imscp.init = function(Y) {
|
||||
// navigation
|
||||
imscp_panel = new YAHOO.widget.Panel('imscp_navpanel', { visible:true, draggable:true, close:false,
|
||||
context: ['page', 'bl', 'bl', ["windowScroll", "textResize", "windowResize"]], constraintoviewport:true} );
|
||||
imscp_panel.setHeader(mstr.imscp.navigation);
|
||||
imscp_panel.setHeader(M.str.imscp.navigation);
|
||||
|
||||
//TODO: make some better&accessible buttons
|
||||
imscp_panel.setBody('<span id="imscp_nav"><button id="nav_skipprev"><<</button><button id="nav_prev"><</button><button id="nav_up">^</button><button id="nav_next">></button><button id="nav_skipnext">>></button></span>');
|
||||
|
@ -10,7 +10,7 @@ function checkform(e) {
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
alert(mstr.survey.questionsnotanswered);
|
||||
alert(M.str.survey.questionsnotanswered);
|
||||
YAHOO.util.Event.preventDefault(e);
|
||||
return false;
|
||||
} else {
|
||||
|
@ -112,7 +112,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
try {
|
||||
data = Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(mstr.repository.invalidjson+' - |'+source+'| -'+stripHTML(o.responseText));
|
||||
alert(M.str.repository.invalidjson+' - |'+source+'| -'+stripHTML(o.responseText));
|
||||
}
|
||||
args.callback(id,data,p);
|
||||
}
|
||||
@ -262,7 +262,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
link.id = 'img-id-'+client_id+'-'+String(count);
|
||||
if(node.url) {
|
||||
// hide
|
||||
//grid.innerHTML += '<p><a target="_blank" href="'+node.url+'">'+mstr.repository.preview+'</a></p>';
|
||||
//grid.innerHTML += '<p><a target="_blank" href="'+node.url+'">'+M.str.repository.preview+'</a></p>';
|
||||
}
|
||||
link.appendChild(img);
|
||||
frame.appendChild(link);
|
||||
@ -320,7 +320,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
var panel = Y.one('#panel-'+client_id);
|
||||
var html = '<div class="fp-rename-form">';
|
||||
html += '<p><img src="'+args.thumbnail+'" /></p>';
|
||||
html += '<p><label for="newname-'+client_id+'">'+mstr.repository.saveas+':</label>';
|
||||
html += '<p><label for="newname-'+client_id+'">'+M.str.repository.saveas+':</label>';
|
||||
html += '<input type="text" id="newname-'+client_id+'" value="'+args.title+'" /></p>';
|
||||
|
||||
var le_checked = '';
|
||||
@ -334,11 +334,11 @@ M.core_filepicker.init = function(Y, options) {
|
||||
le_style = ' style="display:none;"';
|
||||
}
|
||||
if (this.options.externallink && this.options.env == 'editor') {
|
||||
html += '<p'+le_style+'><input type="checkbox" id="linkexternal-'+client_id+'" value="" '+le_checked+' />'+mstr.repository.linkexternal+'</p>';
|
||||
html += '<p'+le_style+'><input type="checkbox" id="linkexternal-'+client_id+'" value="" '+le_checked+' />'+M.str.repository.linkexternal+'</p>';
|
||||
}
|
||||
html += '<p><input type="hidden" id="filesource-'+client_id+'" value="'+args.source+'" />';
|
||||
html += '<input type="button" id="fp-confirm-'+client_id+'" value="'+mstr.repository.getfile+'" />';
|
||||
html += '<input type="button" id="fp-cancel-'+client_id+'" value="'+mstr.moodle.cancel+'" /></p>';
|
||||
html += '<input type="button" id="fp-confirm-'+client_id+'" value="'+M.str.repository.getfile+'" />';
|
||||
html += '<input type="button" id="fp-cancel-'+client_id+'" value="'+M.str.moodle.cancel+'" /></p>';
|
||||
html += '</div>';
|
||||
|
||||
var getfile_form = Y.Node.create(html);
|
||||
@ -401,10 +401,10 @@ M.core_filepicker.init = function(Y, options) {
|
||||
var str = '<div style="text-align:center">';
|
||||
if(type=='load') {
|
||||
str += '<img src="'+M.util.image_url('i/loading')+'" />';
|
||||
str += '<p>'+mstr.repository.loading+'</p>';
|
||||
str += '<p>'+M.str.repository.loading+'</p>';
|
||||
}else{
|
||||
str += '<img src="'+M.util.image_url('i/progressbar')+'" />';
|
||||
str += '<p>'+mstr.repository.copying+' <strong>'+name+'</strong></p>';
|
||||
str += '<p>'+M.str.repository.copying+' <strong>'+name+'</strong></p>';
|
||||
}
|
||||
str += '</div>';
|
||||
try {
|
||||
@ -451,14 +451,14 @@ M.core_filepicker.init = function(Y, options) {
|
||||
|
||||
var scope = this;
|
||||
// adding buttons
|
||||
var view_icons = {label: mstr.repository.iconview, value: 't',
|
||||
var view_icons = {label: M.str.repository.iconview, value: 't',
|
||||
onclick: {
|
||||
fn: function(){
|
||||
scope.view_as_icons();
|
||||
}
|
||||
}
|
||||
};
|
||||
var view_listing = {label: mstr.repository.listview, value: 'l',
|
||||
var view_listing = {label: M.str.repository.listview, value: 'l',
|
||||
onclick: {
|
||||
fn: function(){
|
||||
scope.view_as_list();
|
||||
@ -531,8 +531,8 @@ M.core_filepicker.init = function(Y, options) {
|
||||
if(l[k].type=='popup') {
|
||||
// pop element
|
||||
loginurl = l[k].url;
|
||||
str += '<td colspan="2"><p class="fp-popup">'+mstr.repository.popup+'</p>';
|
||||
str += '<p class="fp-popup"><button id="'+popup_button_id+'">'+mstr.repository.login+'</button>';
|
||||
str += '<td colspan="2"><p class="fp-popup">'+M.str.repository.popup+'</p>';
|
||||
str += '<p class="fp-popup"><button id="'+popup_button_id+'">'+M.str.repository.login+'</button>';
|
||||
str += '</p></td>';
|
||||
action = 'popup';
|
||||
}else if(l[k].type=='textarea') {
|
||||
@ -585,7 +585,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
str += '</form>';
|
||||
|
||||
// custom lable text
|
||||
var btn_label = data['login_btn_label']?data['login_btn_label']:mstr.repository.submit;
|
||||
var btn_label = data['login_btn_label']?data['login_btn_label']:M.str.repository.submit;
|
||||
if (action != 'popup') {
|
||||
str += '<p><input type="button" id="';
|
||||
switch (action) {
|
||||
@ -608,7 +608,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
try {
|
||||
panel.set('innerHTML', str);
|
||||
} catch(e) {
|
||||
alert(e.toString()+mstr.quiz.xhtml);
|
||||
alert(e.toString()+M.str.quiz.xhtml);
|
||||
}
|
||||
// register buttons
|
||||
// process login action
|
||||
@ -786,7 +786,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
str += '<label for="'+id+'_file">'+data.upload.label+': </label>';
|
||||
str += '<input type="file" id="'+id+'_file" name="repo_upload_file" />';
|
||||
str += '<input type="hidden" name="itemid" value="'+this.options.itemid+'" />';
|
||||
str += '<div class="fp-upload-btn"><a id="'+id+'_action" href="###" >'+mstr.repository.upload+'...</a></div>';
|
||||
str += '<div class="fp-upload-btn"><a id="'+id+'_action" href="###" >'+M.str.repository.upload+'...</a></div>';
|
||||
str += '</form>';
|
||||
str += '</div>';
|
||||
var upload_form = Y.Node.create(str);
|
||||
@ -839,7 +839,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
var toolbar = Y.one('#repo-tb-'+client_id);
|
||||
|
||||
if(!r.nosearch) {
|
||||
var html = '<a href="###"><img src="'+this.M.util.image_url('a/search')+'" /> '+mstr.repository.search+'</a>';
|
||||
var html = '<a href="###"><img src="'+this.M.util.image_url('a/search')+'" /> '+M.str.repository.search+'</a>';
|
||||
var search = Y.Node.create(html);
|
||||
search.on('click', function() {
|
||||
scope.request({
|
||||
@ -901,11 +901,11 @@ M.core_filepicker.init = function(Y, options) {
|
||||
constraintoviewport : true,
|
||||
buttons: [
|
||||
{
|
||||
text:mstr.repository.submit,
|
||||
text:M.str.repository.submit,
|
||||
handler:dialog_handler,
|
||||
isDefault:true
|
||||
}, {
|
||||
text:mstr.moodle.cancel,
|
||||
text:M.str.moodle.cancel,
|
||||
handler:function(){
|
||||
this.destroy()
|
||||
}
|
||||
@ -920,7 +920,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
}
|
||||
// weather we use cache for this instance, this button will reload listing anyway
|
||||
if(!r.norefresh) {
|
||||
var html = '<a href="###"><img src="'+M.util.image_url('a/refresh')+'" /> '+mstr.repository.refresh+'</a>';
|
||||
var html = '<a href="###"><img src="'+M.util.image_url('a/refresh')+'" /> '+M.str.repository.refresh+'</a>';
|
||||
var refresh = Y.Node.create(html);
|
||||
refresh.on('click', function() {
|
||||
this.list();
|
||||
@ -928,7 +928,7 @@ M.core_filepicker.init = function(Y, options) {
|
||||
toolbar.appendChild(refresh);
|
||||
}
|
||||
if(!r.nologin) {
|
||||
var html = '<a href="###"><img src="'+M.util.image_url('a/logout')+'" /> '+mstr.repository.logout+'</a>';
|
||||
var html = '<a href="###"><img src="'+M.util.image_url('a/logout')+'" /> '+M.str.repository.logout+'</a>';
|
||||
var logout = Y.Node.create(html);
|
||||
logout.on('click', function() {
|
||||
this.request({
|
||||
@ -949,14 +949,14 @@ M.core_filepicker.init = function(Y, options) {
|
||||
var mgr = document.createElement('A');
|
||||
mgr.href = r.manage;
|
||||
mgr.target = "_blank";
|
||||
mgr.innerHTML = '<img src="'+M.util.image_url('a/setting')+'" /> '+mstr.repository.manageurl;
|
||||
mgr.innerHTML = '<img src="'+M.util.image_url('a/setting')+'" /> '+M.str.repository.manageurl;
|
||||
toolbar.appendChild(mgr);
|
||||
}
|
||||
if(r.help) {
|
||||
var help = document.createElement('A');
|
||||
help.href = r.help;
|
||||
help.target = "_blank";
|
||||
help.innerHTML = '<img src="'+M.util.image_url('a/help')+'" /> '+mstr.repository.help;
|
||||
help.innerHTML = '<img src="'+M.util.image_url('a/help')+'" /> '+M.str.repository.help;
|
||||
toolbar.appendChild(help);
|
||||
}
|
||||
|
||||
|
@ -32,13 +32,13 @@ function init_tag_autocomplete() {
|
||||
function ctags_checkinput(val) {
|
||||
var len = val.length;
|
||||
if (len < 2 || len > 50) {
|
||||
alert(mstr.block_tags.jserror1);
|
||||
alert(M.str.block_tags.jserror1);
|
||||
return false;
|
||||
} else if (val.indexOf("<") > 0) {
|
||||
alert(mstr.block_tags.jserror2);
|
||||
alert(M.str.block_tags.jserror2);
|
||||
return false;
|
||||
} else if (val.indexOf(">") > 0) {
|
||||
alert(mstr.block_tags.jserror2);
|
||||
alert(M.str.block_tags.jserror2);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user