Skip to content

Commit b3b9b0b

Browse files
committed
Add more bulk interactions / add missing events
1 parent 4436591 commit b3b9b0b

File tree

5 files changed

+82
-3
lines changed

5 files changed

+82
-3
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace wcf\event\interaction\bulk\admin;
4+
5+
use wcf\event\IPsr14Event;
6+
use wcf\system\interaction\bulk\admin\UserOptionBulkInteractions;
7+
8+
/**
9+
* Indicates that the provider for user option bulk interactions is collecting interactions.
10+
*
11+
* @author Marcel Werk
12+
* @copyright 2001-2025 WoltLab GmbH
13+
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14+
* @since 6.2
15+
*/
16+
final class UserOptionBulkInteractionCollecting implements IPsr14Event
17+
{
18+
public function __construct(public readonly UserOptionBulkInteractions $provider) {}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace wcf\event\interaction\bulk\admin;
4+
5+
use wcf\event\IPsr14Event;
6+
use wcf\system\interaction\bulk\admin\UserRankBulkInteractions;
7+
8+
/**
9+
* Indicates that the provider for user rank bulk interactions is collecting interactions.
10+
*
11+
* @author Marcel Werk
12+
* @copyright 2001-2025 WoltLab GmbH
13+
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14+
* @since 6.2
15+
*/
16+
final class UserRankBulkInteractionCollecting implements IPsr14Event
17+
{
18+
public function __construct(public readonly UserRankBulkInteractions $provider) {}
19+
}

wcfsetup/install/files/lib/system/gridView/admin/UserRankGridView.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use wcf\system\gridView\renderer\NumberColumnRenderer;
2020
use wcf\system\gridView\renderer\ObjectIdColumnRenderer;
2121
use wcf\system\interaction\admin\UserRankInteractions;
22+
use wcf\system\interaction\bulk\admin\UserRankBulkInteractions;
2223
use wcf\system\interaction\Divider;
2324
use wcf\system\interaction\EditInteraction;
2425
use wcf\system\WCF;
@@ -114,6 +115,7 @@ public function render(mixed $value, DatabaseObject $row): string
114115
new EditInteraction(UserRankEditForm::class)
115116
]);
116117
$this->setInteractionProvider($provider);
118+
$this->setBulkInteractionProvider(new UserRankBulkInteractions());
117119
$this->addRowLink(new GridViewRowLink(UserRankEditForm::class));
118120
$this->setSortField('rankTitle');
119121
}

wcfsetup/install/files/lib/system/interaction/bulk/admin/UserOptionBulkInteractions.class.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use wcf\data\user\option\UserOption;
66
use wcf\data\user\option\UserOptionList;
7+
use wcf\event\interaction\bulk\admin\UserOptionBulkInteractionCollecting;
8+
use wcf\system\event\EventHandler;
79
use wcf\system\interaction\bulk\AbstractBulkInteractionProvider;
810
use wcf\system\interaction\bulk\BulkDeleteInteraction;
911

@@ -23,9 +25,9 @@ public function __construct()
2325
new BulkDeleteInteraction('core/users/options/%s', static fn(UserOption $object) => $object->canDelete()),
2426
]);
2527

26-
/*EventHandler::getInstance()->fire(
27-
new UserOptionInteractionCollecting($this)
28-
);*/
28+
EventHandler::getInstance()->fire(
29+
new UserOptionBulkInteractionCollecting($this)
30+
);
2931
}
3032

3133
#[\Override]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace wcf\system\interaction\bulk\admin;
4+
5+
use wcf\data\user\rank\UserRankList;
6+
use wcf\event\interaction\bulk\admin\UserRankBulkInteractionCollecting;
7+
use wcf\system\event\EventHandler;
8+
use wcf\system\interaction\bulk\AbstractBulkInteractionProvider;
9+
use wcf\system\interaction\bulk\BulkDeleteInteraction;
10+
11+
/**
12+
* Bulk interaction provider for user ranks.
13+
*
14+
* @author Marcel Werk
15+
* @copyright 2001-2025 WoltLab GmbH
16+
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
17+
* @since 6.2
18+
*/
19+
final class UserRankBulkInteractions extends AbstractBulkInteractionProvider
20+
{
21+
public function __construct()
22+
{
23+
$this->addInteractions([
24+
new BulkDeleteInteraction('core/users/ranks/%s'),
25+
]);
26+
27+
EventHandler::getInstance()->fire(
28+
new UserRankBulkInteractionCollecting($this)
29+
);
30+
}
31+
32+
#[\Override]
33+
public function getObjectListClassName(): string
34+
{
35+
return UserRankList::class;
36+
}
37+
}

0 commit comments

Comments
 (0)