MDL-12735 Make AJAX on by default, add option to disable AJAX course editing by default
This commit is contained in:
@@ -78,7 +78,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_settingpage('ajax', get_string('ajaxuse'));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('disablecourseajax', get_string('disablecourseajax', 'admin'), get_string('configdisablecourseajax', 'admin'),
|
||||
isset($CFG->disablecourseajax) ? 1 : empty($CFG->enableajax)));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// link to tag management interface
|
||||
|
||||
+6
-5
@@ -131,12 +131,13 @@
|
||||
|
||||
|
||||
// AJAX-capable course format?
|
||||
$CFG->useajax = false;
|
||||
$useajax = false;
|
||||
$ajaxformatfile = $CFG->dirroot.'/course/format/'.$course->format.'/ajax.php';
|
||||
$bodytags = '';
|
||||
|
||||
if (file_exists($ajaxformatfile)) { // Needs to exist otherwise no AJAX by default
|
||||
if (empty($CFG->disablecourseajax) and file_exists($ajaxformatfile)) { // Needs to exist otherwise no AJAX by default
|
||||
|
||||
// TODO: stop abusing CFG global here
|
||||
$CFG->ajaxcapable = false; // May be overridden later by ajaxformatfile
|
||||
$CFG->ajaxtestedbrowsers = array(); // May be overridden later by ajaxformatfile
|
||||
|
||||
@@ -173,12 +174,12 @@
|
||||
// function is called, since that function needs to set some
|
||||
// stuff in the javascriptportal object.
|
||||
$COURSE->javascriptportal = new jsportal();
|
||||
$CFG->useajax = true;
|
||||
$useajax = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$CFG->blocksdrag = $CFG->useajax; // this will add a new class to the header so we can style differently
|
||||
$CFG->blocksdrag = $useajax; // this will add a new class to the header so we can style differently
|
||||
|
||||
|
||||
$PAGE->print_header(get_string('course').': %fullname%', NULL, '', $bodytags);
|
||||
@@ -218,7 +219,7 @@
|
||||
|
||||
|
||||
// Use AJAX?
|
||||
if ($CFG->useajax && has_capability('moodle/course:manageactivities', $context)) {
|
||||
if ($useajax && has_capability('moodle/course:manageactivities', $context)) {
|
||||
// At the bottom because we want to process sections and activities
|
||||
// after the relevant html has been generated. We're forced to do this
|
||||
// because of the way in which lib/ajax/ajaxcourse.js is written.
|
||||
|
||||
@@ -96,6 +96,7 @@ $string['configeditorfontlist'] = 'Select the fonts that should appear in the ed
|
||||
$string['configeditordictionary'] = 'This value will be used if aspell doesn\'t have dictionary for users own language.';
|
||||
$string['configemoticons'] = 'Change the code on the left that relates to the name of the emoticon on the right. To add new emoticons, add a code and a name, then add an image as name.gif in /pix/s.';
|
||||
$string['configenableajax'] = 'This setting allows you to control the use of AJAX (advanced client/server interfaces using Javascript) across the whole site. With this setting enabled users can still make a choice in their profile, otherwise AJAX is disabled for everybody.';
|
||||
$string['configdisablecourseajax'] = 'Do not use AJAX when editing main course pages.';
|
||||
$string['configenablecourserequests'] = 'This will allow any user to request a course be created.';
|
||||
$string['configenableglobalsearch'] = 'This setting enables global text searching in resources and activities, it is not compatible with PHP 4.';
|
||||
$string['configenablegroupings'] = 'This setting enables groupings of groups.';
|
||||
@@ -276,6 +277,7 @@ $string['deleteuser'] = 'Delete user';
|
||||
$string['density'] = 'Density';
|
||||
$string['denyemailaddresses'] = 'Denied email domains';
|
||||
$string['digestmailtime'] = 'Hour to send digest emails';
|
||||
$string['disablecourseajax'] = 'Disable AJAX course editing';
|
||||
$string['disableuserimages'] = 'Disable User Profile Images';
|
||||
$string['displayloginfailures'] = 'Display login failures to';
|
||||
$string['docroot'] = 'Moodle Docs document root';
|
||||
|
||||
Reference in New Issue
Block a user