Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$request->getQueryParams(),
<<<'EOT'
array {
objectIDs: positive-int[]
ids: positive-int[]
}
EOT
);

if ($parameters['objectIDs'] === []) {
if ($parameters['ids'] === []) {
throw new IllegalLinkException();
}

Expand All @@ -62,7 +62,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
WHERE articleID = ?";
$statement = WCF::getDB()->prepare($sql);

foreach ($parameters['objectIDs'] as $articleID) {
foreach ($parameters['ids'] as $articleID) {
$statement->execute([$data['categoryID'], $articleID]);
}

Expand Down
12 changes: 6 additions & 6 deletions wcfsetup/install/files/lib/acp/action/TagSynonymAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$parameters = Helper::mapQueryParameters(
$request->getQueryParams(),
<<<'EOT'
array {
objectIDs: array<positive-int>
}
EOT,
array {
ids: array<positive-int>
}
EOT
);
} catch (MappingError) {
throw new IllegalLinkException();
}

if (\count($parameters['objectIDs']) < 2) {
if (\count($parameters['ids']) < 2) {
throw new IllegalLinkException();
}

$tagList = new TagList();
$tagList->setObjectIDs($parameters['objectIDs']);
$tagList->setObjectIDs($parameters['ids']);
$tagList->readObjects();

$form = $this->getForm($tagList->getObjects());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ public function handle(ServerRequestInterface $request): ResponseInterface
<<<'EOT'
array {
id?: positive-int,
objectIDs?: positive-int[]
ids?: positive-int[]
}
Comment thread
BurntimeX marked this conversation as resolved.
EOT
);

if (!isset($parameters['id']) && !isset($parameters['objectIDs'])) {
if (!isset($parameters['id']) && !isset($parameters['ids'])) {
throw new IllegalLinkException();
}

$objectIDs = $parameters['objectIDs'] ?? [$parameters['id']];
$objectIDs = $parameters['ids'] ?? [$parameters['id']];
$moderationList = new ModerationQueueList();
$moderationList->setObjectIDs($objectIDs);
$moderationList->readObjects();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public function render(mixed $value, DatabaseObject $row): string
);
}
if ($row->publicationStatus === Article::UNPUBLISHED) {
if ($badges !== '') {
$badges .= ' ';
}
$badges .= \sprintf(
'<span class="badge">%s</span>',
WCF::getLanguage()->get('wcf.acp.article.publicationStatus.unpublished')
Expand All @@ -118,6 +121,9 @@ public function render(mixed $value, DatabaseObject $row): string
WCF::getLanguage()->getLocale()
);

if ($badges !== '') {
$badges .= ' ';
}
$badges .= \sprintf(
'<span class="badge" title="%s">%s</span>',
$dateTime,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace wcf\system\interaction\bulk;

use wcf\system\interaction\InteractionConfirmationType;

/**
* Represents a disable interaction.
*
* @author Marcel Werk
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
class BulkDisableInteraction extends BulkRpcInteraction
{
public function __construct(
string $endpoint,
?\Closure $isAvailableCallback = null
) {
parent::__construct(
'disable',
$endpoint,
'wcf.global.button.disable',
InteractionConfirmationType::Disable,
isAvailableCallback: $isAvailableCallback
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use wcf\util\StringUtil;

/**
* Represents a bulk interaction that call a form builder action.
* Represents a bulk interaction that calls a form builder action.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
Expand All @@ -35,7 +35,7 @@ public function render(array $objects): string
$objectIDs = \array_values(\array_map(fn(DatabaseObject $object) => $object->getObjectID(), $objects));
$endpoint = StringUtil::encodeHTML(
LinkHandler::getInstance()->getControllerLink($this->controller, [
'objectIDs' => $objectIDs
'ids' => $objectIDs
])
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
use wcf\system\interaction\InteractionConfirmationType;

/**
* Represents a bulk trash interaction.
* Represents a bulk soft-delete interaction.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
class BulkTrashInteraction extends BulkRpcInteraction
class BulkSoftDeleteInteraction extends BulkRpcInteraction
{
public function __construct(
string $endpoint,
?\Closure $isAvailableCallback = null
) {
parent::__construct(
'trash',
'soft-delete',
$endpoint,
'wcf.global.button.trash',
InteractionConfirmationType::Custom,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace wcf\system\interaction\bulk;

use wcf\system\interaction\InteractionConfirmationType;

/**
* Represents a bulk soft-delete interaction that allows the user to enter a reason.
*
* @author Marcel Werk
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
class BulkSoftDeleteWithReasonInteraction extends BulkRpcInteraction
{
public function __construct(
string $endpoint,
?\Closure $isAvailableCallback = null
) {
parent::__construct(
'soft-delete',
$endpoint,
'wcf.global.button.trash',
InteractionConfirmationType::SoftDeleteWithReason,
isAvailableCallback: $isAvailableCallback
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use wcf\system\interaction\bulk\BulkFormBuilderDialogInteraction;
use wcf\system\interaction\bulk\BulkRestoreInteraction;
use wcf\system\interaction\bulk\BulkRpcInteraction;
use wcf\system\interaction\bulk\BulkTrashInteraction;
use wcf\system\interaction\bulk\BulkSoftDeleteInteraction;
use wcf\system\interaction\InteractionConfirmationType;

/**
Expand All @@ -29,7 +29,7 @@ final class ArticleBulkInteractions extends AbstractBulkInteractionProvider
public function __construct()
{
$this->addInteractions([
new BulkTrashInteraction('core/articles/%s/trash', function (ViewableArticle $article): bool {
new BulkSoftDeleteInteraction('core/articles/%s/soft-delete', function (ViewableArticle $article): bool {
if (!$article->canDelete()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use wcf\system\interaction\bulk\BulkDeleteInteraction;
use wcf\system\interaction\bulk\BulkRestoreInteraction;
use wcf\system\interaction\bulk\BulkRpcInteraction;
use wcf\system\interaction\bulk\BulkTrashInteraction;
use wcf\system\interaction\bulk\BulkSoftDeleteInteraction;
use wcf\system\interaction\InteractionConfirmationType;
use wcf\system\WCF;

Expand All @@ -32,7 +32,7 @@ public function __construct()
}

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