MDL-25072 themes may disable ajax course edit

This commit is contained in:
Petr Skoda
2010-11-09 01:28:43 +00:00
parent f7efad4bc6
commit cdfb6ba850
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -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) {