sonata-project / SonataDoctrinePhpcrAdminBundle

[Abandoned] Symfony Sonata / Integrate Doctrine PHPCR into the SonataAdminBundle
https://sonata-project.org
MIT License
34 stars 92 forks source link

Possibility of restricting new documents in given subtrees #28

Closed nacmartin closed 11 years ago

nacmartin commented 12 years ago

The idea is that you can restrict the content document type nodes to be possible to create or move them into a given subtree. Same use case for routes, menus, ...

dbu commented 12 years ago

we could use validation annotations on children/reference mappings in our documents and make the admin bundle aware of them.

but maybe we want something more that can be used with the tree as well.

dbu commented 12 years ago

@uwej711 played with the code i started and says:

hier: https://github.com/uwej711/cmf-sandbox/tree/valid_children und hier: https://github.com/uwej711/SonataDoctrinePhpcrAdminBundle/tree/valid_children und hier: https://github.com/uwej711/TreeBrowserBundle/tree/valid_children

Was ich ändern musste: die types haben wohl gar nichts mit dem Kontextmenü des Trees zu tun, ehrlich gesagt keine Ahnung, was man da tun muss. Damit das Kontextmenü passt, muss man für die items eine JS-Funktion hinterlegen, die ausgehend vom selektieren Node das Kontextmenü zusammen baut.

Mir gefällt nicht, dass ich da jetzt config.doctypes und config.types zusammen verwurschtle, das kann man sicher besser machen, indem man im Controller eine Struktur erzeugt und in die config packt (config.validChildren als Array('className' => array('label' => '

uwej711 commented 12 years ago

I also thought about the mixup with the tree bundle and I think we need some refactoring to make the tree bundle working just with the tree interface. If I find some time I will look into that again.

dbu commented 11 years ago

@uwej711 is this now fully working or still missing something after #73 was merged?

uwej711 commented 11 years ago

Now this works only via the configured valid children.

dbu commented 11 years ago

see valid_children on document_tree config http://symfony.com/doc/master/cmf/tutorials/creating-cms-using-cmf-and-sonata.html#configuration