Allow to select sub layers in the control.

This commit is contained in:
David Molineus
2016-10-05 09:45:03 +02:00
parent 98ef670e4a
commit 5da4c047b0

View File

@@ -81,16 +81,11 @@ class ControlCallbacks extends Callbacks
*/
public function getLayers()
{
$options = array();
$collection = LayerModel::findBy('pid', '0', array('order' => 'title'));
$collection = LayerModel::findAll();
if ($collection) {
foreach ($collection as $model) {
$options[$model->id] = $model->title;
}
}
return $options;
return OptionsBuilder::fromCollection($collection, 'title')
->asTree()
->getOptions();
}
/**