MDL-66568 core_output: Return built theme CSS

This commit is contained in:
Andrew Nicols 2020-06-15 10:34:40 +08:00
parent a2b286ce17
commit 868c7558f8

View File

@ -179,12 +179,13 @@ function theme_get_css_filename($themename, $globalrevision, $themerevision, $di
* @param theme_config[] $themeconfigs An array of theme_config instances.
* @param array $directions Must be a subset of ['rtl', 'ltr'].
* @param bool $cache Should the generated files be stored in local cache.
* @return array The built theme content in a multi-dimensional array of name => direction => content
*/
function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'ltr'], $cache = true) {
function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'ltr'], $cache = true): array {
global $CFG;
if (empty($themeconfigs)) {
return;
return [];
}
require_once("{$CFG->libdir}/csslib.php");
@ -212,7 +213,7 @@ function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'l
css_store_css($themeconfig, $filename, $themecss[$direction]);
}
}
$themescss[] = $themecss;
$themescss[$themeconfig->name] = $themecss;
if ($cache) {
// Only update the theme revision after we've successfully created the