? atom-7.x.patch
Index: atom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/atom/atom.module,v
retrieving revision 1.48
diff -u -p -r1.48 atom.module
--- atom.module	21 Sep 2009 22:32:17 -0000	1.48
+++ atom.module	25 Jun 2010 13:44:53 -0000
@@ -120,7 +120,7 @@ function atom_init() {
 function atom_theme() {
   return array(
     'atom_feed_item' => array(
-      'arguments' => array(
+      'variables' => array(
         'title' => NULL,
         'link' => NULL,
         'item' => NULL,
@@ -129,7 +129,7 @@ function atom_theme() {
       'file' => 'atom.pages.inc',
     ),
     'atom_feed' => array(
-      'arguments' => array(
+      'variables' => array(
         'feed_info' => array(),
         'items' => '',
       ),
Index: atom.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/atom/atom.pages.inc,v
retrieving revision 1.11
diff -u -p -r1.11 atom.pages.inc
--- atom.pages.inc	7 Oct 2009 02:23:04 -0000	1.11
+++ atom.pages.inc	25 Jun 2010 13:44:53 -0000
@@ -127,7 +127,14 @@ function _atom_print_feed(array $nids, a
     //  }
     //}
 
-    $output .= theme('atom_feed_item', $node->title, $node->link, $item, $extra);
+    $variables = array(
+      'title' => $node->title,
+      'link' => $node->link,
+      'item' => $item,
+      'extra' => $extra
+    );
+
+    $output .= theme('atom_feed_item', $variables);
   }
 
   // Merge some default values.
@@ -136,54 +143,59 @@ function _atom_print_feed(array $nids, a
     'subtitle' => variable_get('site_slogan', ''),
   );
 
-  $output = theme('atom_feed', $feed_info, $output);
+  $variables = array(
+    'feed_info' => $feed_info,
+    'items' => $output
+  );
+
+  $output = theme('atom_feed', $variables);
 
-  drupal_set_header('Content-Type: application/atom+xml; charset=utf-8');
+  drupal_add_http_header('Content-Type', 'application/atom+xml; charset=utf-8');
   print $output;
 }
 
-function theme_atom_feed(array $feed_info, $items) {
+function theme_atom_feed(array $variables) {
   $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
   $output .= '<feed xmlns="http://www.w3.org/2005/Atom">'."\n";
-  $output .= '  <title type="text">'. check_plain($feed_info['title']) ."</title>\n";
-  if ($feed_info['subtitle']) {
-    $output .= '  <subtitle type="text">' . check_plain($feed_info['subtitle']) . "</subtitle>\n";
+  $output .= '  <title type="text">'. check_plain($variables['feed_info']['title']) ."</title>\n";
+  if ($variables['feed_info']['subtitle']) {
+    $output .= '  <subtitle type="text">' . check_plain($variables['feed_info']['subtitle']) . "</subtitle>\n";
   }
-  $output .= '  <link rel="alternate" type="text/html" href="'. check_plain($feed_info['html_url']) .'" />'."\n";
-  $output .= '  <link rel="self" type="application/atom+xml" href="'. check_plain($feed_info['atom_url']) .'" />'."\n";
+  $output .= '  <link rel="alternate" type="text/html" href="'. check_plain($variables['feed_info']['html_url']) .'" />'."\n";
+  $output .= '  <link rel="self" type="application/atom+xml" href="'. check_plain($variables['feed_info']['atom_url']) .'" />'."\n";
   //$output .= '  <generator version="' . VERSION . '" uri="http://drupal.org">Drupal</generator>'."\n";
-  $output .= '  <id>'. check_plain($feed_info['atom_url']) ."</id>\n";
+  $output .= '  <id>'. check_plain($variables['feed_info']['atom_url']) ."</id>\n";
   $output .= '  <updated>'. gmdate(DATE_ATOM, time()) ."</updated>\n";
-  $output .= $items;
+  $output .= $variables['items'];
   $output .= "</feed>\n";
   return $output;
 }
 
-function theme_atom_feed_item($title, $link, array $item, array $extra) {
-  $item += array(
-    'id' => $link,
+function theme_atom_feed_item(array $variables) {  
+  $variables['item'] += array(
+    'id' => $variables['link'],
     'summary' => '',
     'content' => '',
     'author' => '',
   );
 
   $output = "  <entry>\n";
-  $output .= "    <id>" . check_plain($item['id']) . "</id>\n";
-  $output .= "    <link rel=\"alternate\" type=\"text/html\" href=\"" . check_plain($link) . "\" />\n";
-  $output .= "    <published>" . gmdate(DATE_ATOM, $item['published']) . "</published>\n";
-  $output .= "    <updated>" . gmdate(DATE_ATOM, $item['updated']) . "</updated>\n";
-  $output .= "    <title type=\"text\">" . check_plain($title) . "</title>\n";
-  if ($item['author']) {
-    $output .= "    <author><name>" . check_plain($item['author']) . "</name></author>\n";
+  $output .= "    <id>" . check_plain($variables['item']['id']) . "</id>\n";
+  $output .= "    <link rel=\"alternate\" type=\"text/html\" href=\"" . check_plain($variables['link']) . "\" />\n";
+  $output .= "    <published>" . gmdate(DATE_ATOM, $variables['item']['published']) . "</published>\n";
+  $output .= "    <updated>" . gmdate(DATE_ATOM, $variables['item']['updated']) . "</updated>\n";
+  $output .= "    <title type=\"text\">" . check_plain($variables['title']) . "</title>\n";
+  if ($variables['item']['author']) {
+    $output .= "    <author><name>" . check_plain($variables['item']['author']) . "</name></author>\n";
   }
-  if ($item['summary']) {
-    $output .= "    <summary type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" . $item['summary'] . "</div></summary>\n";
+  if ($variables['item']['summary']) {
+    $output .= "    <summary type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" . $variables['item']['summary'] . "</div></summary>\n";
   }
-  if ($item['content']) {
-    $output .= "    <content type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" . $item['content'] . "</div></content>\n";
+  if ($variables['item']['content']) {
+    $output .= "    <content type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" . $variables['item']['content'] . "</div></content>\n";
   }
-  if ($extra) {
-    $output .= format_xml_elements($extra);
+  if ($variables['extra']) {
+    $output .= format_xml_elements($variables['extra']);
   }
   $output .= "  </entry>\n";
   return $output;
