Open pamtbaau opened 4 years ago
The current page logic is getting replaced with Flex Pages in Admin 1.10. It already has support for passing information as an event, though I've not looked into that for a long time and I'm not sure if it still works as intended.
I've cloned admin 1.10 and its required flex-objects plugin.
I don't see much changes of first sight, but in AdminPlugin::initializeAdmin(), line 956 the Admin object is initialized. At that moment, Admin::page() returns the page selected by the user for editing.
That seems to me the right moment to fire an event containing the page.
On a side note: Admin 1.10 + flex-objects plugins seems to be much more responsive...
The current version of flex plugin does not enable flex pages admin, it's enabled in the next version. You need to enable it from the plugin. Flex never calls Admin::page()
. :)
It is quite common for a plugin to check whether it should activate or not by checking the current uri/path against an 'enable_on_routes' config variable.
In Admin, this technique is cumbersome to implement (but doable) because the translated route of the selected page is not easily available.
This leads to the following issues:
Solution:
Suggestion: