Merge pull request #195 from catalyst/issue194

Add SVG support when building static page
This commit is contained in:
golenkovm
2020-04-20 11:36:15 +10:00
committed by GitHub
2 changed files with 15 additions and 0 deletions

View File

@@ -53,6 +53,11 @@ class infopage {
* @param array $params Parameters to use or null to get from Moodle API (request).
*/
public function __construct(array $params = null) {
global $CFG;
// Enable SVG support here to make sure all SVG files
// used in the current theme are served properly.
$CFG->svgicons = true;
if (is_null($params)) {
$params = [
'id' => optional_param('id', null, PARAM_INT),

View File

@@ -106,4 +106,14 @@ class infopagecontroller_test extends auth_outage_base_testcase {
$output = $info->get_output();
self::assertContains('auth_outage_info', $output);
}
/**
* Tests the constructor enables SVG support.
*/
public function test_svgicons_is_true() {
global $CFG;
$CFG->svgicons = false;
new infopage();
self::assertTrue($CFG->svgicons);
}
}