Added function addslashes_js() to make the javacript receive the strings correctly

This commit is contained in:
csantossaenz
2007-05-11 10:57:20 +00:00
parent 470be2688b
commit 555bfa16d0
+8 -2
View File
@@ -100,6 +100,10 @@
$strmenubar = get_string('menubar', 'scorm');
$strtoolbar = get_string('toolbar', 'scorm');
$strstatus = get_string('statusbar', 'scorm');
$strerrorlog = get_string('errorlogs','scorm');
$strvalidation = print_string('validation','scorm');
$strerrorlog = addslashes_js($strerrorlog);
$strvalidation = addslashes_js($strvalidation);
?>
<script type="text/javascript" src="<?php p($CFG->wwwroot) ?>/mod/scorm/request.js" ></script>
@@ -161,9 +165,11 @@
return false;
}
} else {
result = '<?php print_string('validation','scorm') ?>: '+ result + '\n';
//result = '<?php print_string('validation','scorm') ?>: '+ result + '\n';
result = '<?php echo $strvalidation ?>: '+ result + '\n';
if (errorlogs != '') {
result.concat('<?php print_string('errorlogs','scorm') ?>:\n'+errorlogs);
//result.concat('<?php print_string('errorlogs','scorm') ?>:\n'+errorlogs);
result = '<?php echo $strerrorlog ?>: '+ result + '\n';
}
alert(result);
return false;