Format vector type.

This commit is contained in:
David Molineus
2016-10-06 11:44:56 +02:00
parent 48a6a3a360
commit caa137e566
3 changed files with 36 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ use Netzmacht\Contao\Leaflet\Dca\FrontendIntegration;
use Netzmacht\Contao\Leaflet\Dca\LayerCallbacks;
use Netzmacht\Contao\Leaflet\Dca\MapCallbacks;
use Netzmacht\Contao\Leaflet\Dca\Validator;
use Netzmacht\Contao\Leaflet\Dca\VectorCallbacks;
use Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices;
use Netzmacht\Contao\Leaflet\Frontend\MapElement;
use Netzmacht\Contao\Leaflet\Frontend\MapModule;
@@ -214,6 +215,17 @@ $container['leaflet.dca.control-callbacks'] = $container->share(
}
);
/**
* Callback helper class for tl_leaflet_control.
*
* @return ControlCallbacks
*/
$container['leaflet.dca.vector-callbacks'] = $container->share(
function ($container) {
return new VectorCallbacks($container[Services::DCA_MANAGER]);
}
);
/**
* Callback helper class for frontend integration.
*

View File

@@ -40,7 +40,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
'flag' => 1,
'panelLayout' => 'sort,filter;search,limit',
'headerFields' => array('title', 'type'),
'child_record_callback' => array('Netzmacht\Contao\Leaflet\Dca\VectorCallbacks', 'generateRow'),
'child_record_callback' => Netzmacht\Contao\Leaflet\Dca\VectorCallbacks::callback('generateRow'),
),
'label' => array
(
@@ -279,7 +279,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['style'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\VectorCallbacks', 'getStyles'),
'options_callback' => Netzmacht\Contao\Leaflet\Dca\VectorCallbacks::callback('getStyles'),
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',