? ajax.context.patch
Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/ajax.inc,v
retrieving revision 1.14.2.3
diff -u -p -r1.14.2.3 ajax.inc
--- includes/ajax.inc	17 Feb 2010 01:04:50 -0000	1.14.2.3
+++ includes/ajax.inc	2 Apr 2010 22:12:06 -0000
@@ -443,6 +443,45 @@ function ctools_ajax_command_submit($sel
 }
 
 /**
+ * Notify subscribers that contexts have changed.  This allows other content
+ * on the page to update based on the updated context.
+ *
+ * @param $contexts
+ *   An array of token => value pairs, denoting the updated context(s).
+ */
+function ctools_ajax_command_content_refresh($contexts) {
+  return array(
+    'command' => 'content_refresh',
+    'contexts' => $contexts,
+  );
+}
+
+/**
+ * Subscribe to receive notifications of AJAX context changes.
+ *
+ * @param $contexts
+ *   An array of contexts to update the subscribers with. The items in the 
+ *   array should take the form of token => initial_value.
+ *   Example: array(
+ *     '%node' => $node->nid,
+ *     '%user' => $user->uid,
+ *   );
+ * @param $url
+ *   The url of the ajax callback to fire when a matching context is updated.
+ */
+function ctools_ajax_content_refresh_subscribe($contexts, $url) {
+  $settings = array(
+    'content_refresh' => array(
+      array(
+        'contexts' => $contexts,
+        'url' => $url,
+      ),
+    ),
+  );
+  drupal_add_js($settings, 'setting');
+}
+
+/**
  * Render a commands array into JSON and immediately hand this back
  * to the AJAX requester.
  */
Index: js/ajax-responder.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/js/ajax-responder.js,v
retrieving revision 1.18.2.8
diff -u -p -r1.18.2.8 ajax-responder.js
--- js/ajax-responder.js	22 Feb 2010 19:50:39 -0000	1.18.2.8
+++ js/ajax-responder.js	2 Apr 2010 22:12:06 -0000
@@ -434,8 +434,37 @@
 
   Drupal.CTools.AJAX.commands.submit = function(data) {
     $(data.selector).submit();
-  }
+  };
 
+  Drupal.CTools.AJAX.commands.content_refresh = function(data) {
+    // Don't bother if there are no subscribers.
+    if (Drupal.settings.content_refresh) {
+      
+      // Loop through each of the incoming context updates.
+      $.each(data.contexts, function(token, value) {
+        
+        // Find subscribers with matching context.
+        $.each(Drupal.settings.content_refresh, function(i, o) {
+          if (o.contexts[token]) {
+            // Update the state of the subscriber's values.
+            o.contexts[token] = value;
+
+            // Build the url.
+            var url = o.url.replace(/nojs/g, 'ajax');
+
+            // Replace each token with the current value.
+            $.each(o.contexts, function(subscriber_token, subscriber_value) {
+              url = url.replace(subscriber_token, subscriber_value);
+            });
+
+            // do token replacement and make the ajax call
+            var el = $('<a href="' + url + '" />');
+            return Drupal.CTools.AJAX.clickAJAXLink.apply(el);
+          }
+        });
+      });
+    }
+  };
 
   /**
    * Bind links that will open modals to the appropriate function.
