Developer manual 

This chapter describes the PSR-14 events of clubdirectory and the event listeners shipped with the extension.

Events 

All controller events implement \JWeiland\Clubdirectory\Event\ControllerActionEventInterface with the methods getRequest(), getControllerName(), getActionName() and getSettings(). The controller name is the short name like Club, Management, Map or Search.

PreProcessControllerActionEvent 

\JWeiland\Clubdirectory\Event\PreProcessControllerActionEvent is dispatched before the property mapping of an action starts, mostly within the initialize*Action() methods. Listeners can replace the request and the controller arguments, e.g. to modify the property mapping or the file upload configuration.

Additional methods:

getArguments() / setArguments(Arguments $arguments)
The controller arguments ( \TYPO3\CMS\Extbase\Mvc\Controller\Arguments ).
setRequest(Request $request)
Replaces the Extbase request.

Changed in version 9.0.0

The event replaces the removed InitializeControllerActionEvent and has the same methods now. The methods getController(), getClubController(), getMapController() and getClub() have been removed. Read the club from the request instead.

PostProcessFluidVariablesEvent 

\JWeiland\Clubdirectory\Event\PostProcessFluidVariablesEvent is dispatched before the variables are assigned to the view. Use getFluidVariables() to read and addFluidVariable(string $key, $value) to add or override a variable.

EXT:my_site_package/Classes/EventListener/AddClubListVariableEventListener.php
<?php

declare(strict_types=1);

/*
 * This file is part of the package jweiland/clubdirectory.
 *
 * For the full copyright and license information, please read the
 * LICENSE file that was distributed with this source code.
 */

namespace MyVendor\MySitePackage\EventListener;

use JWeiland\Clubdirectory\Event\PostProcessFluidVariablesEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

#[AsEventListener(identifier: 'my-site-package/add-club-list-variable')]
final readonly class AddClubListVariableEventListener
{
    public function __invoke(PostProcessFluidVariablesEvent $event): void
    {
        if ($event->getControllerName() !== 'Club'
            || $event->getActionName() !== 'list'
        ) {
            return;
        }

        $event->addFluidVariable('myVariable', 'myValue');
    }
}
Copied!

Removed events 

Changed in version 9.0.0

  • InitializeControllerActionEvent has been removed. Use PreProcessControllerActionEvent.
  • PostCheckFileReferenceEvent has been removed without replacement. Logo and images use the file upload handling of Extbase. Modify the file upload configuration with PreProcessControllerActionEvent instead.

Event listeners of clubdirectory 

Use these identifiers, if you want to register your own listener before or after one of them.

Identifier Event Controller actions and purpose
clubdirectory/restrictAccess PreProcessControllerActionEvent Management: create, edit, update, activate. Map: new, create. Allows the access to the club for owners, backend administrators and valid moderation tokens only. Stops with the 403 error handling of the site otherwise. activate gets the club UID as scalar argument clubUid. See Access control and error pages.
clubdirectory/register-hidden-club PreProcessControllerActionEvent Management: edit, update, confirmActivation. Map: new, create. Registers the hidden club for the property mapper. Executed after clubdirectory/restrictAccess.
clubdirectory/apply-upload-folder PreProcessControllerActionEvent Management: create, update. Sets the upload folder of logo and images from settings.new.uploadFolder.
clubdirectory/check-fal-uploads PreProcessControllerActionEvent Management: create, update. Adds the validator of checkfaluploads to logo and images, if checkfaluploads is installed. See Rights checkbox of checkfaluploads.
clubdirectory/allow-search-parameter PreProcessControllerActionEvent Search: listSearchResults. Allows the search arguments also for GET requests, e.g. of the page browser.
JWeilandClubdirectoryEventListenerAddPaginatorEventListener PostProcessFluidVariablesEvent Club: list. Search: listSearchResults. Adds the paginator and the pagination.
JWeilandClubdirectoryEventListenerAddGlossaryEventListener PostProcessFluidVariablesEvent Club: list. Adds the glossary of glossary2.
JWeilandClubdirectoryEventListenerSetTitleOfPOIToClubTitleEventListener JWeilandMaps2EventPostProcessPoiCollectionRecordEvent Sets the club title as title of the POI records of clubs saved in the backend.

Changed in version 9.0.0

The event listeners AssignMediaTypeConverterEventListener and DeleteUploadedFilesEventListener have been removed. The listeners clubdirectory/restrictAccess and clubdirectory/allow-search-parameter listen to PreProcessControllerActionEvent now.