Index: plugins/content_types/user_context/user_profile.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/plugins/content_types/user_context/user_profile.inc,v
retrieving revision 1.7
diff -u -p -r1.7 user_profile.inc
--- plugins/content_types/user_context/user_profile.inc	8 Sep 2009 21:25:04 -0000	1.7
+++ plugins/content_types/user_context/user_profile.inc	12 Sep 2009 16:09:39 -0000
@@ -12,6 +12,7 @@ function ctools_user_profile_ctools_cont
     'description' => t('The profile of a user.'),
     'required context' => new ctools_context_required(t('User'), 'user'),
     'category' => t('User'),
+    'defaults' => array('keyword' => ''),
   );
 }
 
@@ -24,6 +25,11 @@ function ctools_user_profile_content_typ
     return NULL;
   }
 
+  // Pass user specified keyword to hook_profile_alter().
+  if (!empty($conf['keyword'])) {
+    $account->ctools_keyword = $conf['keyword'];
+  }
+
   // Retrieve all profile fields and attach to $account->content.
   user_build_content($account);
 
@@ -39,9 +45,35 @@ function ctools_user_profile_content_typ
  * Display the administrative title for a panel pane in the drag & drop UI.
  */
 function ctools_user_profile_content_type_admin_title($subtype, $conf, $context) {
+  if (!empty($conf['keyword'])) {
+    return t('"@s" user profile (@keyword)', array('@s' => $context->identifier, '@keyword' => $conf['keyword']));
+  }
   return t('"@s" user profile', array('@s' => $context->identifier));
 }
 
+/**
+ * Returns an edit form for custom type settings.
+ */
 function ctools_user_profile_content_type_edit_form(&$form, &$form_state) {
-  // provide a blank form so we have a place to have context setting.
+  $conf = $form_state['conf'];
+
+  $form['keyword'] = array(
+    '#type' => 'textfield',
+    '#default_value' => !empty($conf['keyword']) ? $conf['keyword'] : '',
+    '#title' => t('Keyword'),
+    '#description' => t('This keyword will be added to the account object when passed to <a href="@user-build-content">user_build_content()</a> and it can be checked from your implementation of <a href="@hook-profile-alter">hook_profile_alter()</a> to filter user profile categories. When no keyword is specified, or if you do not implement hook_profile_alter() to filter out items, the whole user profile will be rendered.', array(
+      '@user-build-content' => 'http://api.drupal.org/api/function/user_build_content/6',
+      '@hook-profile-alter' => 'http://api.drupal.org/api/function/hook_profile_alter/6',
+    )),
+  );
+}
+
+/**
+ * Submit handler for the custom type settings form.
+ */
+function ctools_user_profile_content_type_edit_form_submit(&$form, &$form_state) {
+  // Copy everything from our defaults.
+  foreach (array_keys($form_state['plugin']['defaults']) as $key) {
+    $form_state['conf'][$key] = $form_state['values'][$key];
+  }
 }
