Mercurial > defr > drupal > popups
comparison popups.module @ 3:5efa741592f9
Add an alter hook to the js list.
Makes it possible for a custom module to disable an auto-detected
JavaScript in case you just know it won't work right in a popup.
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Fri, 31 Dec 2010 14:02:22 +0100 |
| parents | 4215c43e74eb |
| children | 85e281a44a62 |
comparison
equal
deleted
inserted
replaced
| 1:4215c43e74eb | 3:5efa741592f9 |
|---|---|
| 177 } | 177 } |
| 178 | 178 |
| 179 unset($popup_js['core']['misc/jquery.js']); | 179 unset($popup_js['core']['misc/jquery.js']); |
| 180 unset($popup_js['core']['misc/drupal.js']); | 180 unset($popup_js['core']['misc/drupal.js']); |
| 181 | 181 |
| 182 // Allow modules to specifically alter the JS used in a popup. | |
| 183 drupal_alter('popups_js', $js); | |
| 184 | |
| 182 if (module_exists('jquery_update')) { | 185 if (module_exists('jquery_update')) { |
| 183 foreach (jquery_update_get_replacements() as $type => $replacements) { | 186 foreach (jquery_update_get_replacements() as $type => $replacements) { |
| 184 foreach ($replacements as $find => $replace) { | 187 foreach ($replacements as $find => $replace) { |
| 185 if (isset($popup_js[$type][$find])) { | 188 if (isset($popup_js[$type][$find])) { |
| 186 // Create a new entry for the replacement file, and unset the original one. | 189 // Create a new entry for the replacement file, and unset the original one. |
