flarum-msteams-webhook/extend.php

38 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
use Flarum\Extend;
use SbpJm\FlarumMSTeamsWebhook\Console\TestTeamsUserCommand;
use SbpJm\FlarumMSTeamsWebhook\Listener\MirrorAlertsToTeams;
use SbpJm\FlarumMSTeamsWebhook\Notification\TeamsNotificationDriver;
return [
(new Extend\Locales(__DIR__ . '/locale')),
// Admin UI (Settings etc.)
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
// Forum UI (User notification settings Teams checkbox)
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js'),
// CLI test command
(new Extend\Console())
->command(TestTeamsUserCommand::class),
// Notification hooks
(new Extend\Notification())
->beforeSending(MirrorAlertsToTeams::class)
->driver('teams', TeamsNotificationDriver::class, []),
// Deine bisherigen Preferences (SettingsPage-Toggles)
(new Extend\User())
->registerPreference('sbp-jm-msteams.enabled', 'boolval', false)
->registerPreference('sbp-jm-msteams.types.newPost', 'boolval', false)
->registerPreference('sbp-jm-msteams.types.postMentioned', 'boolval', false)
->registerPreference('sbp-jm-msteams.types.userMentioned', 'boolval', false),
];