Skip to content

Commit 42911b2

Browse files
committed
bulk interaction
1 parent 38e2d86 commit 42911b2

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace wcf\event\interaction\bulk\admin;
4+
5+
use wcf\event\IPsr14Event;
6+
use wcf\system\interaction\bulk\admin\DiscordWebhookBulkInteractions;
7+
8+
final class DiscordWebhookBulkInteractionCollecting implements IPsr14Event
9+
{
10+
public function __construct(public readonly DiscordWebhookBulkInteractions $provider)
11+
{
12+
}
13+
}

files/lib/system/gridView/admin/DiscordWebhookGridView.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use wcf\system\gridView\renderer\DefaultColumnRenderer;
1616
use wcf\system\gridView\renderer\TimeColumnRenderer;
1717
use wcf\system\interaction\admin\DiscordWebhookInteractions;
18+
use wcf\system\interaction\bulk\admin\DiscordWebhookBulkInteractions;
1819
use wcf\system\WCF;
1920

2021
final class DiscordWebhookGridView extends AbstractGridView
@@ -89,6 +90,7 @@ public function render(mixed $value, mixed $context = null): string
8990

9091
$provider = new DiscordWebhookInteractions();
9192
$this->setInteractionProvider($provider);
93+
$this->setBulkInteractionProvider(new DiscordWebhookBulkInteractions());
9294

9395
$this->setSortField('webhookID');
9496
$this->setSortOrder('ASC');
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace wcf\system\interaction\bulk\admin;
4+
5+
use Override;
6+
use wcf\data\discord\webhook\DiscordWebhookList;
7+
use wcf\event\interaction\bulk\admin\DiscordWebhookBulkInteractionCollecting;
8+
use wcf\system\event\EventHandler;
9+
use wcf\system\interaction\bulk\AbstractBulkInteractionProvider;
10+
use wcf\system\interaction\bulk\BulkDeleteInteraction;
11+
12+
final class DiscordWebhookBulkInteractions extends AbstractBulkInteractionProvider
13+
{
14+
public function __construct()
15+
{
16+
$this->addInteractions([
17+
new BulkDeleteInteraction("hanashi/discord/webhook/%s"),
18+
]);
19+
20+
EventHandler::getInstance()->fire(
21+
new DiscordWebhookBulkInteractionCollecting($this)
22+
);
23+
}
24+
25+
#[Override]
26+
public function getObjectListClassName(): string
27+
{
28+
return DiscordWebhookList::class;
29+
}
30+
}

0 commit comments

Comments
 (0)