Index: print.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print.pages.inc,v
retrieving revision 1.1.2.59
diff -u -r1.1.2.59 print.pages.inc
--- print.pages.inc	11 Jan 2010 19:55:52 -0000	1.1.2.59
+++ print.pages.inc	30 Jun 2010 21:31:55 -0000
@@ -90,13 +90,17 @@
   }
   $parts = explode('/', $path);
   if (is_numeric($parts[0]) && (count($parts) == 1)) {
-    $print = _print_generate_node($path, $cid, $format, $teaser, $message);
+    $print = _print_generate_node(array($path), $cid, $format, $teaser, $message);
+  }
+  elseif ( preg_match("/^([1-9]([0-9])*,?)*$/", $path) ) {
+    $nids = explode(",",$path);
+    $print = _print_generate_node($nids, $cid, $format, $teaser, $message);
   }
   else {
     $ret = preg_match('!^book/export/html/(.*)!i', $path, $matches);
     if ($ret == 1) {
       // This is a book PF page link, handle trough the book handling functions
-      $print = _print_generate_book($matches[1], $format, $teaser, $message);
+      $print = _print_generate_book(array($matches[1]), $format, $teaser, $message);
     }
     else {
       // If no content node was found, handle the page printing with the 'printable' engine
@@ -545,8 +549,13 @@
  * @return
  *   filled array ready to be used in the template
  */
-function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $teaser = FALSE, $message = NULL) {
+function _print_generate_node($nids = array(), $cid = NULL, $format = PRINT_HTML_FORMAT, $teaser = FALSE, $message = NULL) {
   global $_print_urls;
+  
+  #$nids = array(1,2);
+  $print = array();
+  foreach ( $nids as  $nid ) {
+  
 
   // We can take a node id
   $node = node_load($nid);
@@ -643,7 +652,8 @@
 
   init_theme();
 
-  $print = _print_var_generator($node, $message, $cid);
+  $print[] = _print_var_generator($node, $message, $cid);
+  } // end of foreach
 
   return $print;
 }
Index: print.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print.tpl.php,v
retrieving revision 1.8.2.15
diff -u -r1.8.2.15 print.tpl.php
--- print.tpl.php	9 Jul 2009 12:00:52 -0000	1.8.2.15
+++ print.tpl.php	30 Jun 2010 21:31:55 -0000
@@ -9,33 +9,37 @@
  */
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $print['language']; ?>" xml:lang="<?php print $print['language']; ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $print[0]['language']; ?>" xml:lang="<?php print $print[0]['language']; ?>">
   <head>
-    <?php print $print['head']; ?>
-    <title><?php print $print['title']; ?></title>
-    <?php print $print['scripts']; ?>
-    <?php print $print['robots_meta']; ?>
-    <?php print $print['base_href']; ?>
-    <?php print $print['favicon']; ?>
-    <?php print $print['css']; ?>
+    <?php print $print[0]['head']; ?>
+    <title><?php print $print[0]['title']; ?></title>
+    <?php print $print[0]['scripts']; ?>
+    <?php print $print[0]['robots_meta']; ?>
+    <?php print $print[0]['base_href']; ?>
+    <?php print $print[0]['favicon']; ?>
+    <?php print $print[0]['css']; ?>
   </head>
-  <body<?php print $print['sendtoprinter']; ?>>
-    <?php if (!empty($print['message'])) {
-      print '<div class="print-message">'. $print['message'] .'</div><p />';
+  <body<?php print $print[0]['sendtoprinter']; ?>>
+    <?php if (!empty($print[0]['message'])) {
+      print '<div class="print-message">'. $print[0]['message'] .'</div><p />';
     } ?>
-    <div class="print-logo"><?php print $print['logo']; ?></div>
-    <div class="print-site_name"><?php print $print['site_name']; ?></div>
+    <div class="print-logo"><?php print $print[0]['logo']; ?></div>
+    <div class="print-site_name"><?php print $print[0]['site_name']; ?></div>
     <p />
-    <div class="print-breadcrumb"><?php print $print['breadcrumb']; ?></div>
-    <hr class="print-hr" />
-    <h1 class="print-title"><?php print $print['title']; ?></h1>
-    <div class="print-submitted"><?php print $print['submitted']; ?></div>
-    <div class="print-created"><?php print $print['created']; ?></div>
-    <div class="print-content"><?php print $print['content']; ?></div>
-    <div class="print-taxonomy"><?php print $print['taxonomy']; ?></div>
+    <?php print count($print); ?>
+    <?php foreach ($print as $print_node): ?>
+      <div class="print-breadcrumb"><?php print $print_node['breadcrumb']; ?></div>
+      <hr class="print-hr" />
+      <h1 class="print-title"><?php print $print_node['title']; ?></h1>
+      <div class="print-submitted"><?php print $print_node['submitted']; ?></div>
+      <div class="print-created"><?php print $print_node['created']; ?></div>
+      <p />
+      <div class="print-content"><?php print $print_node['content']; ?></div>
+      <div class="print-taxonomy"><?php print $print_node['taxonomy']; ?></div>
+      <div class="print-source_url"><?php print $print_node['source_url']; ?></div>
+      <div class="print-links"><?php print $print_node['pfp_links']; ?></div>
+    <?php endforeach; ?>
     <div class="print-footer"><?php print $print['footer_message']; ?></div>
     <hr class="print-hr" />
-    <div class="print-source_url"><?php print $print['source_url']; ?></div>
-    <div class="print-links"><?php print $print['pfp_links']; ?></div>
   </body>
 </html>
Index: print.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print.module,v
retrieving revision 1.25.2.79
diff -u -r1.25.2.79 print.module
--- print.module	11 Jan 2010 15:40:12 -0000	1.25.2.79
+++ print.module	30 Jun 2010 21:31:55 -0000
@@ -471,8 +471,10 @@
   $path = drupal_get_normal_path($path);
   $nid = preg_replace('!^node/!', '', $path);
   if (is_numeric($nid)) {
-    $res = db_fetch_object(db_query("SELECT title FROM {node} WHERE nid = %d", $nid));
-    return $res->title;
+    $node = node_load($nid);
+    return $node->title;
+    //$res = db_fetch_object(db_query("SELECT title FROM {node} WHERE nid = %d", $nid));
+    //return $res->title;
   }
   else {
     $res = db_fetch_object(db_query("SELECT link_title FROM {menu_links} WHERE link_path = '%s'", $path));
Index: print_mail/print_mail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print_mail/print_mail.inc,v
retrieving revision 1.2.2.27
diff -u -r1.2.2.27 print_mail.inc
--- print_mail/print_mail.inc	1 Nov 2009 18:19:47 -0000	1.2.2.27
+++ print_mail/print_mail.inc	30 Jun 2010 21:31:56 -0000
@@ -40,24 +40,38 @@
   unset($path[0]);
   $path = implode('/', $path);
   if (is_numeric($path)) {
-    $path = 'node/'. $path;
+    $path = array('node/'. $path);
+  }
+  elseif (preg_match('/^\d+(,\d+)*/', $path)) {
+    $paths = explode(',', $path);
+    array_walk($paths, create_function('&$value, $key', '$value = \'node/\' . $value;'));
+    $path = $paths;
   }
   $cid = isset($_GET['comment']) ? (int)$_GET['comment'] : NULL;
-  $title = _print_get_title($path);
+  $title = _print_get_title($path[0]);
 
   if (count($form_state['post']) == 0) {
-    $nodepath = drupal_get_normal_path($path);
-    db_query("UPDATE {print_mail_page_counter} SET totalcount = totalcount + 1, timestamp = %d WHERE path = '%s'", time(), $nodepath);
-    // If we affected 0 rows, this is the first time viewing the node.
-    if (!db_affected_rows()) {
-      // We must create a new row to store counters for the new node.
-      db_query("INSERT INTO {print_mail_page_counter} (path, totalcount, timestamp) VALUES ('%s', 1, %d)", $nodepath, time());
+    foreach($path as $p) {
+      $nodepath = drupal_get_normal_path($p);
+      db_query("UPDATE {print_mail_page_counter} 
+        SET totalcount = totalcount + 1, timestamp = %d 
+        WHERE path = '%s'", 
+        time(), $nodepath);
+      // If we affected 0 rows, this is the first time viewing the node.
+      if (!db_affected_rows()) {
+        // We must create a new row to store counters for the new node.
+        db_query("INSERT INTO {print_mail_page_counter} (path, totalcount, timestamp) VALUES ('%s', 1, %d)", 
+        $nodepath, time());
+      }
     }
   }
 
+  $destination = isset($_REQUEST['destination']) ? $_REQUEST['destination'] : $path;
+  
   $form['path'] = array('#type' => 'value', '#value' => $path);
   $form['cid'] =  array('#type' => 'value', '#value' => $cid);
-
+  $form['destination'] =  array('#type' => 'value', '#value' => $destination);
+  
   $form['fld_from_addr'] = array(
     '#type' => 'textfield',
     '#title' => t('Your e-mail'),
@@ -81,10 +95,14 @@
     '#size' => 62,
   );
   if (!empty($title)) {
+    $titles = array();
+    foreach($path as $p) {
+      $titles[] = l(_print_get_title($p), $p, array('attributes' => array('title' => t('View page'))));
+    }
     $form['fld_title'] = array(
       '#type' => 'item',
-      '#title' => t('Page to be sent'),
-      '#value' => l($title, $path, array('attributes' => array('title' => t('View page')))),
+      '#title' => format_plural(count($titles), 'Page to be sent', 'Pages to be sent'),
+      '#value' => (count($titles) > 1 ? theme('item_list', $titles) : $titles[0]),
     );
   }
   $form['txt_message'] = array(
@@ -249,7 +267,7 @@
     $print_mail_text_message = filter_xss_admin(variable_get('print_mail_text_message', t('Message from sender')));
     $sender_message = $print_mail_text_message .':<br /><br /><em>'. nl2br(check_plain($form_state['values']['txt_message'])) .'</em>';
 
-    $print = print_controller($form_state['values']['path'], $cid, PRINT_MAIL_FORMAT, $form_state['values']['chk_teaser'], $sender_message);
+    $print = print_controller($form_state['values']['path'][0], $cid, PRINT_MAIL_FORMAT, $form_state['values']['chk_teaser'], $sender_message);
 
     // Spaces in img URLs must be replaced with %20
     $pattern = '!<(img\s[^>]*?)>!is';
@@ -258,16 +276,25 @@
     if ($print !== FALSE) {
       $params = array();
       $params['subject'] = $form_state['values']['fld_subject'];
-
-      $node = $print['node'];
+      $addresses = explode(', ', $form_state['values']['txt_to_addrs']);
+      
+      $nodes = array();
+      $print = array();
+      foreach($form_state['values']['path'] as $path) {
+        $single_print = print_controller($path, $cid, PRINT_MAIL_FORMAT, $form_state['values']['chk_teaser'], $sender_message);
+        $single_print[0]['content'] = preg_replace_callback($pattern, '_print_mail_encode_urls', $single_print[0]['content']);
+        $nodes[] = $single_print[0]['node'];
+        $print = array_merge($print, $single_print);
+      }
       ob_start();
-      include_once(_print_get_template(PRINT_MAIL_FORMAT, $print['type']));
+      include (_print_get_template(PRINT_MAIL_FORMAT, $print['type']));
       $params['body'] = ob_get_contents();
       ob_end_clean();
       $params['body'] = drupal_final_markup($params['body']);
-
+      
       $ok = FALSE;
-      if (function_exists('job_queue_add') && variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT)) {
+      if (function_exists('job_queue_add') 
+          && variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT)) {
         $use_job_queue = TRUE;
         $this_file = drupal_get_path('module', 'print_mail') .'/print_mail.inc';
       }
@@ -275,16 +302,24 @@
         $use_job_queue = FALSE;
       }
 
-      $addresses = explode(', ', $form_state['values']['txt_to_addrs']);
       foreach ($addresses as $to) {
         // Call to hook_print_mail_before_send in order to know if the mail can be sent
         // Handlers must return TRUE or FALSE
-        $can_send = module_invoke_all('print_mail_before_send', $node, $to, $from, $params);
+        $can_send = array();
+        foreach($nodes as $node) {
+          $can_send = array_merge($can_send, module_invoke_all('print_mail_before_send', $node, $to, $from, $params));
+        }
 
         if (!in_array(FALSE, $can_send)) {
           if ($use_job_queue) {
             // Use job queue to send mails during cron runs
-            job_queue_add('drupal_mail', t('print_mail: From %from', array('%from' => $from)), array('print_mail', 'sendpage', $to, language_default(), $params, $from, TRUE), $this_file, TRUE);
+            job_queue_add(
+              'drupal_mail', 
+              t('print_mail: From %from', array('%from' => $from)), 
+              array('print_mail', 'sendpage', $to, language_default(), $params, $from, TRUE), 
+              $this_file, 
+              TRUE
+            );
           }
           else {
             // Send mail immediately using Drupal's mail handler
@@ -292,26 +327,40 @@
           }
           if ($ret['result'] || $use_job_queue) {
             // Call to hook_print_mail_after_send in order to provide information to other modules.
-            module_invoke_all('print_mail_after_send', $node, $to, $from, $params);
+            foreach($nodes as $node) {
+              module_invoke_all('print_mail_after_send', $node, $to, $from, $params);
+            }
 
             flood_register_event('print_mail');
             $ok = TRUE;
           }
         }
-      }
+      } // foreach addresses
       if ($ok) {
-        watchdog('print_mail', '%name [%from] sent %page to [%to]', array('%name' => $form_state['values']['fld_from_name'], '%from' => $form_state['values']['fld_from_addr'], '%page' => $form_state['values']['path'], '%to' => $form_state['values']['txt_to_addrs']));
+        watchdog('print_mail', '%name [%from] sent %page to [%to]', array(
+          '%name' => $form_state['values']['fld_from_name'],
+          '%from' => $form_state['values']['fld_from_addr'], 
+          '%page' => join(', ', $form_state['values']['path']), 
+          '%to'   => $form_state['values']['txt_to_addrs'])
+        );
         $site_name = variable_get('site_name', t('us'));
-        $print_mail_text_confirmation = variable_get('print_mail_text_confirmation', t('Thank you for spreading the word about !site.'));
+        $print_mail_text_confirmation = variable_get('print_mail_text_confirmation', 
+          t('Thank you for spreading the word about !site.'));
         drupal_set_message(check_plain(t($print_mail_text_confirmation, array('!site' => $site_name))));
 
-        $nodepath = drupal_get_normal_path($form_state['values']['path']);
-        db_query("UPDATE {print_mail_page_counter} SET sentcount = sentcount + %d, sent_timestamp = %d WHERE path = '%s'", count($addresses), time(), $nodepath);
-      }
-    }
+        $nodepath = drupal_get_normal_path($form_state['values']['path'][0]);
+        db_query("UPDATE {print_mail_page_counter} 
+          SET sentcount = sentcount + %d, 
+              sent_timestamp = %d 
+          WHERE path = '%s'", 
+          count($addresses), time(), $nodepath
+        );
+      } // if $ok
+    } // $print !== FALSE
   }
 
-  $form_state['redirect'] = preg_replace('!^book/export/html/!', 'node/', $form_state['values']['path']);
+  // $form_state['redirect'] = preg_replace('!^book/export/html/!', 'node/', $form_state['values']['path'][0]);
+  $form_state['redirect'] = $form_state['values']['destination'];
 }
 
 /**
Index: print_mail/print_mail.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print_mail/print_mail.module,v
retrieving revision 1.1.2.44
diff -u -r1.1.2.44 print_mail.module
--- print_mail/print_mail.module	11 Jan 2010 17:59:34 -0000	1.1.2.44
+++ print_mail/print_mail.module	30 Jun 2010 21:31:56 -0000
@@ -294,12 +294,24 @@
     if (is_numeric($parts[1])) {
       $path = 'node/'. $path;
     }
+    elseif (preg_match('/^\d+(,\d+)*/', $path)) {
+      $paths = explode(',', $path);
+      array_walk($paths, create_function('&$value, $key', '$value = \'node/\' . $value;'));
+      $path = $paths;
+    }
     else {
       $path = drupal_get_normal_path($path);
     }
     // If the destination page is not accessible, don't show the form
-    if (!($router_item = menu_get_item($path)) || (!$router_item['access'])) {
-      $page_access = FALSE;
+    if (!is_array($path)) {
+      $path = array($path);
+    }
+    
+    foreach ($path as $p) {
+      if (!($router_item = menu_get_item($p)) || (!$router_item['access'])) {
+        $page_access = FALSE;
+        break;
+      }
     }
   }
 
