From 7aaed669018c5c4424d10bd0ea0d7df45f64db9c Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Sat, 5 May 2012 10:56:06 +0800 Subject: [PATCH 1/2] MDL-32509 course: remove enablecourseajax setting We just have the single enableajax setting --- admin/settings/appearance.php | 2 -- course/lib.php | 3 +-- course/rest.php | 4 ---- lang/en/admin.php | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 67d824af0f7..84a4831c5d1 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -142,8 +142,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1); $setting->set_updatedcallback('js_reset_all_caches'); $temp->add($setting); - $temp->add(new admin_setting_configcheckbox('enablecourseajax', new lang_string('enablecourseajax', 'admin'), - new lang_string('enablecourseajax_desc', 'admin'), 1)); $ADMIN->add('appearance', $temp); // link to tag management interface diff --git a/course/lib.php b/course/lib.php index 5b7f13a0b05..262582f4c5c 100644 --- a/course/lib.php +++ b/course/lib.php @@ -4414,8 +4414,7 @@ function include_course_ajax($course, $modules = array(), $config = null) { // Ensure that ajax should be included $courseformatajaxsupport = course_format_ajax_support($course->format); - if (!$CFG->enablecourseajax - || !$PAGE->theme->enablecourseajax + if (!$PAGE->theme->enablecourseajax || !$CFG->enableajax || empty($USER->editing) || !$PAGE->user_is_editing() diff --git a/course/rest.php b/course/rest.php index 1fec1fc51d8..8ec14e6b467 100644 --- a/course/rest.php +++ b/course/rest.php @@ -48,10 +48,6 @@ $PAGE->set_url('/course/rest.php', array('courseId'=>$courseid,'class'=>$class)) //NOTE: when making any changes here please make sure it is using the same access control as course/mod.php !! -if (empty($CFG->enablecourseajax)) { - throw new moodle_exception('Course AJAX not allowed'); -} - $course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); // Check user is logged in and set contexts if we are dealing with resource if (in_array($class, array('resource'))) { diff --git a/lang/en/admin.php b/lang/en/admin.php index 6af4828d2be..756520e2769 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -464,8 +464,6 @@ $string['emptysettingvalue'] = 'Empty'; $string['enableajax'] = 'Enable AJAX'; $string['enablecalendarexport'] = 'Enable calendar export'; $string['enablecomments'] = 'Enable comments'; -$string['enablecourseajax'] = 'Enable AJAX course editing'; -$string['enablecourseajax_desc'] = 'Allow AJAX when editing main course pages. Note that the course format and the theme must support AJAX editing and the user has to enable AJAX in their profiles, too.'; $string['enablecourserequests'] = 'Enable course requests'; $string['enablecssoptimiser'] = 'Enable CSS optimiser'; $string['enablecssoptimiser_desc'] = 'When enabled CSS will be run through an optimisation process before being cached. The optimiser processes the CSS removing duplicate rules and styles, as well as white space removeable and reformatting. Please note turning this on at the same time as theme designer mode is aweful for performance but will help theme designers create optimised CSS.'; From 9fa74379dc5eebf1f384fb9b23e44903f3894e67 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Sat, 5 May 2012 10:58:36 +0800 Subject: [PATCH 2/2] MDL-32509 enablecourseajax: remove setting from DB --- lib/db/upgrade.php | 8 ++++++++ version.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 0bef6573dfe..628764af58f 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -478,5 +478,13 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012050300.05); } + if ($oldversion < 2012050400.01) { + + // Clean up removed admin setting. + unset_config('enablecourseajax'); + + upgrade_main_savepoint(true, 2012050400.01); + } + return true; } diff --git a/version.php b/version.php index 1364c3f8227..ba0d7c3b616 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012050400.00; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012050400.01; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes