Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.70.2.30.2.91.2.43
diff -u -p -r1.70.2.30.2.91.2.43 privatemsg.module
--- privatemsg.module	23 Apr 2009 00:18:36 -0000	1.70.2.30.2.91.2.43
+++ privatemsg.module	23 Apr 2009 11:44:09 -0000
@@ -323,6 +323,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'),
@@ -922,7 +935,7 @@ function privatemsg_user($op, &$edit, &$
       if ($url = privatemsg_get_link($account)) {
         $account->content['privatemsg_send_new_message'] = array(
           '#type'   => 'markup',
-          '#value'  => l(t('Send this user a message'), $url, array('query' => drupal_get_destination())),
+          '#value'  => l(t('Send this user a message'), $url, array('query' => drupal_get_destination(), 'attributes' => array('title' => t('Send this user a message')))),
           '#weight' => 10,
         );
       }
@@ -998,7 +1011,7 @@ function _privatemsg_block_menu() {
 
   $links = array();
   if (privatemsg_user_access('write privatemsg')) {
-    $links[] = l(t('Write new message'), 'messages/new');
+    $links[] = l(t('Write new message'), 'messages/new', array('attributes' => array('title' => t('Write new message'))));
   }
   if (privatemsg_user_access('read privatemsg') || privatemsg_user_access('read all private messages') ) {
     $links[] = l(privatemsg_title_callback(), 'messages');
@@ -1819,3 +1832,22 @@ function privatemsg_privatemsg_thread_op
   );
   return $operations;
 }
+
+/**
+ * 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
+       ),
+       '*' => array(
+        'div#block-privatemsg-privatemsg-menu a[href*=messages/new]',
+       )
+    );
+  }
+}
