public function getAdditionalFields(
        array &$taskInfo,
        $task,
        SchedulerModuleController $schedulerModule
    ) {
        /** @var $task IndexQueueWorkerTask */
        $additionalFields = [];
        $siteSelectorField = GeneralUtility::makeInstance(SiteSelectorField::class);

        if (!$this->isTaskInstanceofIndexQueueWorkerTask($task)) {
            return $additionalFields;
        }

        if ($schedulerModule->CMD === 'add') {
            $taskInfo['site'] = null;
            $taskInfo['documentsToIndexLimit'] = 50;
            $taskInfo['forcedWebRoot'] = '';
        }

        if ($schedulerModule->CMD === 'edit') {
            $taskInfo['site'] = $this->siteRepository->getSiteByRootPageId($task->getRootPageId());
            $taskInfo['documentsToIndexLimit'] = $task->getDocumentsToIndexLimit();
            $taskInfo['forcedWebRoot'] = $task->getForcedWebRoot();
        }

        $additionalFields['site'] = [
            'code' => $siteSelectorField->getAvailableSitesSelector('tx_scheduler[site]',
                $taskInfo['site']),
            'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:field_site',
            'cshKey' => '',
            'cshLabel' => ''
        ];

        $additionalFields['documentsToIndexLimit'] = [
            'code' => '<input type="number" class="form-control" name="tx_scheduler[documentsToIndexLimit]" value="' . htmlspecialchars($taskInfo['documentsToIndexLimit']) . '" />',
            'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_field_documentsToIndexLimit',
            'cshKey' => '',
            'cshLabel' => ''
        ];

        $additionalFields['forcedWebRoot'] = [
            'code' => '<input type="text" class="form-control" name="tx_scheduler[forcedWebRoot]" value="' . htmlspecialchars($taskInfo['forcedWebRoot']) . '" />',
            'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_field_forcedWebRoot',
            'cshKey' => '',
            'cshLabel' => ''
        ];

        return $additionalFields;
    }
public function getAdditionalFields(
        array &$taskInfo,
        $task,
        SchedulerModuleController $schedulerModule
    ) {
        /** @var $task IndexQueueWorkerTask */
        $additionalFields = [];
        $siteSelectorField = GeneralUtility::makeInstance(SiteSelectorField::class);

        if (!$this->isTaskInstanceofIndexQueueWorkerTask($task)) {
            return $additionalFields;
        }

        if ($schedulerModule->CMD === 'add') {
            $taskInfo['site'] = null;
            $taskInfo['documentsToIndexLimit'] = 50;
            $taskInfo['forcedWebRoot'] = '';
        }

        if ($schedulerModule->CMD === 'edit') {
            $taskInfo['site'] = $this->siteRepository->getSiteByRootPageId($task->getRootPageId());
            $taskInfo['documentsToIndexLimit'] = $task->getDocumentsToIndexLimit();
            $taskInfo['forcedWebRoot'] = $task->getForcedWebRoot();
        }

        $additionalFields['site'] = [
            'code' => $siteSelectorField->getAvailableSitesSelector('tx_scheduler[site]',
                $taskInfo['site']),
            'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:field_site',
            'cshKey' => '',
            'cshLabel' => ''
        ];

        $additionalFields['documentsToIndexLimit'] = [
            'code' => '<input type="number" class="form-control" name="tx_scheduler[documentsToIndexLimit]" value="' . htmlspecialchars($taskInfo['documentsToIndexLimit']) . '" />',
            'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_field_documentsToIndexLimit',
            'cshKey' => '',
            'cshLabel' => ''
        ];

        $additionalFields['forcedWebRoot'] = [
            'code' => '<input type="text" class="form-control" name="tx_scheduler[forcedWebRoot]" value="' . htmlspecialchars($taskInfo['forcedWebRoot']) . '" />',
            'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_field_forcedWebRoot',
            'cshKey' => '',
            'cshLabel' => ''
        ];

        return $additionalFields;
    }
public function getAdditionalFields ( array & $ taskInfo , $ task , SchedulerModuleController $ schedulerModule ) { /** @var $task IndexQueueWorkerTask */ $ additionalFields = [ ] ; $ siteSelectorField = GeneralUtility :: makeInstance ( SiteSelectorField :: class ) ; if ( ! $ this -> isTaskInstanceofIndexQueueWorkerTask ( $ task ) ) { return $ additionalFields ; } if ( $ schedulerModule -> CMD === 'add' ) { $ taskInfo [ 'site' ] = null ; $ taskInfo [ 'documentsToIndexLimit' ] = 50 ; $ taskInfo [ 'forcedWebRoot' ] = '' ; } if ( $ schedulerModule -> CMD === 'edit' ) { $ taskInfo [ 'site' ] = $ this -> siteRepository -> getSiteByRootPageId ( $ task -> getRootPageId ( ) ) ; $ taskInfo [ 'documentsToIndexLimit' ] = $ task -> getDocumentsToIndexLimit ( ) ; $ taskInfo [ 'forcedWebRoot' ] = $ task -> getForcedWebRoot ( ) ; } $ additionalFields [ 'site' ] = [ 'code' => $ siteSelectorField -> getAvailableSitesSelector ( 'tx_scheduler[site]' , $ taskInfo [ 'site' ] ) , 'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:field_site' , 'cshKey' => '' , 'cshLabel' => '' ] ; $ additionalFields [ 'documentsToIndexLimit' ] = [ 'code' => '<input type="number" class="form-control" name="tx_scheduler[documentsToIndexLimit]" value="' . htmlspecialchars ( $ taskInfo [ 'documentsToIndexLimit' ] ) . '" />' , 'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_field_documentsToIndexLimit' , 'cshKey' => '' , 'cshLabel' => '' ] ; $ additionalFields [ 'forcedWebRoot' ] = [ 'code' => '<input type="text" class="form-control" name="tx_scheduler[forcedWebRoot]" value="' . htmlspecialchars ( $ taskInfo [ 'forcedWebRoot' ] ) . '" />' , 'label' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_field_forcedWebRoot' , 'cshKey' => '' , 'cshLabel' => '' ] ; return $ additionalFields ; }
Used to define fields to provide the TYPO3 site to index and number of
items to index per run when adding or editing a task.

@param array $taskInfo reference to the array containing the info used in the add/edit form
@param AbstractTask $task when editing, reference to the current task object. Null when adding.
@param SchedulerModuleController $schedulerModule : reference to the calling object (Scheduler's BE module)
@return array Array containing all the information pertaining to the additional fields
The array is multidimensional, keyed to the task class name and each field's id
For each field it provides an associative sub-array with the following:
Used to define fields to provide the TYPO3 site to index and number of items to index per run when adding or editing a task .