2015-01-05 12:25:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @package dev
|
|
|
|
|
* @author David Molineus <david.molineus@netzmacht.de>
|
|
|
|
|
* @copyright 2015 netzmacht creative David Molineus
|
|
|
|
|
* @license LGPL 3.0
|
|
|
|
|
* @filesource
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Netzmacht\Contao\Leaflet\Dca;
|
|
|
|
|
|
|
|
|
|
|
2015-01-08 11:01:22 +01:00
|
|
|
use Netzmacht\Contao\DevTools\Dca\Options\OptionsBuilder;
|
|
|
|
|
use Netzmacht\Contao\Leaflet\Model\ControlModel;
|
2015-01-05 14:58:37 +01:00
|
|
|
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
|
|
|
|
|
2015-01-05 12:25:46 +01:00
|
|
|
class Control
|
|
|
|
|
{
|
|
|
|
|
public function generateRow($row)
|
|
|
|
|
{
|
|
|
|
|
return sprintf(
|
|
|
|
|
'%s <span class="tl_gray">[%s]</span>',
|
|
|
|
|
$row['title'],
|
|
|
|
|
$row['type']
|
|
|
|
|
);
|
|
|
|
|
}
|
2015-01-05 14:58:37 +01:00
|
|
|
|
|
|
|
|
public function getLayers()
|
|
|
|
|
{
|
|
|
|
|
$options = array();
|
|
|
|
|
$collection = LayerModel::findBy('pid', '0', array('order' => 'title'));
|
|
|
|
|
|
|
|
|
|
if ($collection) {
|
|
|
|
|
foreach ($collection as $model) {
|
|
|
|
|
$options[$model->id] = $model->title;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $options;
|
|
|
|
|
}
|
2015-01-08 11:01:22 +01:00
|
|
|
|
|
|
|
|
public function getZoomControls()
|
|
|
|
|
{
|
|
|
|
|
$collection = ControlModel::findBy('type', 'zoom', array('order' => 'title'));
|
|
|
|
|
|
|
|
|
|
return OptionsBuilder::fromCollection($collection, 'id', 'title')->getOptions();
|
|
|
|
|
}
|
2015-01-05 12:25:46 +01:00
|
|
|
}
|