SCORM MDL-31397 - add slashes to js string

This commit is contained in:
Dan Marsden 2012-02-01 09:40:48 +13:00
parent ad5202771a
commit 731882b52d

View file

@ -70,11 +70,11 @@ function toggleLog () {
if (getLoggingActive() == "A") { if (getLoggingActive() == "A") {
AppendToLog("Moodle Logging Deactivated", 0); AppendToLog("Moodle Logging Deactivated", 0);
setLoggingActive('N'); setLoggingActive('N');
logButton.innerHTML = '--><?php print_string('scormloggingoff', 'scorm') ?>'; logButton.innerHTML = '--><?php echo addslashes_js(get_string('scormloggingoff', 'scorm')); ?>';
} else { } else {
setLoggingActive('A'); setLoggingActive('A');
AppendToLog("Moodle Logging Activated", 0); AppendToLog("Moodle Logging Activated", 0);
logButton.innerHTML = '<?php print_string('scormloggingon', 'scorm') ?>'; logButton.innerHTML = '<?php echo addslashes_js(get_string('scormloggingon', 'scorm')); ?>';
logPopUpWindow.focus(); logPopUpWindow.focus();
} }
} }
@ -747,9 +747,9 @@ logButton.id = 'mod-scorm-log-toggle';
logButton.name = 'logToggle'; logButton.name = 'logToggle';
logButton.href = 'javascript:toggleLog();'; logButton.href = 'javascript:toggleLog();';
if (getLoggingActive() == "A") { if (getLoggingActive() == "A") {
logButton.innerHTML = '<?php print_string('scormloggingon', 'scorm') ?>'; logButton.innerHTML = '<?php echo addslashes_js(get_string('scormloggingon', 'scorm')); ?>';
} else { } else {
logButton.innerHTML = '<?php print_string('scormloggingoff', 'scorm') ?>'; logButton.innerHTML = '<?php echo addslashes_js(get_string('scormloggingoff', 'scorm')); ?>';
} }
var content = safeGetElement(document, 'scormpage'); var content = safeGetElement(document, 'scormpage');
content.insertBefore(logButton, content.firstChild); content.insertBefore(logButton, content.firstChild);