mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 14:04:17 +08:00
Allow for the addition of admin assets
I think the `BuildClientView` event should ultimately be split into two separate events for the forum/admin clients, but this is fine for now.
This commit is contained in:
parent
4e0cfdc1b2
commit
ba41c5313a
|
@ -3,6 +3,7 @@
|
|||
use Flarum\Support\ClientAction;
|
||||
use Flarum\Support\ClientView;
|
||||
use Flarum\Forum\Actions\ClientAction as ForumClientAction;
|
||||
use Flarum\Admin\Actions\ClientAction as AdminClientAction;
|
||||
|
||||
class BuildClientView
|
||||
{
|
||||
|
@ -54,4 +55,19 @@ class BuildClientView
|
|||
$this->keys[] = $key;
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
public function adminAssets($files)
|
||||
{
|
||||
if ($this->action instanceof AdminClientAction) {
|
||||
$this->view->getAssets()->addFiles((array) $files);
|
||||
}
|
||||
}
|
||||
|
||||
public function adminBootstrapper($bootstrapper)
|
||||
{
|
||||
if ($this->action instanceof AdminClientAction) {
|
||||
$this->view->addBootstrapper($bootstrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user