Changed course formats to use the new ajaxenabled() so that only tested browsers are enabled. MDL-8417

This commit is contained in:
moodler
2007-03-01 02:39:45 +00:00
parent 8e4e1d73bd
commit 9e0c47a5bc
3 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -5,5 +5,6 @@
$CFG->ajaxcapable = true;
$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
?>
?>
+2 -1
View File
@@ -5,5 +5,6 @@
$CFG->ajaxcapable = true;
$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
?>
?>
+9 -5
View File
@@ -121,16 +121,20 @@
// AJAX-capable course format?
$CFG->useajax = false;
$CFG->useajax = false;
$ajaxformatfile = $CFG->dirroot.'/course/format/'.$course->format.'/ajax.php';
$bodytags = '';
if (file_exists($ajaxformatfile)) {
if (file_exists($ajaxformatfile)) { // Needs to exist otherwise no AJAX by default
$CFG->ajaxcapable = false; // May be overridden later by ajaxformatfile
$CFG->ajaxtestedbrowsers = array(); // May be overridden later by ajaxformatfile
require_once($ajaxformatfile);
if ($USER->editing && !empty($USER->ajax) && !empty($CFG->enableajax) && $CFG->ajaxcapable) {
if (!empty($USER->editing) && $CFG->ajaxcapable) { // Course-based switches
if (ajaxenabled()) {
if (ajaxenabled($CFG->ajaxtestedbrowsers)) { // rowser, user and site-based switches
require_js(array('yui_yahoo',
'yui_dom',
@@ -216,4 +220,4 @@
print_footer(NULL, $course);
?>
?>