cross-solution / YAWIK

YAWIK is a web application. It can be used as an ATS applicant tracking system or as a jobboard.
https://yawik.org
MIT License
125 stars 67 forks source link

Inject SubnavigationListener if only needed #66

Closed mathias-weitz-cross-solutions closed 4 years ago

mathias-weitz-cross-solutions commented 10 years ago

The subnavigationlistener is always invoked even if there is no subnavigation like JSON-Responses. There should be a possibility to call the subnavigation only if needed.

mathias-weitz-cross-solutions commented 10 years ago

Following listeners do always create Elements (Childs for Navigation,..) even if there is no need for those. Sometimes their inclusion may have even side-effects, and you don't want these listeners to be called at all.

https://github.com/cross-solution/YAWIK/blob/develop/module/Core/src/Core/Listener/InjectNotificationsViewModelListener.php

https://github.com/cross-solution/YAWIK/blob/develop/module/Settings/src/Settings/Listener/InjectSubNavigationListener.php

TiSiE commented 10 years ago

It should be simple to check in the listener, if an ajax request is processed and skip its action.

Also, it is quite simple to implement a check for a specific event parameter to disable injection. This parameter can then be set on actions which does not require the injections.

That's true for both listeners.