forked from Snck3rs/contao-leaflet-maps
Fix controls selection.
This commit is contained in:
@@ -41,17 +41,36 @@ class ControlDcaListener extends AbstractListener
|
||||
*/
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
* Control types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $types;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param Manager $manager Data container manager.
|
||||
* @param Connection $connection Database connection.
|
||||
* @param array $types Control types.
|
||||
*/
|
||||
public function __construct(Manager $manager, Connection $connection)
|
||||
public function __construct(Manager $manager, Connection $connection, array $types)
|
||||
{
|
||||
parent::__construct($manager);
|
||||
|
||||
$this->connection = $connection;
|
||||
$this->types = $types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get control types.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getControlTypes(): array
|
||||
{
|
||||
return $this->types;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ services:
|
||||
arguments:
|
||||
- '@netzmacht.contao_toolkit.dca.manager'
|
||||
- '@database_connection'
|
||||
- '%netzmacht.contao_leaflet_maps.controls%'
|
||||
|
||||
netzmacht.contao_leaflet_maps.listeners.dca.layer:
|
||||
class: Netzmacht\Contao\Leaflet\Listener\Dca\LayerDcaListener
|
||||
|
||||
@@ -196,12 +196,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
|
||||
),
|
||||
'type' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['type'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'select',
|
||||
'filter' => true,
|
||||
'sorting' => true,
|
||||
'eval' => array(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['type'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'select',
|
||||
'filter' => true,
|
||||
'sorting' => true,
|
||||
'eval' => array(
|
||||
'mandatory' => true,
|
||||
'tl_class' => 'w50',
|
||||
'includeBlankOption' => true,
|
||||
@@ -209,9 +209,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
|
||||
'chosen' => true,
|
||||
'helpwizard' => true,
|
||||
),
|
||||
'options' => $GLOBALS['LEAFLET_CONTROLS'],
|
||||
'reference' => &$GLOBALS['TL_LANG']['leaflet_control'],
|
||||
'sql' => "varchar(32) NOT NULL default ''"
|
||||
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.control', 'getControlTypes'],
|
||||
'reference' => &$GLOBALS['TL_LANG']['leaflet_control'],
|
||||
'sql' => "varchar(32) NOT NULL default ''",
|
||||
),
|
||||
'position' => array
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user