Hi everyone,

I'm using a view to display several information of a user, a kind of user profile page, on which I have 2 custom text fields which are linked to a form. I also use popups API to display the forms in a popup, for the 1st link it's a flag abuse form which one is working great when the user click on it, the popup is display.

For the 2nd one, it's the Privatemsg form when the user click on it, it's not a popup but a page is loaded containing the message form.

I need to know how to integrate the popup for Privatemsg module in my view.

Thanks,

Comments

bensemmel’s picture

I would be interested in this as well.

Thank you

berdir’s picture

Status: Active » Fixed
+
+/**
+ * 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]',
+       )
+    );
+  }
+}

You just have to tell Popups which links should be opened in popups, you can either extend that list or provide your own list in a separate module. For more information, please read through the documentation of the popups.module.

Status: Fixed » Closed (fixed)

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

rajiv.r.in’s picture

I have something similar - as views. How have you linked the 'send a message to this user' in views. Can u please explain? Thx