diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 49fb7ad4d4d..1df0a092cbe 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -220,7 +220,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp $ADMIN->add('appearance', $temp); $temp = new admin_settingpage('ajax', new lang_string('ajaxuse')); - $temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1)); $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1); diff --git a/blocks/course_overview/renderer.php b/blocks/course_overview/renderer.php index fcde4f4597c..3efcd95f5e7 100644 --- a/blocks/course_overview/renderer.php +++ b/blocks/course_overview/renderer.php @@ -48,10 +48,7 @@ class block_course_overview_renderer extends plugin_renderer_base { // Intialise string/icon etc if user is editing and courses > 1 if ($this->page->user_is_editing() && (count($courses) > 1)) { $userediting = true; - // If ajaxenabled then include DND JS and replace link with move image. - if (ajaxenabled()) { - $this->page->requires->js_init_call('M.block_course_overview.add_handles'); - } + $this->page->requires->js_init_call('M.block_course_overview.add_handles'); // Check if course is moving $ismovingcourse = optional_param('movecourse', FALSE, PARAM_BOOL); diff --git a/course/format/formatlegacy.php b/course/format/formatlegacy.php index f353a4b5816..665f5833821 100644 --- a/course/format/formatlegacy.php +++ b/course/format/formatlegacy.php @@ -147,7 +147,6 @@ class format_legacy extends format_base { * * The returned object's property (boolean)capable indicates that * the course format supports Moodle course ajax features. - * The property (array)testedbrowsers can be used as a parameter for {@link ajaxenabled()}. * * @return stdClass */ @@ -162,9 +161,6 @@ class format_legacy extends format_base { if (isset($formatsupport->capable)) { $ajaxsupport->capable = $formatsupport->capable; } - if (is_array($formatsupport->testedbrowsers)) { - $ajaxsupport->testedbrowsers = $formatsupport->testedbrowsers; - } } return $ajaxsupport; } @@ -360,4 +356,4 @@ class format_legacy extends format_base { } return $this->update_format_options($data); } -} \ No newline at end of file +} diff --git a/course/format/lib.php b/course/format/lib.php index a68ce5ae500..af2a6c6b60a 100644 --- a/course/format/lib.php +++ b/course/format/lib.php @@ -353,7 +353,6 @@ abstract class format_base { * * The returned object's property (boolean)capable indicates that * the course format supports Moodle course ajax features. - * The property (array)testedbrowsers can be used as a parameter for {@link ajaxenabled()}. * * @return stdClass */ @@ -361,7 +360,6 @@ abstract class format_base { // no support by default $ajaxsupport = new stdClass(); $ajaxsupport->capable = false; - $ajaxsupport->testedbrowsers = array(); return $ajaxsupport; } diff --git a/course/format/topics/lib.php b/course/format/topics/lib.php index 71a04529ad7..7c1ee6ec589 100644 --- a/course/format/topics/lib.php +++ b/course/format/topics/lib.php @@ -115,14 +115,12 @@ class format_topics extends format_base { * * The returned object's property (boolean)capable indicates that * the course format supports Moodle course ajax features. - * The property (array)testedbrowsers can be used as a parameter for {@link ajaxenabled()}. * * @return stdClass */ public function supports_ajax() { $ajaxsupport = new stdClass(); $ajaxsupport->capable = true; - $ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0); return $ajaxsupport; } diff --git a/course/format/upgrade.txt b/course/format/upgrade.txt index f29a06e0681..3bc37eda9d3 100644 --- a/course/format/upgrade.txt +++ b/course/format/upgrade.txt @@ -2,6 +2,9 @@ This files describes API changes for course formats Overview of this plugin type at http://docs.moodle.org/dev/Course_formats +=== 2.7 === +* The ->testedbrowsers array no longer needs to be defined in supports_ajax(). + === 2.6 === * core_course_renderer::course_section_cm_edit_actions has two new optional arguments and now uses and action_menu component. diff --git a/course/format/weeks/lib.php b/course/format/weeks/lib.php index ded5ef0416f..e361deffaf3 100644 --- a/course/format/weeks/lib.php +++ b/course/format/weeks/lib.php @@ -122,14 +122,12 @@ class format_weeks extends format_base { * * The returned object's property (boolean)capable indicates that * the course format supports Moodle course ajax features. - * The property (array)testedbrowsers can be used as a parameter for {@link ajaxenabled()}. * * @return stdClass */ public function supports_ajax() { $ajaxsupport = new stdClass(); $ajaxsupport->capable = true; - $ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0); return $ajaxsupport; } diff --git a/course/lib.php b/course/lib.php index 1ae3e947027..1110236f2e2 100644 --- a/course/lib.php +++ b/course/lib.php @@ -2333,7 +2333,6 @@ function course_format_uses_sections($format) { * * The returned object's property (boolean)capable indicates that * the course format supports Moodle course ajax features. - * The property (array)testedbrowsers can be used as a parameter for {@see ajaxenabled()}. * * @param string $format * @return stdClass @@ -3119,11 +3118,6 @@ function course_page_type_list($pagetype, $parentcontext, $currentcontext) { function course_ajax_enabled($course) { global $CFG, $PAGE, $SITE; - // Ajax must be enabled globally - if (!$CFG->enableajax) { - return false; - } - // The user must be editing for AJAX to be included if (!$PAGE->user_is_editing()) { return false; diff --git a/course/view.php b/course/view.php index 16b2ca026c3..c5ec9d0216f 100644 --- a/course/view.php +++ b/course/view.php @@ -219,10 +219,8 @@ redirect($CFG->wwwroot .'/'); } - $ajaxenabled = ajaxenabled(); - $completion = new completion_info($course); - if ($completion->is_enabled() && $ajaxenabled) { + if ($completion->is_enabled()) { $PAGE->requires->string_for_js('completion-title-manual-y', 'completion'); $PAGE->requires->string_for_js('completion-title-manual-n', 'completion'); $PAGE->requires->string_for_js('completion-alt-manual-y', 'completion'); @@ -251,7 +249,7 @@ $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); - if ($completion->is_enabled() && $ajaxenabled) { + if ($completion->is_enabled()) { // This value tracks whether there has been a dynamic change to the page. // It is used so that if a user does this - (a) set some tickmarks, (b) // go to another page, (c) clicks Back button - the page will diff --git a/group/index.php b/group/index.php index 5e839183ab2..f3e7f37f6d3 100644 --- a/group/index.php +++ b/group/index.php @@ -152,20 +152,11 @@ $currenttab = 'groups'; require('tabs.php'); $disabled = 'disabled="disabled"'; -$ajaxenabled = ajaxenabled(); -if ($ajaxenabled) { - // Some buttons are enabled if single group selected - $showaddmembersform_disabled = $singlegroup ? '' : $disabled; - $showeditgroupsettingsform_disabled = $singlegroup ? '' : $disabled; - $deletegroup_disabled = count($groupids)>0 ? '' : $disabled; -} else { - // Do not disable buttons. The buttons work based on the selected group, - // which you can change without reloading the page, so it is not appropriate - // to disable them if no group is selected. - $showaddmembersform_disabled = ''; - $showeditgroupsettingsform_disabled = ''; - $deletegroup_disabled = ''; -} + +// Some buttons are enabled if single group selected. +$showaddmembersform_disabled = $singlegroup ? '' : $disabled; +$showeditgroupsettingsform_disabled = $singlegroup ? '' : $disabled; +$deletegroup_disabled = count($groupids) > 0 ? '' : $disabled; echo $OUTPUT->heading(format_string($course->shortname, true, array('context' => $context)) .' '.$strgroups, 3); echo '
'."\n"; @@ -179,11 +170,7 @@ echo ''."\n"; echo "\n"; echo '

'."\n"; -if ($ajaxenabled) { // TODO: move this to JS init! - $onchange = 'M.core_group.membersCombo.refreshMembers();'; -} else { - $onchange = ''; -} +$onchange = 'M.core_group.membersCombo.refreshMembers();'; echo '