Index: print_mail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print_mail/print_mail.inc,v
retrieving revision 1.2.2.24
diff -u -p -r1.2.2.24 print_mail.inc
--- print_mail.inc	20 Aug 2009 02:19:19 -0000	1.2.2.24
+++ print_mail.inc	2 Oct 2009 18:10:20 -0000
@@ -13,6 +13,26 @@
 
 require_once(drupal_get_path('module', 'print') .'/print.pages.inc');
 
+function print_mail_ctools_callback($form_id, $js) {
+  if ($js) {
+    ctools_include('modal');
+    ctools_include('ajax');
+    $form_state = array(
+      'ajax' => TRUE,
+      'title' => t('Send page by email'),
+    );
+    $commands = array();
+    $commands = ctools_modal_form_wrapper($form_id, $form_state);
+    if (empty($commands)) {
+      $commands[] = ctools_modal_command_display(t('Thank you for sharing!'), t('Your email has been sent.'));
+    }
+    ctools_ajax_render($commands);
+  }
+  else {
+    drupal_get_form($form_id);
+  }
+}
+
 /**
  * Menu callback for the send by e-mail form.
  *
Index: print_mail.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print_mail/print_mail.module,v
retrieving revision 1.1.2.39
diff -u -p -r1.1.2.39 print_mail.module
--- print_mail.module	20 Aug 2009 02:19:19 -0000	1.1.2.39
+++ print_mail.module	2 Oct 2009 18:10:20 -0000
@@ -88,6 +88,17 @@ function print_mail_menu() {
     'type' => MENU_LOCAL_TASK,
     'file' => 'print_mail.admin.inc',
   );
+  
+  if (module_exists('ctools')) {
+    $items[PRINTMAIL_PATH .'/%/%ctools_js'] = array(
+      'title' => 'Send page by email',
+      'page callback' => 'print_mail_ctools_callback',
+      'page arguments' => array('print_mail_form', 2),
+      'access arguments' => array('access send to friend'),
+      'type' => MENU_CALLBACK,
+      'file' => 'print_mail.inc',
+    );
+  }
 
   return $items;
 }
