Merged changes to use new ajaxenabled for MDL-8417

This commit is contained in:
moodler 2007-03-01 02:42:16 +00:00
parent 4309bd17dd
commit 61c1b4b573
3 changed files with 14 additions and 7 deletions

View File

@ -5,5 +5,6 @@
$CFG->ajaxcapable = true;
$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
?>

View File

@ -5,5 +5,6 @@
$CFG->ajaxcapable = true;
$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
?>

View File

@ -125,12 +125,17 @@
$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 && has_capability('moodle/course:manageactivities', $context)) {
// Course-based switches
if (ajaxenabled() && has_capability('moodle/course:manageactivities', $context)) {
if (ajaxenabled($CFG->ajaxtestedbrowsers)) { // Browser, user and site-based switches
require_js(array('yui_yahoo',
'yui_dom',