From 922d02adfffafaba92cebbb84787ae57656dd90c Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 14 Jan 2015 17:59:18 +0100 Subject: [PATCH] Remove dependency of url builder. --- composer.json | 1 - src/Netzmacht/Contao/Leaflet/Frontend/HybridTrait.php | 3 ++- src/Netzmacht/Contao/Leaflet/Frontend/RequestUrl.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4cdd9a4..b26c527 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,6 @@ "contao/core":">=3.2,<3.5-dev", "contao-community-alliance/dependency-container":"~1.0", "contao-community-alliance/event-dispatcher":"~1.0", - "contao-community-alliance/url-builder":"~1.1", "netzmacht/contao-leaflet-libraries": "~0.7", "netzmacht/php-javascript-builder": "~1.0", "netzmacht/php-leaflet": "~0.7", diff --git a/src/Netzmacht/Contao/Leaflet/Frontend/HybridTrait.php b/src/Netzmacht/Contao/Leaflet/Frontend/HybridTrait.php index 9d8f11c..02fc614 100644 --- a/src/Netzmacht/Contao/Leaflet/Frontend/HybridTrait.php +++ b/src/Netzmacht/Contao/Leaflet/Frontend/HybridTrait.php @@ -66,7 +66,6 @@ trait HybridTrait */ public function generate() { - RequestUrl::setFor($this->getIdentifier()); $this->handleAjaxRequest(); if (TL_MODE === 'BE') { @@ -102,8 +101,10 @@ trait HybridTrait protected function compile() { try { + RequestUrl::setFor($this->getIdentifier()); $mapId = 'map_' . ($this->cssID[0] ?: ('ce_' . $this->id)); $map = $this->mapService->getJavascript($this->leaflet_map, null, $mapId); + RequestUrl::setFor(null); $GLOBALS['TL_BODY'][] = ''; diff --git a/src/Netzmacht/Contao/Leaflet/Frontend/RequestUrl.php b/src/Netzmacht/Contao/Leaflet/Frontend/RequestUrl.php index b723aeb..07a92fc 100644 --- a/src/Netzmacht/Contao/Leaflet/Frontend/RequestUrl.php +++ b/src/Netzmacht/Contao/Leaflet/Frontend/RequestUrl.php @@ -47,8 +47,8 @@ class RequestUrl 'format' => $format != 'geojson' ? $format: null ); - $param = base64_encode(implode(',', $params)); + $param = rawurlencode(base64_encode(implode(',', $params)) . '=='); - return \Config::get('websitePath') . '/' . \Frontend::addToUrl('leaflet=' . $param); + return \Config::get('websitePath') . '/' . \Frontend::addToUrl('leaflet=' . $param, false); } }