mirror of
https://github.com/flarum/core.git
synced 2025-06-12 01:21:06 +02: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:
@ -3,6 +3,7 @@
|
|||||||
use Flarum\Support\ClientAction;
|
use Flarum\Support\ClientAction;
|
||||||
use Flarum\Support\ClientView;
|
use Flarum\Support\ClientView;
|
||||||
use Flarum\Forum\Actions\ClientAction as ForumClientAction;
|
use Flarum\Forum\Actions\ClientAction as ForumClientAction;
|
||||||
|
use Flarum\Admin\Actions\ClientAction as AdminClientAction;
|
||||||
|
|
||||||
class BuildClientView
|
class BuildClientView
|
||||||
{
|
{
|
||||||
@ -54,4 +55,19 @@ class BuildClientView
|
|||||||
$this->keys[] = $key;
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user