? 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 @@ 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); + } +} +