mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 23:29:09 +08:00
Allow extension icon styles to reference assets
Example usage: "icon": { "backgroundImage": "url('{$assets}/icon.svg')" }
This commit is contained in:
parent
ef2cc9b0cd
commit
b4cb5a11da
|
@ -44,6 +44,10 @@ class ExtensionManager
|
|||
if (file_exists($manifest = $extensionsDir . '/' . $dir . '/composer.json')) {
|
||||
$extensions[$dir] = json_decode(file_get_contents($manifest), true);
|
||||
|
||||
foreach ($extensions[$dir]['extra']['flarum-extension']['icon'] as &$style) {
|
||||
$style = str_replace('{$assets}', Core::url().'/extensions/'.$dir.'/assets', $style);
|
||||
}
|
||||
|
||||
foreach ($installed as $package) {
|
||||
if ($package['name'] === $extensions[$dir]['name']) {
|
||||
$extensions[$dir]['version'] = $package['version'];
|
||||
|
|
Loading…
Reference in New Issue
Block a user