|
45 | 45 | ->serializeToForum('shebaoting-money.extra_char_points', 'shebaoting-money.extra_char_points'), |
46 | 46 |
|
47 | 47 | (new Extend\Event()) |
48 | | - ->listen(Saving::class, [Listeners\GiveMoney::class, 'postWillBeSaved']) // 修改这里 |
| 48 | + ->listen(SavingPostEvent::class, [Listeners\GiveMoney::class, 'postWillBeSaved']) // 修改这里 |
49 | 49 | ->listen(Posted::class, [Listeners\GiveMoney::class, 'postWasPosted']) |
50 | 50 | ->listen(PostRestored::class, [Listeners\GiveMoney::class, 'postWasRestored']) |
51 | 51 | ->listen(PostHidden::class, [Listeners\GiveMoney::class, 'postWasHidden']) |
|
54 | 54 | ->listen(DiscussionRestored::class, [Listeners\GiveMoney::class, 'discussionWasRestored']) |
55 | 55 | ->listen(DiscussionHidden::class, [Listeners\GiveMoney::class, 'discussionWasHidden']) |
56 | 56 | ->listen(DiscussionDeleted::class, [Listeners\GiveMoney::class, 'discussionWasDeleted']) |
| 57 | + ->listen(Saving::class, [Listeners\GiveMoney::class, 'userWillBeSaved']) |
57 | 58 | ->listen(Registered::class, [Listeners\GiveMoney::class, 'userWasRegistered']) |
58 | 59 | ->listen(PostWasLiked::class, [Listeners\GiveMoney::class, 'postWasLiked']) |
59 | 60 | ->listen(PostWasUnliked::class, [Listeners\GiveMoney::class, 'postWasUnliked']), |
60 | 61 |
|
61 | 62 | (new Extend\Routes('api')) |
62 | 63 | ->get('/money-log', 'money.logs', UserMoneyLogsController::class) |
63 | 64 | ]; |
| 65 | + |
| 66 | +// $extend = [ |
| 67 | +// (new Extend\Frontend('forum')) |
| 68 | +// ->js(__DIR__ . '/js/dist/forum.js') |
| 69 | +// ->css(__DIR__ . '/less/forum.less') |
| 70 | +// ->route('/money-log', 'user.money-log'), |
| 71 | + |
| 72 | +// (new Extend\Frontend('admin')) |
| 73 | +// ->js(__DIR__ . '/js/dist/admin.js') |
| 74 | +// ->css(__DIR__ . '/less/admin.less'), |
| 75 | + |
| 76 | +// new Extend\Locales(__DIR__ . '/locale'), |
| 77 | + |
| 78 | +// (new Extend\ApiSerializer(UserSerializer::class)) |
| 79 | +// ->attributes(AddUserMoneyAttributes::class), |
| 80 | + |
| 81 | +// (new Extend\Settings()) |
| 82 | +// ->serializeToForum('shebaoting-money.moneyname', 'shebaoting-money.moneyname') |
| 83 | +// ->serializeToForum('shebaoting-money.level_names', 'shebaoting-money.level_names') |
| 84 | +// ->serializeToForum('shebaoting-money.money_scale', 'shebaoting-money.money_scale') |
| 85 | +// ->serializeToForum('shebaoting-money.noshowzero', 'shebaoting-money.noshowzero'), |
| 86 | + |
| 87 | +// (new Extend\Event()) |
| 88 | +// ->listen(SavingPost::class, [Listeners\GiveMoney::class, 'postWillBeSaved']) |
| 89 | +// ->listen(SavingDiscussion::class, [Listeners\GiveMoney::class, 'discussionWillBeSaved']) |
| 90 | +// ->listen(Posted::class, [Listeners\GiveMoney::class, 'postWasPosted']) |
| 91 | +// ->listen(PostRestored::class, [Listeners\GiveMoney::class, 'postWasRestored']) |
| 92 | +// ->listen(PostHidden::class, [Listeners\GiveMoney::class, 'postWasHidden']) |
| 93 | +// ->listen(PostDeleted::class, [Listeners\GiveMoney::class, 'postWasDeleted']) |
| 94 | +// ->listen(Started::class, [Listeners\GiveMoney::class, 'discussionWasStarted']) |
| 95 | +// ->listen(DiscussionRestored::class, [Listeners\GiveMoney::class, 'discussionWasRestored']) |
| 96 | +// ->listen(DiscussionHidden::class, [Listeners\GiveMoney::class, 'discussionWasHidden']) |
| 97 | +// ->listen(DiscussionDeleted::class, [Listeners\GiveMoney::class, 'discussionWasDeleted']) |
| 98 | +// ->listen(Saving::class, [Listeners\GiveMoney::class, 'userWillBeSaved']) |
| 99 | +// ->listen(Registered::class, [Listeners\GiveMoney::class, 'userWasRegistered']), |
| 100 | + |
| 101 | +// (new Extend\Routes('api')) |
| 102 | +// ->get('/money-log', 'money.logs', UserMoneyLogsController::class) |
| 103 | +// ]; |
| 104 | + |
| 105 | +// if (class_exists('Flarum\Likes\Event\PostWasLiked')) { |
| 106 | +// $extend[] = |
| 107 | +// (new Extend\Event()) |
| 108 | +// ->listen(PostWasLiked::class, [Listeners\GiveMoney::class, 'postWasLiked']) |
| 109 | +// ->listen(PostWasUnliked::class, [Listeners\GiveMoney::class, 'postWasUnliked']); |
| 110 | +// } |
| 111 | +// return $extend; |
0 commit comments