Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
886a997
Migrate the function to disable/enable ads to a command
Cyperghost Aug 10, 2025
7961487
Migrate the function to disable/enable BBCode Media Providers to a co…
Cyperghost Aug 10, 2025
235525b
Migrate the function to disable/enable Boxes to a command
Cyperghost Aug 10, 2025
4376662
Migrate the function to disable/enable captcha questions to a command
Cyperghost Aug 11, 2025
85f60bf
Migrate the function to disable/enable contact options to a command
Cyperghost Aug 11, 2025
2c3c6b8
Migrate the function to disable/enable contact recipient to a command
Cyperghost Aug 11, 2025
f221484
Migrate the function to disable/enable cronjobs to a command
Cyperghost Aug 11, 2025
d599571
Migrate the function to disable/enable languages to a command
Cyperghost Aug 11, 2025
b36c3cb
Migrate the function to disable/enable notice to a command
Cyperghost Aug 11, 2025
8232fde
Migrate the function to disable/enable package update servers to a co…
Cyperghost Aug 11, 2025
5393cd2
Migrate the function to disable/enable pages to a command
Cyperghost Aug 11, 2025
3ee89b2
Migrate the function to disable/enable paid subscriptions to a command
Cyperghost Aug 11, 2025
a25a52e
Migrate the function to disable/enable reaction types to a command
Cyperghost Aug 11, 2025
d67efb8
Migrate the function to disable/enable styles to a command
Cyperghost Aug 11, 2025
f3a4242
Migrate the function to disable/enable trophies to a command
Cyperghost Aug 11, 2025
67ba5a4
Migrate the function to disable/enable user group assignments to a co…
Cyperghost Aug 11, 2025
d32b22b
Move the check whether an object is deactivated/activated from the co…
Cyperghost Aug 13, 2025
32bd54f
Apply suggestions from code review
Cyperghost Aug 13, 2025
028076a
Remove `$box` parameter
Cyperghost Aug 13, 2025
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
33 changes: 33 additions & 0 deletions wcfsetup/install/files/lib/command/ad/DisableAd.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace wcf\command\ad;

use wcf\data\ad\Ad;
use wcf\data\ad\AdEditor;
use wcf\event\ad\AdDisabled;
use wcf\system\event\EventHandler;

/**
* Disables an ad.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class DisableAd
{
public function __construct(
private readonly Ad $ad
) {}

public function __invoke(): void
{
(new AdEditor($this->ad))->update([
'isDisabled' => 1,
]);

$event = new AdDisabled($this->ad);
EventHandler::getInstance()->fire($event);
}
}
33 changes: 33 additions & 0 deletions wcfsetup/install/files/lib/command/ad/EnableAd.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace wcf\command\ad;

use wcf\data\ad\Ad;
use wcf\data\ad\AdEditor;
use wcf\event\ad\AdEnabled;
use wcf\system\event\EventHandler;

/**
* Enables an ad.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class EnableAd
{
public function __construct(
private readonly Ad $ad
) {}

public function __invoke(): void
{
(new AdEditor($this->ad))->update([
'isDisabled' => 0,
]);

$event = new AdEnabled($this->ad);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace wcf\command\bbcode\media\provider;

use wcf\data\bbcode\media\provider\BBCodeMediaProvider;
use wcf\data\bbcode\media\provider\BBCodeMediaProviderEditor;
use wcf\event\bbcode\media\provider\BBCodeMediaProviderDisabled;
use wcf\system\event\EventHandler;

/**
* Disables a bbcode media provider.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class DisableBBCodeMediaProvider
{
public function __construct(private readonly BBCodeMediaProvider $mediaProvider) {}

public function __invoke(): void
{
(new BBCodeMediaProviderEditor($this->mediaProvider))->update([
'isDisabled' => 1,
]);

$event = new BBCodeMediaProviderDisabled($this->mediaProvider);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace wcf\command\bbcode\media\provider;

use wcf\data\bbcode\media\provider\BBCodeMediaProvider;
use wcf\data\bbcode\media\provider\BBCodeMediaProviderEditor;
use wcf\event\bbcode\media\provider\BBCodeMediaProviderEnabled;
use wcf\system\event\EventHandler;

/**
* Enables a bbcode media provider.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class EnableBBCodeMediaProvider
{
public function __construct(private readonly BBCodeMediaProvider $mediaProvider) {}

public function __invoke(): void
{
(new BBCodeMediaProviderEditor($this->mediaProvider))->update([
'isDisabled' => 0,
]);

$event = new BBCodeMediaProviderEnabled($this->mediaProvider);
EventHandler::getInstance()->fire($event);
}
}
31 changes: 31 additions & 0 deletions wcfsetup/install/files/lib/command/box/DisableBox.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace wcf\command\box;

use wcf\data\box\Box;
use wcf\data\box\BoxEditor;
use wcf\event\box\BoxDisabled;
use wcf\system\event\EventHandler;

/**
* Disables a box.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class DisableBox
{
public function __construct(private readonly Box $box) {}

public function __invoke(): void
{
(new BoxEditor($this->box))->update([
'isDisabled' => 1,
]);

$event = new BoxDisabled($this->box);
EventHandler::getInstance()->fire($event);
}
}
31 changes: 31 additions & 0 deletions wcfsetup/install/files/lib/command/box/EnableBox.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace wcf\command\box;

use wcf\data\box\Box;
use wcf\data\box\BoxEditor;
use wcf\event\box\BoxEnabled;
use wcf\system\event\EventHandler;

/**
* Enables a box.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class EnableBox
{
public function __construct(private readonly Box $box) {}

public function __invoke(): void
{
(new BoxEditor($this->box))->update([
'isDisabled' => 0,
]);

$event = new BoxEnabled($this->box);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace wcf\command\captcha\question;

use wcf\data\captcha\question\CaptchaQuestion;
use wcf\data\captcha\question\CaptchaQuestionEditor;
use wcf\event\captcha\question\CaptchaQuestionDisabled;
use wcf\system\event\EventHandler;

/**
* Disables a captcha question.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class DisableCaptchaQuestion
{
public function __construct(
private readonly CaptchaQuestion $captchaQuestion,
) {}

public function __invoke(): void
{
(new CaptchaQuestionEditor($this->captchaQuestion))->update([
'isDisabled' => 1,
]);

$event = new CaptchaQuestionDisabled($this->captchaQuestion);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace wcf\command\captcha\question;

use wcf\data\captcha\question\CaptchaQuestion;
use wcf\data\captcha\question\CaptchaQuestionEditor;
use wcf\event\captcha\question\CaptchaQuestionEnabled;
use wcf\system\event\EventHandler;

/**
* Enables a captcha question.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class EnableCaptchaQuestion
{
public function __construct(
private readonly CaptchaQuestion $captchaQuestion,
) {}

public function __invoke(): void
{
(new CaptchaQuestionEditor($this->captchaQuestion))->update([
'isDisabled' => 0,
]);

$event = new CaptchaQuestionEnabled($this->captchaQuestion);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace wcf\command\contact\option;

use wcf\data\contact\option\ContactOption;
use wcf\data\contact\option\ContactOptionEditor;
use wcf\event\contact\option\ContactOptionDisabled;
use wcf\system\event\EventHandler;

/**
* Disables a contact option.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class DisableContactOption
{
public function __construct(
private readonly ContactOption $contactOption
) {}

public function __invoke(): void
{
(new ContactOptionEditor($this->contactOption))->update([
'isDisabled' => 1,
]);

$event = new ContactOptionDisabled($this->contactOption);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace wcf\command\contact\option;

use wcf\data\contact\option\ContactOption;
use wcf\data\contact\option\ContactOptionEditor;
use wcf\event\contact\option\ContactOptionEnabled;
use wcf\system\event\EventHandler;

/**
* Enables a contact option.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class EnableContactOption
{
public function __construct(
private readonly ContactOption $contactOption
) {}

public function __invoke(): void
{
(new ContactOptionEditor($this->contactOption))->update([
'isDisabled' => 0,
]);

$event = new ContactOptionEnabled($this->contactOption);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace wcf\command\contact\recipient;

use wcf\data\contact\recipient\ContactRecipient;
use wcf\data\contact\recipient\ContactRecipientEditor;
use wcf\event\contact\recipient\ContactRecipientDisabled;
use wcf\system\event\EventHandler;

/**
* Disables a contact recipient.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class DisableContactRecipient {
public function __construct(private readonly ContactRecipient $recipient) {}

public function __invoke(): void
{
(new ContactRecipientEditor($this->recipient))->update([
'isDisabled' => 1,
]);

$event = new ContactRecipientDisabled($this->recipient);
EventHandler::getInstance()->fire($event);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace wcf\command\contact\recipient;

use wcf\data\contact\recipient\ContactRecipient;
use wcf\data\contact\recipient\ContactRecipientEditor;
use wcf\event\contact\recipient\ContactRecipientEnabled;
use wcf\system\event\EventHandler;

/**
* Enables a contact recipient.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/
final class EnableContactRecipient {
public function __construct(private readonly ContactRecipient $recipient) {}

public function __invoke(): void
{
(new ContactRecipientEditor($this->recipient))->update([
'isDisabled' => 0,
]);

$event = new ContactRecipientEnabled($this->recipient);
EventHandler::getInstance()->fire($event);
}
}
Loading