This module gives Drupal the ability to easily change links into popup dialog boxes.
IMPORTANT NOTE: it only works with themes that have selectable content areas.
LIMITATIONS: Does not work with tinymce. Unlikely to work with other WYSIWYG's.
There are a couple of ways to use this module.
#1) Attach popup behavior to a link with popups_add_popups call.
// In your code
popups_add_popups(array('#mylink', '#mylink2=>array('width'=>'200px')));
This is the simplest method, especially if you want to pass in per-link options.
#2) Add the popup class to an existing link (you still must make sure popups_add_popups() is called
sometime for the page).
Example in code:
popups_add_popups();
$output .= l("Pop up entire local page.", 'popups/test/response', array('attributes'=>array(array('class' => 'popups')))) ."
";
Example on the theme level (only works if the "Scan all pages for popups links" checkbox is checked):
element(s).
'table td:nth-child(2) a' => array(
'noReload' => true, // Popup will not modify original page.
),
)
Options:
noReload: Does the popup NOT modify the original page (Default: FALSE).
forceReturn: url to force a stop to work flow (only use in conjunction with noReload).
href: Override the href in the a element, or attach an href to a non-link element.
width: Override the width specified in the css.
targetSelectors: Hash of jQuery selectors that define the content to be swapped out.
titleSelectors: Array of jQuery selectors to place the new page title.
reloadWhenDone: Force the entire page to reload after the popup form is submitted (Default: FALSE)
reloadOnError: Force the entire page to reload if the popup href is unaccessable (Default: FALSE)
[These last two can only be called from the hook, not the attribute]
additionalJavascript: Array of JavaScript files that must be included to correctly run the page in the popup.
additionalCss: Array of CSS files that must be included to correctly style the page in the popup.