Add undo relations deleting callback.

This commit is contained in:
David Molineus
2015-01-09 23:02:09 +01:00
parent 12040f24cc
commit 47d27e9c4a
2 changed files with 14 additions and 8 deletions

View File

@@ -37,11 +37,13 @@ L.Contao = L.Class.extend({
}); });
}); });
// Set default pointToLayer and onEachFeature handler. if (L.GeoJSON.AJAX) {
L.GeoJSON.AJAX.prototype.options = L.Util.extend({}, L.GeoJSON.AJAX.prototype.options, { // Set default pointToLayer and onEachFeature handler.
pointToLayer: this.pointToLayer.bind(this), L.GeoJSON.AJAX.prototype.options = {
onEachFeature: this.onEachFeature.bind(this) pointToLayer: this.pointToLayer.bind(this),
}); onEachFeature: this.onEachFeature.bind(this)
};
}
}, },
/** /**

View File

@@ -5,8 +5,12 @@
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = array $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
( (
'config' => array( 'config' => array(
'dataContainer' => 'Table', 'dataContainer' => 'Table',
'enableVersioning' => true, 'enableVersioning' => true,
'ctable' => array('tl_leaflet_vector', 'tl_leaflet_marker'),
'ondelete_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\Layer', 'deleteRelations'),
),
'sql' => array 'sql' => array
( (
'keys' => array 'keys' => array
@@ -15,7 +19,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
'pid' => 'index', 'pid' => 'index',
'alias' => 'unique', 'alias' => 'unique',
) )
) ),
), ),
'list' => array 'list' => array
( (