mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:39:40 +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
8a83d01bba
commit
76e855246c
@ -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…
x
Reference in New Issue
Block a user