Index: print_mail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print_mail/print_mail.inc,v
retrieving revision 1.2.2.26
diff -u -r1.2.2.26 print_mail.inc
--- print_mail.inc	3 Oct 2009 16:52:09 -0000	1.2.2.26
+++ print_mail.inc	13 Oct 2009 22:09:20 -0000
@@ -369,3 +369,37 @@
 
   return $ret;
 }
+
+/**
+ * CTools modal callback to share by email
+ *
+ * @param boolean $js
+ *  Whether or not to return a json repsonse
+ *
+ * @param string $form_id
+ *  The form to render
+ * @return string
+ *  Either HTML or JSON according to the $js parameter
+ */
+function print_mail_ctools($form_id) {
+  $js = 1;
+  if ($js) {
+    ctools_include('modal');
+    ctools_include('ajax');
+    ctools_modal_add_js();
+
+    $form_state = array(
+      'ajax' => TRUE,
+    );
+    $output = ctools_modal_form_wrapper($form_id, $form_state);
+    if (!$output) {
+      $output = array();
+      $output[] = ctools_ajax_command_replace('#modal-message', '<div id="modal-message">'. $form_state['message'] .'</div>');
+      $output[] = ctools_modal_command_dismiss();
+    }
+    return ctools_ajax_render($output);
+  }
+  else {
+    return drupal_get_form($form_id);
+  }
+}
Index: print_mail.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print_mail/print_mail.module,v
retrieving revision 1.1.2.40
diff -u -r1.1.2.40 print_mail.module
--- print_mail.module	13 Oct 2009 00:04:25 -0000	1.1.2.40
+++ print_mail.module	13 Oct 2009 22:09:20 -0000
@@ -54,9 +54,10 @@
 function print_mail_menu() {
   $items = array();
 
+//    'page callback' => 'drupal_get_form',
   $items[PRINTMAIL_PATH] = array(
     'title' => 'Send page by e-mail',
-    'page callback' => 'drupal_get_form',
+    'page callback' => 'print_mail_ctools',
     'page arguments' => array('print_mail_form'),
     'access arguments' => array('access send to friend'),
     'type' => MENU_CALLBACK,
