www.gusucode.com > Flarum中文优化论坛PHP源码程序 > FlarumChina-master/vendor/flarum/flarum-ext-auth-facebook/src/Listener/AddClientAssets.php
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Auth\Facebook\Listener; use Flarum\Event\ConfigureClientView; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets { /** * @param Dispatcher $events */ public function subscribe(Dispatcher $events) { $events->listen(ConfigureClientView::class, [$this, 'addAssets']); } /** * @param ConfigureClientView $event */ public function addAssets(ConfigureClientView $event) { if ($event->isForum()) { $event->addAssets([ __DIR__.'/../../js/forum/dist/extension.js', __DIR__.'/../../less/forum/extension.less' ]); $event->addBootstrapper('flarum/auth/facebook/main'); } if ($event->isAdmin()) { $event->addAssets([ __DIR__.'/../../js/admin/dist/extension.js' ]); $event->addBootstrapper('flarum/auth/facebook/main'); } } }