-
Bug
-
Resolution: Fixed
-
Major
-
2.2, 2.7
-
MOODLE_22_STABLE, MOODLE_27_STABLE
-
MOODLE_27_STABLE
-
MDL-33099-master -
The ajaxenabled function in lib/ajax/ajaxlib.php is thoroughly outdated and IMHO is no longer required.
It is used in a few places:
- course/view.php
- group/index.php
- lib/moodlelib.php (to determine whether the user is using firefox version 2.0 or above for rotated text)
- tag/edit.php
Most of this function is checking browser versions against hardcoded numbers which haven't been updated in five years. The remainder checks:
- $CFG->enableajax (fair enough)
- $USER->ajax - no longer used and only appears in the unit test for this file
- isloggedin() - because apparently you can't use javascript if you aren't logged in
We should remove this function and update the places it's in use to use appropriate JS or alternative checks such as course/lib.php::course_ajax_enabled().
We should also probably split out the $CFG->enableajax test in course_ajax_enabled into lib/moodlelib.php::ajax_enabled().