A few easy files in lib.
$filters = explode(",", $CFG->textfilters);
if (in_array('filter/mediaplugin', $filters)) {
// this script is needed by most media filter plugins.
- $ufo = "\n".'<script type="text/javascript" src="'.$CFG->wwwroot.'/lib/ufo.js"></script>'."\n";
+ $ufo = get_require_js_code(array($CFG->wwwroot . '/lib/ufo.js'));
} else {
$ufo = '';
}
if (get_user_preferences('message_showmessagewindow', 1) == 1) {
if ($DB->count_records_select('message', 'useridto = ? AND timecreated > ?', array($USER->id, $USER->message_lastpopup))) {
$USER->message_lastpopup = time();
- return '<script type="text/javascript">'."\n//<![CDATA[\n openpopup('/message/index.php', 'message',
- 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0);\n//]]>\n</script>";
+ return print_js_call('openpopup', array('/message/index.php', 'message',
+ 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500',
+ 0), true);
}
}
}
$strgetanothercaptcha = get_string('getanothercaptcha', 'auth');
$strgetanaudiocaptcha = get_string('getanaudiocaptcha', 'auth');
$strgetanimagecaptcha = get_string('getanimagecaptcha', 'auth');
-
- $return = '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
- <noscript>
+
+ $return = get_require_js_code(array($server . '/challenge?k=' . $pubkey . $errorpart));
+ $return .= '<noscript>
<div id="recaptcha_widget_noscript">
<div id="recaptcha_image_noscript"><img src="' . $image_url . '" alt="reCAPTCHA"/></div>';
-
+
if ($error == 'incorrect-captcha-sol') {
$return .= '<div class="recaptcha_only_if_incorrect_sol" style="color:red">' . $strincorrectpleasetryagain . '</div>';
}