ModifyNewSchedulerTaskWizardItemsEvent
New in version 14.0
The PSR-14 event
\TYPO3\
allows extensions to modify the items in the wizard used to create a new task in
backend module Administration > Scheduler.
Example: Listening for a ModifyNewSchedulerTaskWizardItemsEvent
The following example adds an additional item to the scheduler task wizard, removes an existing item and modifies one.
EXT:my_extension/Classes/Seo/EventListener/MyEventListener.php
<?php
namespace MyVendor\MyExtension\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Scheduler\Event\ModifyNewSchedulerTaskWizardItemsEvent;
final readonly class ModifySchedulerTaskWizardListener
{
#[AsEventListener('my-extension/scheduler/modify-wizard-items')]
public function __invoke(ModifyNewSchedulerTaskWizardItemsEvent $event): void
{
// Add a custom task to the wizard
$event->addWizardItem('my_custom_task', [
'title' => 'My Custom Task',
'description' => 'A custom task provided by my extension',
'iconIdentifier' => 'my-custom-icon',
'taskType' => 'MyVendor\\MyExtension\\Task\\CustomTask',
'taskClass' => 'MyVendor\\MyExtension\\Task\\CustomTask',
]);
// Remove an existing task
$event->removeWizardItem('redirects_redirects:checkintegrity');
// Modify existing wizard items
$wizardItems = $event->getWizardItems();
foreach ($wizardItems as $key => $item) {
if (isset($item['title']) && str_contains($item['title'], 'referenceindex:update')) {
$item['title'] = 'Update reference index';
$event->addWizardItem($key, $item);
}
}
}
}