Enable multiple custom popup types per page

nedjo - April 1, 2008 - 20:53
Project:Popups API (Ajax Dialogs)
Version:6.x-1.0-beta3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

First off, it's great working with Popups. Thanks for providing this very useful and easy to code for solution.

Currently popups_add_popups() uses a static variable to ensure it's only executed once. This makes sense for the types of popups that are limited to a specific path, but limits flexibility in other cases. E.g., if two forms with popups display on the same page, only one will get its popups. I'm also finding I want to call popups_add_popups()in other places to add custom instructions that don't lend themselves to the hook implementation (because their display is determined by other than path or form id).

The fix is simple. In popups_add_popups(), take the element-specific part out of the static variable test. This means two calls to drupal_add_js() for the settings--one that will only be called once and a second one that will be called each time data are fed into popups_add_popups().

Patch attached.

AttachmentSize
popups-multiple.patch2.84 KB

#1

nedjo - April 1, 2008 - 21:28
Status:active» needs review

#2

starbow - April 2, 2008 - 19:50
Status:needs review» postponed (maintainer needs more info)

Hmm, it's a little tricky for me to keep this module and the D7 patches separate in my mind as they diverge. But it is only in D7 that you are expected to call *_add_popups every time you want a popup behavior. In this D6 version, the another module (which creates the forms) is expected to impletement hook_popups to define rule sets for both the forms. Then all of the various rules set in all the hook_popups calls are concatenated and past into the page as appropriate by popups_init or popups_form_alter.

Does that answer your issue, or am I missing something?

#3

starbow - August 24, 2008 - 17:28
Status:postponed (maintainer needs more info)» fixed

This feature has been added in 1.1-beta2.
Thanks.

#4

Anonymous (not verified) - September 7, 2008 - 17:33
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.