MDL-25072 themes may disable ajax course edit
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+6
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user