diff --git a/course/view.php b/course/view.php index e93701078c2..25bebe5d442 100644 --- a/course/view.php +++ b/course/view.php @@ -152,7 +152,7 @@ $ajaxformatfile = $CFG->dirroot.'/course/format/'.$course->format.'/ajax.php'; $bodytags = ''; - if (empty($CFG->disablecourseajax) and file_exists($ajaxformatfile)) { // Needs to exist otherwise no AJAX by default + if (empty($CFG->disablecourseajax) and file_exists($ajaxformatfile) and !$PAGE->theme->disablecourseajax) { // Needs to exist otherwise no AJAX by default // TODO: stop abusing CFG global here $CFG->ajaxcapable = false; // May be overridden later by ajaxformatfile diff --git a/lib/outputlib.php b/lib/outputlib.php index dce2607a409..5c6d29d8a39 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -333,6 +333,11 @@ class theme_config { */ public $hidefromselector = false; + /** + * Some themes may want to disable ajax course editing. + * @var bool + */ + public $disablecourseajax = false; /** * Instance of the renderer_factory implementation * we are using. Implementation detail. @@ -409,7 +414,7 @@ class theme_config { } $configurable = array('parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'javascripts', 'javascripts_footer', - 'parents_exclude_javascripts', 'layouts', 'resource_mp3player_colors', 'enable_dock', + 'parents_exclude_javascripts', 'layouts', 'resource_mp3player_colors', 'enable_dock', 'disablecourseajax', 'filter_mediaplugin_colors', 'rendererfactory', 'csspostprocess', 'editor_sheets', 'rarrow', 'larrow', 'hidefromselector'); foreach ($config as $key=>$value) {