Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.70.2.30.2.91.2.25
diff -u -p -r1.70.2.30.2.91.2.25 privatemsg.module
--- privatemsg.module	22 Feb 2009 21:21:08 -0000	1.70.2.30.2.91.2.25
+++ privatemsg.module	18 Mar 2009 21:56:41 -0000
@@ -243,6 +243,19 @@ function private_message_settings() {
     '#default_value' => variable_get('private_message_view_template', 'privatemsg-view'),
     '#options'       => private_message_view_options(),
   );
+  $form['integration'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Integration settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#description' => t('These settings allow to configure the integration with other modules.'),
+  );
+  $form['integration']['privatemsg_popups'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Open "send private message" links in a popup'),
+    '#default_value' => variable_get('privatemsg_popups', TRUE),
+    '#description' => t('This requires the <a href="http://drupal.org/project/popups">Popups API module</a>.'),
+  );
   $form['privatemsg_per_page'] = array(
     '#type' => 'select',
     '#title' => t('Messages per page'),
@@ -1453,3 +1466,19 @@ function _privatemsg_assemble_query($que
   }
   return FALSE;
 }
+
+/**
+ * Integration of hook_popups() of the popups module.
+ */
+function privatemsg_popups() {
+  if (variable_get('privatemsg_popups', TRUE)) {
+    return array(
+      'user/*' => array( // profile pages
+        'a[href*=messages/new]' // Send privatemsg
+       ),
+      'node/*' => array( // node pages
+        'a[href*=messages/new]', // Send privatemsg
+       ),
+    );
+  }
+}
