### Eclipse Workspace Patch 1.0
#P drupal_test_7
Index: modules/node/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.tpl.php,v
retrieving revision 1.11
diff -u -r1.11 node.tpl.php
--- modules/node/node.tpl.php	28 Apr 2009 19:56:00 -0000	1.11
+++ modules/node/node.tpl.php	13 May 2009 21:38:38 -0000
@@ -49,30 +49,30 @@
  * @see template_preprocess_node()
  */
 ?>
-<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clearfix">
+<div id="node-<?php p($node->nid); ?>" class="node<?php if ($sticky) { p(' sticky'); } ?><?php if (!$status) { p(' node-unpublished'); } ?> clearfix">
 
-<?php print $picture ?>
+  <?php p($picture) ?>
 
-<?php if (!$page): ?>
-  <h2><a href="<?php print $node_url ?>"><?php print $title ?></a></h2>
-<?php endif; ?>
+  <?php if (!$page): ?>
+    <h2><a href="<?php p($node_url); ?>"><?php p($title); ?></a></h2>
+  <?php endif; ?>
 
   <div class="meta">
   <?php if ($submitted): ?>
-    <span class="submitted"><?php print $submitted ?></span>
+    <span class="submitted"><?php p($submitted); ?></span>
   <?php endif; ?>
 
   <?php if ($terms): ?>
-    <div class="terms terms-inline"><?php print $terms ?></div>
+    <div class="terms terms-inline"><?php p($terms); ?></div>
   <?php endif;?>
   </div>
 
   <div class="content">
-    <?php print $content ?>
+    <?php p($content); ?>
   </div>
 
-  <?php print $links; ?>
+  <?php p($links); ?>
 
-  <?php print $comments; ?>
+  <?php p($comments); ?>
 
 </div>
\ No newline at end of file
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.484
diff -u -r1.484 theme.inc
--- includes/theme.inc	12 May 2009 13:43:44 -0000	1.484
+++ includes/theme.inc	13 May 2009 21:38:38 -0000
@@ -1962,11 +1962,20 @@
   // Render any comments.
   $variables['comments']  = !empty($node->content['comments']) ? drupal_render($node->content['comments']) : '';
 
-  // Render the rest of the node into $content.
-  $variables['content'] = drupal_render($node->content);
+  // TEST CODE, DO NOT COMMIT
+  $node->content['test'] = array(
+    '#markup' => 'foo',
+    '#weight' => 300,
+  );
+  $node->content['test2'] = array(
+    '#markup' => 'bar',
+    '#weight' => 301,
+  );
 
   // Flatten the node object's member fields.
   $variables = array_merge((array)$node, $variables);
+  // Provide the render array as an object.
+  $variables['content'] = new ArrayObject($node->content);
 
   // Display post information only on certain node types.
   if (variable_get('node_submitted_' . $node->type, TRUE)) {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.899
diff -u -r1.899 common.inc
--- includes/common.inc	13 May 2009 17:23:48 -0000	1.899
+++ includes/common.inc	13 May 2009 21:38:37 -0000
@@ -3416,6 +3416,26 @@
 }
 
 /**
+ * Unified printer function for templates.
+ *
+ * @param $a
+ *   Element to print. Can be either a string, or a structured array tree.
+ */
+function p($a, $key = NULL) {
+  if (is_string($a)) {
+    $output = $a;
+  }
+  else {
+    $render = (array) $a;
+    $output = $key ? drupal_render_children($render, array($key)) : drupal_render($render);
+    if ($a instanceof ArrayObject) {
+      $a->exchangeArray($render);
+    }
+  }
+  print $output;
+}
+
+/**
  * Function used by uasort to sort structured arrays by weight.
  */
 function element_sort($a, $b) {
Index: themes/garland/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/node.tpl.php,v
retrieving revision 1.9
diff -u -r1.9 node.tpl.php
--- themes/garland/node.tpl.php	18 Feb 2009 14:28:25 -0000	1.9
+++ themes/garland/node.tpl.php	13 May 2009 21:38:38 -0000
@@ -1,34 +1,35 @@
 <?php
 // $Id: node.tpl.php,v 1.9 2009/02/18 14:28:25 webchick Exp $
 ?>
-<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
+<div id="node-<?php p($node->nid); ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
+  <?php p($picture); ?>
 
-<?php print $picture ?>
-
-<?php if ($page == 0): ?>
-  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
-<?php endif; ?>
+  <?php if ($page == 0): ?>
+    <h2><a href="<?php p($node_url); ?>" title="<?php p($title); ?>"><?php p($title); ?></a></h2>
+  <?php endif; ?>
 
   <?php if ($submitted): ?>
-    <span class="submitted"><?php print $submitted; ?></span>
+    <span class="submitted"><?php p($submitted); ?></span>
   <?php endif; ?>
 
   <div class="content clearfix">
-    <?php print $content ?>
+    <?php p($content, 'test'); ?>
+    <?php p($content); ?>
+    <?php p($content, 'test2'); ?>
   </div>
 
   <div class="clearfix">
     <div class="meta">
     <?php if ($terms): ?>
-      <div class="terms"><?php print $terms ?></div>
+      <div class="terms"><?php p($terms); ?></div>
     <?php endif;?>
     </div>
 
     <?php if ($links): ?>
-      <div class="links"><?php print $links; ?></div>
+      <div class="links"><?php p($links); ?></div>
     <?php endif; ?>
 
-    <?php print $comments; ?>
+    <?php p($comments); ?>
 
   </div>
 
