? bio-delete-user-174507-12.patch
? bio-fields-on-registration-182266-and-required.patch
? bio-fields-on-registration-182266-default-values.patch
? bio-fields-on-registration-182266-validating.patch
? bio-fields-on-registration-182266.patch
? bio-panels-200708.patch
? bio-respect-node-type-defaults-199705.patch
? bio.module-151572.patch
? bio_fix_defaults_1.patch
Index: bio.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/bio/bio.module,v
retrieving revision 1.2.2.17
diff -u -p -r1.2.2.17 bio.module
--- bio.module	17 Dec 2007 02:04:58 -0000	1.2.2.17
+++ bio.module	15 Jan 2008 05:47:29 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: bio.module,v 1.2.2.17 2007/12/17 02:04:58 webchick Exp $
 
+// Panels integration.
+if (module_exists('panels')) {
+  include_once drupal_get_path('module', 'bio') .'/bio_panels.inc';
+}
+
 /** 
  * Implementation of hook_init()
  */
Index: bio_panels.inc
===================================================================
RCS file: bio_panels.inc
diff -N bio_panels.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bio_panels.inc	15 Jan 2008 05:47:29 -0000
@@ -0,0 +1,47 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Panels integration for Bio modue.
+ */
+
+/**
+ * Plugin to provide a relationship handler for node from user.
+ */
+function bio_panels_relationships() {
+  $bio_type = variable_get('bio_nodetype', 'bio');
+  $args['node_from_user'] = array(
+    'title' => t('User @type', array('@type' => $bio_type)),
+    'keyword' => 'node',
+    'description' => t("Adds a user's @type node.", array('@type' => $bio_type)),
+    'required context' => new panels_required_context(t('User'), 'user'),
+    'context' => 'bio_panels_context',
+  );
+
+  return $args;
+}
+
+/**
+ * Return a new context based on an existing context.
+ */
+function bio_panels_context($context = NULL, $conf) {
+  // If unset it wants a generic, unfilled context, which is just NULL.
+  if (empty($context->data)) {
+    return panels_context_create_empty('node', NULL);
+  }
+
+  if (isset($context->data->uid)) {
+    // Load the NID for the user's bio node.
+    $nid = bio_for_user($context->data->uid);
+    
+    // Load the node object itself.
+    $bionode = node_load(array('nid'=>$nid));
+    
+    // Send it to Panels.
+    return panels_context_create('node', $bionode);
+  } else {
+    return panels_context_create_empty('node', NULL);
+  }   
+}
+
