forked from Snck3rs/contao-leaflet-maps
Code style.
This commit is contained in:
@@ -94,7 +94,7 @@ trait HybridTrait
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception If something went wrong.
|
||||
* @throws \Exception If the map could not be created.
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.Superglobals)
|
||||
*/
|
||||
@@ -102,7 +102,7 @@ trait HybridTrait
|
||||
{
|
||||
try {
|
||||
RequestUrl::setFor($this->getIdentifier());
|
||||
$mapId = 'map_' . ($this->cssID[0] ?: ('ce_' . $this->id));
|
||||
$mapId = 'map_' . ($this->cssID[0] ?: ($this->getIdentifier()));
|
||||
$map = $this->mapService->generate($this->leaflet_map, null, $mapId);
|
||||
RequestUrl::setFor(null);
|
||||
|
||||
@@ -131,7 +131,10 @@ trait HybridTrait
|
||||
/**
|
||||
* Handle ajax request if leaflet parameter is given.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @return void
|
||||
*
|
||||
* @throws \HttpRequestException If a bad leaflet param hash is given.
|
||||
* @SuppressWarnings(ExitExpression)
|
||||
*/
|
||||
private function handleAjaxRequest()
|
||||
{
|
||||
@@ -139,7 +142,12 @@ trait HybridTrait
|
||||
|
||||
// Handle ajax request.
|
||||
if ($input) {
|
||||
$data = (array) explode(',', base64_decode($input));
|
||||
$data = explode(',', base64_decode($input));
|
||||
|
||||
if (count($data) != 4) {
|
||||
throw new \HttpRequestException('Bad request. Could not resolve query params');
|
||||
}
|
||||
|
||||
$data = array_combine(array('for', 'type', 'id', 'format'), $data);
|
||||
$data = array_filter($data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user