mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-04 10:14:13 +08:00
Preload ThemeImages svgs
- Send svg content on initial theme images call - Load and cache on Theme images call
This commit is contained in:
parent
b7860e4246
commit
6317b37830
3 changed files with 32 additions and 5 deletions
|
@ -114,7 +114,8 @@ class ThemeImageService
|
|||
{
|
||||
|
||||
$path = $this->buildPath($imagePath, $theme);
|
||||
$fullPath = $this->projectDir . '/public/' . $path;
|
||||
$basePath = $this->projectDir . '/public/';
|
||||
$fullPath = $basePath . $path;
|
||||
|
||||
$it = $this->themeImageFinder->find($fullPath);
|
||||
|
||||
|
@ -134,10 +135,16 @@ class ThemeImageService
|
|||
continue;
|
||||
}
|
||||
|
||||
$content = '';
|
||||
if ($extension === 'svg' && file_exists($file->getRealPath())) {
|
||||
$content = file_get_contents($file->getRealPath());
|
||||
}
|
||||
|
||||
$images[$name] = [
|
||||
'path' => $filePath,
|
||||
'name' => $name,
|
||||
'type' => $extension
|
||||
'type' => $extension,
|
||||
'content' => $content
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue