Code style.

This commit is contained in:
David Molineus
2015-01-15 15:30:16 +01:00
parent 2a7d95b37a
commit 04c0c75e14
9 changed files with 82 additions and 29 deletions

View File

@@ -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);