Skip to content

Commit 19be310

Browse files
committed
Add bulk interactions for captcha question grid view
1 parent ebc818f commit 19be310

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace wcf\event\interaction\bulk\admin;
4+
5+
use wcf\event\IPsr14Event;
6+
use wcf\system\interaction\bulk\admin\CaptchaQuestionBulkInteractions;
7+
8+
/**
9+
* Indicates that the provider for captcha question bulk interactions is collecting interactions.
10+
*
11+
* @author Olaf Braun
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 CaptchaQuestionBulkInteractionCollecting implements IPsr14Event
17+
{
18+
public function __construct(public readonly CaptchaQuestionBulkInteractions $provider)
19+
{
20+
}
21+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use wcf\system\gridView\GridViewRowLink;
1515
use wcf\system\gridView\renderer\ObjectIdColumnRenderer;
1616
use wcf\system\interaction\admin\CaptchaQuestionInteractions;
17+
use wcf\system\interaction\bulk\admin\CaptchaQuestionBulkInteractions;
1718
use wcf\system\interaction\ToggleInteraction;
1819
use wcf\system\WCF;
1920

@@ -55,6 +56,7 @@ public function __construct()
5556

5657
$interaction = new CaptchaQuestionInteractions();
5758
$this->setInteractionProvider($interaction);
59+
$this->setBulkInteractionProvider(new CaptchaQuestionBulkInteractions());
5860

5961
$this->addQuickInteraction(
6062
new ToggleInteraction('enable', 'core/captchas/questions/%s/enable', 'core/captchas/questions/%s/disable')
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\captcha\question\CaptchaQuestionList;
6+
use wcf\event\interaction\bulk\admin\CaptchaQuestionBulkInteractionCollecting;
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 captcha questions.
13+
*
14+
* @author Olaf Braun
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 CaptchaQuestionBulkInteractions extends AbstractBulkInteractionProvider
20+
{
21+
public function __construct()
22+
{
23+
$this->addInteractions([
24+
new BulkDeleteInteraction('core/captchas/questions/%s'),
25+
]);
26+
27+
EventHandler::getInstance()->fire(
28+
new CaptchaQuestionBulkInteractionCollecting($this)
29+
);
30+
}
31+
32+
#[\Override]
33+
public function getObjectListClassName(): string
34+
{
35+
return CaptchaQuestionList::class;
36+
}
37+
}

0 commit comments

Comments
 (0)