From 7b9c99798cca779938bd5fa229e15ff100dfab0e Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 27 Oct 2006 20:34:40 +0000 Subject: [PATCH] Turn AJAX off for now at site level MDL-7254; merged from MOODLE_17_STABLE --- admin/settings/server.php | 1 + course/view.php | 4 ++-- lang/en_utf8/admin.php | 4 +++- user/edit.html | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/admin/settings/server.php b/admin/settings/server.php index ea00ad01dc..d2800296b1 100644 --- a/admin/settings/server.php +++ b/admin/settings/server.php @@ -88,6 +88,7 @@ $ADMIN->add('server', $temp); $temp = new admin_settingpage('debugging', get_string('debugging', 'admin')); $temp->add(new admin_setting_special_debug()); $temp->add(new admin_setting_special_perfdebug()); +$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0)); $ADMIN->add('server', $temp); diff --git a/course/view.php b/course/view.php index b77ca0277c..0c2f66d829 100644 --- a/course/view.php +++ b/course/view.php @@ -129,8 +129,8 @@ if (file_exists($ajaxformatfile)) { require_once($ajaxformatfile); - if ($USER->editing && !empty($USER->ajax) && $CFG->ajaxcapable) { - + if ($USER->editing && !empty($USER->ajax) && !empty($CFG->enableajax) && $CFG->ajaxcapable) { + if ($meta = require_js(array('yui_yahoo', 'yui_dom', 'yui_event', diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index c89a09660f..4ae9a32545 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -3,6 +3,9 @@ // begin {added with admin cleanup} + +$string['enableajax'] = 'Enable AJAX'; +$string['configenableajax'] = 'If you enable AJAX features users can disable them in their profile, otherwise AJAX is disabled for everybody.'; $string['autologinguests'] = 'Auto-login guests'; $string['search'] = 'Search'; $string['searchresults'] = 'Search Results'; @@ -367,7 +370,6 @@ $string['lang16notify'] = 'Moodle 1.6 and above allows you to install and update $string['langedit'] = 'Language editing'; $string['langpacks'] = 'Language packs'; $string['langimportsuccess'] = 'Language pack successfully upgraded'; -$string['langimport'] = 'Language import utility'; $string['langpackremoved'] = 'Language pack was uninstalled'; $string['langpackupdated'] = 'Language pack $a was successfully installed'; $string['langupdatecomplete'] = 'Language pack update completed'; diff --git a/user/edit.html b/user/edit.html index 136de87dda..887b296a7e 100644 --- a/user/edit.html +++ b/user/edit.html @@ -202,7 +202,7 @@ if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SI unset($choices); $choices["0"] = get_string("ajaxno"); $choices["1"] = get_string("ajaxyes"); - choose_from_menu ($choices, 'ajax', $user->ajax, "") ?> + choose_from_menu ($choices, 'ajax', $user->ajax, '', '', 0, false, empty($CFG->enableajax)) ?> -- 2.39.5