mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 16:41:44 +08:00
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
/*
|
||
|
* This file is part of flarum/nickname.
|
||
|
*
|
||
|
* Copyright (c) 2020 Flarum.
|
||
|
*
|
||
|
* For the full copyright and license information, please view the LICENSE.md
|
||
|
* file that was distributed with this source code.
|
||
|
*/
|
||
|
|
||
|
namespace Flarum\Nicknames;
|
||
|
|
||
|
use Flarum\Event\ConfigureUserGambits;
|
||
|
use Flarum\Extend;
|
||
|
use Flarum\User\Event\Saving;
|
||
|
use Flarum\User\User;
|
||
|
|
||
|
return [
|
||
|
(new Extend\Frontend('forum'))
|
||
|
->js(__DIR__.'/js/dist/forum.js')
|
||
|
->css(__DIR__.'/resources/less/forum.less'),
|
||
|
|
||
|
(new Extend\Frontend('admin'))
|
||
|
->js(__DIR__.'/js/dist/admin.js')
|
||
|
->css(__DIR__.'/resources/less/admin.less'),
|
||
|
|
||
|
(new Extend\User())
|
||
|
->displayNameDriver('nickname', NicknameDriver::class),
|
||
|
|
||
|
(new Extend\ModelUrl(User::class))
|
||
|
->addSlugDriver('idOnly', IdOnlyUserSlugDriver::class),
|
||
|
|
||
|
(new Extend\Event())
|
||
|
->listen(Saving::class, SaveNicknameToDatabase::class)
|
||
|
->listen(ConfigureUserGambits::class, SetUserNicknameGambit::class),
|
||
|
|
||
|
new Extend\Locales(__DIR__ . '/resources/locale'),
|
||
|
];
|