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?

CommentFileSizeAuthor
#2 dialog-911454-generic-responder.patch651 bytesmikey_p

Comments

mikey_p’s picture

Title: Responer works with ctools or dialog commands » Make a responder that works with ctools or dialog commands
mikey_p’s picture

Status: Active » Needs review
StatusFileSize
new651 bytes

I 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.

drewish’s picture

Hum, just realized this sort of conflicts with #834474: Javascript error if dialog shut down whilst loading. Thoughts on how to best resolve it?

mikey_p’s picture

Looks like this may not be needed, I'll have to test the patch from #834474: Javascript error if dialog shut down whilst loading.

devin carlson’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Dialog 6.x is no longer supported.