mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 05:54:19 +02:00
MDL-66568 core_output: Return built theme CSS
This commit is contained in:
parent
a2b286ce17
commit
868c7558f8
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user