Replace insert tags and masked entities. (Fix #17)

This commit is contained in:
David Molineus
2015-01-22 12:24:22 +01:00
parent b65bcbff9f
commit 9dfb6698cf
7 changed files with 202 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\UI;
use Netzmacht\Contao\Leaflet\Mapper\AbstractMapper;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Model\IconModel;
use Netzmacht\Contao\Leaflet\ServiceContainerTrait;
use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Definition\Type\ImageIcon;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
@@ -26,6 +27,8 @@ use Netzmacht\LeafletPHP\Definition\UI\Marker;
*/
class MarkerMapper extends AbstractMapper
{
use ServiceContainerTrait;
/**
* Class of the model being build.
*
@@ -79,7 +82,12 @@ class MarkerMapper extends AbstractMapper
) {
if ($definition instanceof Marker) {
if ($model->addPopup) {
$definition->bindPopup($model->popupContent);
$content = $this
->getServiceContainer()
->getFrontendValueFilter()
->filter($model->popupContent);
$definition->bindPopup($content);
}
if ($model->customIcon) {

View File

@@ -15,6 +15,7 @@ use Netzmacht\Contao\Leaflet\Definition\Style;
use Netzmacht\Contao\Leaflet\Mapper\AbstractTypeMapper;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Model\StyleModel;
use Netzmacht\Contao\Leaflet\ServiceContainerTrait;
use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Definition\HasPopup;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
@@ -27,6 +28,8 @@ use Netzmacht\LeafletPHP\Definition\Vector\Path;
*/
class AbstractVectorMapper extends AbstractTypeMapper
{
use ServiceContainerTrait;
/**
* Class of the model being build.
*
@@ -59,7 +62,12 @@ class AbstractVectorMapper extends AbstractTypeMapper
}
if ($definition instanceof HasPopup && $model->addPopup) {
$definition->bindPopup($model->popupContent);
$content = $this
->getServiceContainer()
->getFrontendValueFilter()
->filter($model->popupContent);
$definition->bindPopup($content);
}
}
}