Skip to content

Commit 2553fc4

Browse files
committed
Unify bulk interactions with normal interactions
1 parent acadf0f commit 2553fc4

File tree

5 files changed

+65
-7
lines changed

5 files changed

+65
-7
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace wcf\system\interaction\bulk;
4+
5+
use wcf\system\interaction\InteractionConfirmationType;
6+
7+
/**
8+
* Represents a disable interaction.
9+
*
10+
* @author Marcel Werk
11+
* @copyright 2001-2025 WoltLab GmbH
12+
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13+
* @since 6.2
14+
*/
15+
class BulkDisableInteraction extends BulkRpcInteraction
16+
{
17+
public function __construct(
18+
string $endpoint,
19+
?\Closure $isAvailableCallback = null
20+
) {
21+
parent::__construct(
22+
'disable',
23+
$endpoint,
24+
'wcf.global.button.disable',
25+
InteractionConfirmationType::Disable,
26+
isAvailableCallback: $isAvailableCallback
27+
);
28+
}
29+
}

wcfsetup/install/files/lib/system/interaction/bulk/BulkTrashInteraction.class.php renamed to wcfsetup/install/files/lib/system/interaction/bulk/BulkSoftDeleteInteraction.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
use wcf\system\interaction\InteractionConfirmationType;
66

77
/**
8-
* Represents a bulk trash interaction.
8+
* Represents a bulk soft-delete interaction.
99
*
1010
* @author Olaf Braun
1111
* @copyright 2001-2025 WoltLab GmbH
1212
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
1313
* @since 6.2
1414
*/
15-
class BulkTrashInteraction extends BulkRpcInteraction
15+
class BulkSoftDeleteInteraction extends BulkRpcInteraction
1616
{
1717
public function __construct(
1818
string $endpoint,
1919
?\Closure $isAvailableCallback = null
2020
) {
2121
parent::__construct(
22-
'trash',
22+
'soft-delete',
2323
$endpoint,
2424
'wcf.global.button.trash',
2525
InteractionConfirmationType::Custom,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace wcf\system\interaction\bulk;
4+
5+
use wcf\system\interaction\InteractionConfirmationType;
6+
7+
/**
8+
* Represents a bulk soft-delete interaction that allows the user to enter a reason.
9+
*
10+
* @author Marcel Werk
11+
* @copyright 2001-2025 WoltLab GmbH
12+
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13+
* @since 6.2
14+
*/
15+
class BulkSoftDeleteWithReasonInteraction extends BulkRpcInteraction
16+
{
17+
public function __construct(
18+
string $endpoint,
19+
?\Closure $isAvailableCallback = null
20+
) {
21+
parent::__construct(
22+
'soft-delete',
23+
$endpoint,
24+
'wcf.global.button.trash',
25+
InteractionConfirmationType::SoftDeleteWithReason,
26+
isAvailableCallback: $isAvailableCallback
27+
);
28+
}
29+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use wcf\system\interaction\bulk\BulkFormBuilderDialogInteraction;
1414
use wcf\system\interaction\bulk\BulkRestoreInteraction;
1515
use wcf\system\interaction\bulk\BulkRpcInteraction;
16-
use wcf\system\interaction\bulk\BulkTrashInteraction;
16+
use wcf\system\interaction\bulk\BulkSoftDeleteInteraction;
1717
use wcf\system\interaction\InteractionConfirmationType;
1818

1919
/**
@@ -29,7 +29,7 @@ final class ArticleBulkInteractions extends AbstractBulkInteractionProvider
2929
public function __construct()
3030
{
3131
$this->addInteractions([
32-
new BulkTrashInteraction('core/articles/%s/trash', function (ViewableArticle $article): bool {
32+
new BulkSoftDeleteInteraction('core/articles/%s/soft-delete', function (ViewableArticle $article): bool {
3333
if (!$article->canDelete()) {
3434
return false;
3535
}

wcfsetup/install/files/lib/system/interaction/bulk/user/ArticleBulkInteractions.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use wcf\system\interaction\bulk\BulkDeleteInteraction;
1212
use wcf\system\interaction\bulk\BulkRestoreInteraction;
1313
use wcf\system\interaction\bulk\BulkRpcInteraction;
14-
use wcf\system\interaction\bulk\BulkTrashInteraction;
14+
use wcf\system\interaction\bulk\BulkSoftDeleteInteraction;
1515
use wcf\system\interaction\InteractionConfirmationType;
1616
use wcf\system\WCF;
1717

@@ -32,7 +32,7 @@ public function __construct()
3232
}
3333

3434
$this->addInteractions([
35-
new BulkTrashInteraction('core/articles/%s/trash', function (ViewableArticle $article): bool {
35+
new BulkSoftDeleteInteraction('core/articles/%s/soft-delete', function (ViewableArticle $article): bool {
3636
if (!$article->canDelete()) {
3737
return false;
3838
}

0 commit comments

Comments
 (0)