Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
typo3.org
typo3.org
Commits
e8645c94
Commit
e8645c94
authored
Nov 02, 2020
by
Thomas Löffler
Browse files
Add event to remove location if lat and lng not set
parent
77e831c2
Pipeline
#9837
passed with stages
in 3 minutes and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extensions/t3org_layout/Classes/Event/ModifyDetailViewVariablesEvent.php
0 → 100644
View file @
e8645c94
<?php
namespace
T3o\T3orgLayout\Event
;
/*
* This file is part of a TYPO3 extension.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
class
ModifyDetailViewVariablesEvent
{
public
function
__invoke
(
\
DERHANSEN\SfEventMgt\Event\ModifyDetailViewVariablesEvent
$event
)
:
void
{
/** @var \DERHANSEN\SfEventMgt\Domain\Model\Event $eventModel */
$eventModel
=
$event
->
getVariables
()[
'event'
];
// Remove location if one used without lat and lng configuration
if
(
$eventModel
->
getLocation
()
&&
(
int
)
$eventModel
->
getLocation
()
->
getLatitude
()
===
0
&&
(
int
)
$eventModel
->
getLocation
()
->
getLongitude
()
===
0
)
{
$eventModel
->
setLocation
(
null
);
}
$event
->
setVariables
([
'event'
=>
$eventModel
]);
}
}
extensions/t3org_layout/Configuration/Services.yaml
0 → 100644
View file @
e8645c94
services
:
T3o\T3orgLayout\Event\ModifyDetailViewVariablesEvent
:
tags
:
-
name
:
event.listener
identifier
:
'
ModifyDetailViewVariablesEvent'
event
:
DERHANSEN\SfEventMgt\Event\ModifyDetailViewVariablesEvent
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment