Move layers configuration.

This commit is contained in:
David Molineus
2017-10-06 10:07:19 +02:00
parent 320359d2f0
commit f5badd14c5
10 changed files with 478 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2016-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Class ReferenceLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class ReferenceLabelRenderer extends AbstractLabelRenderer
{
/**
* {@inheritdoc}
*/
protected function getLayerType(): string
{
return 'vectors';
}
/**
* {@inheritdoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
$reference = LayerModel::findByPk($row['reference']);
if ($reference) {
$label .= '<span class="tl_gray"> (' . $reference->title . ')</span>';
}
return $label;
}
}