framework/extensions/sticky/bootstrap.php

31 lines
973 B
PHP
Raw Normal View History

2015-05-07 20:56:02 +08:00
<?php
2015-09-04 11:00:25 +08:00
/*
* 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;
use Flarum\Sticky\Listener;
use Illuminate\Contracts\Events\Dispatcher;
2015-05-07 20:56:02 +08:00
return [
(new Extend\Assets('forum'))
2018-01-22 04:10:26 +08:00
->asset(__DIR__.'/js/forum/dist/extension.js')
->asset(__DIR__.'/less/forum/extension.less')
->bootstrapper('flarum/sticky/main'),
(new Extend\Assets('admin'))
->asset(__DIR__.'/js/admin/dist/extension.js')
->bootstrapper('flarum/sticky/main'),
function (Dispatcher $events) {
$events->subscribe(Listener\AddApiAttributes::class);
$events->subscribe(Listener\CreatePostWhenDiscussionIsStickied::class);
$events->subscribe(Listener\PinStickiedDiscussionsToTop::class);
$events->subscribe(Listener\SaveStickyToDatabase::class);
},
];