mirror of
https://github.com/flarum/core.git
synced 2025-08-18 06:11:23 +02:00
Use new event name
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace Flarum\Tags\Listener;
|
namespace Flarum\Tags\Listener;
|
||||||
|
|
||||||
use Flarum\Event\ConfigureClientView;
|
use Flarum\Event\ConfigureWebApp;
|
||||||
use Flarum\Event\ConfigureForumRoutes;
|
use Flarum\Event\ConfigureForumRoutes;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
|
||||||
@@ -21,38 +21,38 @@ class AddClientAssets
|
|||||||
*/
|
*/
|
||||||
public function subscribe(Dispatcher $events)
|
public function subscribe(Dispatcher $events)
|
||||||
{
|
{
|
||||||
$events->listen(ConfigureClientView::class, [$this, 'addAssets']);
|
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
|
||||||
$events->listen(ConfigureForumRoutes::class, [$this, 'addRoutes']);
|
$events->listen(ConfigureForumRoutes::class, [$this, 'addRoutes']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ConfigureClientView $event
|
* @param ConfigureWebApp $app
|
||||||
*/
|
*/
|
||||||
public function addAssets(ConfigureClientView $event)
|
public function addAssets(ConfigureWebApp $app)
|
||||||
{
|
{
|
||||||
if ($event->isForum()) {
|
if ($app->isForum()) {
|
||||||
$event->addAssets([
|
$app->addAssets([
|
||||||
__DIR__.'/../../js/forum/dist/extension.js',
|
__DIR__.'/../../js/forum/dist/extension.js',
|
||||||
__DIR__.'/../../less/forum/extension.less'
|
__DIR__.'/../../less/forum/extension.less'
|
||||||
]);
|
]);
|
||||||
$event->addBootstrapper('flarum/tags/main');
|
$app->addBootstrapper('flarum/tags/main');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($event->isAdmin()) {
|
if ($app->isAdmin()) {
|
||||||
$event->addAssets([
|
$app->addAssets([
|
||||||
__DIR__.'/../../js/admin/dist/extension.js',
|
__DIR__.'/../../js/admin/dist/extension.js',
|
||||||
__DIR__.'/../../less/admin/extension.less'
|
__DIR__.'/../../less/admin/extension.less'
|
||||||
]);
|
]);
|
||||||
$event->addBootstrapper('flarum/tags/main');
|
$app->addBootstrapper('flarum/tags/main');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ConfigureForumRoutes $event
|
* @param ConfigureForumRoutes $routes
|
||||||
*/
|
*/
|
||||||
public function addRoutes(ConfigureForumRoutes $event)
|
public function addRoutes(ConfigureForumRoutes $routes)
|
||||||
{
|
{
|
||||||
$event->get('/t/{slug}', 'tag');
|
$routes->get('/t/{slug}', 'tag');
|
||||||
$event->get('/tags', 'tags');
|
$routes->get('/tags', 'tags');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user