framework/extensions/lock/bootstrap.php

35 lines
1.1 KiB
PHP
Raw Normal View History

2015-07-28 15:35:55 +09:30
<?php
2015-09-04 12:32:04 +09:30
/*
* 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.
*/
use Flarum\Extend;
2015-10-11 16:15:07 +10:30
use Flarum\Lock\Access;
use Flarum\Lock\Listener;
use Illuminate\Contracts\Events\Dispatcher;
2015-07-28 15:35:55 +09:30
return [
(new Extend\Assets('forum'))
2018-01-21 21:09:37 +01:00
->asset(__DIR__.'/js/forum/dist/extension.js')
->asset(__DIR__.'/less/forum/extension.less')
->bootstrapper('flarum/lock/main'),
(new Extend\Assets('admin'))
->asset(__DIR__.'/js/admin/dist/extension.js')
->bootstrapper('flarum/lock/main'),
function (Dispatcher $events) {
$events->subscribe(Listener\AddDiscussionLockedAttributes::class);
$events->subscribe(Listener\AddLockedGambit::class);
$events->subscribe(Listener\CreatePostWhenDiscussionIsLocked::class);
$events->subscribe(Listener\SaveLockedToDatabase::class);
2015-10-11 16:15:07 +10:30
$events->subscribe(Access\DiscussionPolicy::class);
$events->subscribe(Access\PostPolicy::class);
},
];