Issue #22 - Split maintenance.php into preview.php and file.php

This commit is contained in:
Daniel Thee Roperto
2016-11-09 16:21:46 +11:00
parent afd17994fe
commit ce2da24b1b
5 changed files with 112 additions and 85 deletions

View File

@@ -132,12 +132,14 @@ class maintenance_static_page {
*/
public function get_resources_folder() {
global $CFG;
// If you change the path, also change file auth/outage/maintenance.php as it does not use this reference.
// If you change the path, also change file auth/outage/file.php as it does not use this reference.
$dir = $CFG->dataroot.'/auth_outage/climaintenance';
if ($this->preview) {
return $CFG->dataroot.'/auth_outage/climaintenance/preview';
} else {
return $CFG->dataroot.'/auth_outage/climaintenance';
$dir = $dir.'/preview';
}
return $dir;
}
/**
@@ -319,7 +321,7 @@ class maintenance_static_page {
if ($this->preview) {
$filename = 'preview/'.$filename;
}
$url = (string)new moodle_url('/auth/outage/maintenance.php', ['file' => $filename]);
$url = (string)new moodle_url('/auth/outage/file.php', ['file' => $filename]);
return $url;
}
}