Hi, I have a site where I am doing a large amount of ajax functionality and I'd like to use the dialog API to handle modal dialogs for certain links when the the site is in a certain state (user is logged out) and then use the same links with normal ctools ajax responders (replace in this case) when the user is logged in. Ideally I'd like to do this without having to re-theme each link with ctools-use-dialog or ctools-use-ajax accordingly, and let the logic lie on the server side. Is it possible to adapt the ajax responder to respond to either type of response, or maybe provide a second class for links that providers a responder that doesn't open the modal until the response is returned?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | dialog-911454-generic-responder.patch | 651 bytes | mikey_p |
Comments
Comment #1
mikey_p commentedComment #2
mikey_p commentedI think this is all that is needed. Now I can have a single link that has 'ctools-use-ajax' and I can have the server-side logic sort out whether to redirect, replace or display a modal, without changing the frontend code at all.
I haven't looked at the 7.x branch but I can't imagine that this wouldn't be easy to apply there.
Comment #3
drewish commentedHum, just realized this sort of conflicts with #834474: Javascript error if dialog shut down whilst loading. Thoughts on how to best resolve it?
Comment #4
mikey_p commentedLooks like this may not be needed, I'll have to test the patch from #834474: Javascript error if dialog shut down whilst loading.
Comment #5
devin carlson commentedDialog 6.x is no longer supported.