Index: notifications.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notifications/notifications.module,v
retrieving revision 1.6.2.9.2.50.2.10
diff -u -r1.6.2.9.2.50.2.10 notifications.module
--- notifications.module	16 Jun 2009 15:23:09 -0000	1.6.2.9.2.50.2.10
+++ notifications.module	11 Aug 2009 13:56:00 -0000
@@ -1678,25 +1678,33 @@
 /**
  * Display a form field for a notifications_field
  */
-function notifications_subscription_form_field($type, $value = NULL) {
+function notifications_subscription_form_field($type, $value = NULL, $subtype = NULL) {
   $info = notifications_subscription_fields($type);
   
   if (!empty($info['options callback'])) {
     $element['#type'] = 'select';
-    $element['#options'] =  call_user_func($info['options callback']);
+    if (!empty($info['options callback args'])) {
+      $element['#options'] = call_user_func($info['options callback'], $subtype, $info['options callback args']);
+    } else {
+      $element['#options'] = call_user_func($info['options callback'], $subtype);
+    }
   }
   elseif (!empty($info['autocomplete path'])) {
     $element['#type'] = 'textfield';
     $element['#autocomplete_path'] = $info['autocomplete path'];
     if ($value) {
       if (!empty($info['autocomplete callback'])) {
-        $value = call_user_func($info['autocomplete callback'], $value);
+        if (!empty($info['autocomplete callback args'])) {
+          $value = call_user_func($info['autocomplete callback'], $value, $subtype, $info['autocomplete callback args']);
+        } else {
+          $value = call_user_func($info['autocomplete callback'], $value, $subtype);
+        }
       }
       elseif (!empty($info['format callback']))  {
         if (!empty($info['format callback args'])) {
-          $value = call_user_func($info['format callback'], $value, FALSE, $info['format callback args']);
+          $value = call_user_func($info['format callback'], $value, FALSE, $subtype, $info['format callback args']);
         } else {
-          $value = call_user_func($info['format callback'], $value, FALSE);
+          $value = call_user_func($info['format callback'], $value, FALSE, $subtype);
         }
       }      
     }
@@ -1728,7 +1736,7 @@
   // Get field names and values formatting each field
   if (!empty($subscription->fields)) {
     foreach (_notifications_fields($subscription->fields) as $field) {
-      $item = notifications_format_subscription_field($field->type, $field->value, $html);
+      $item = notifications_format_subscription_field($field->type, $field->value, $html, $subscription->type);
       $names[] = $item['name'];
       $values[] = $item['value'];
     }
@@ -1757,20 +1765,24 @@
  * @return array()
  *   Array with 'name' and 'value' elements
  */
-function notifications_format_subscription_field($type, $value, $html = TRUE) {
+function notifications_format_subscription_field($type, $value, $html = TRUE, $subtype = NULL) {
   $format_name = $format_value = t('Unknown');
  
   if ($info = notifications_subscription_fields($type)) {
     $format_name = $info['name'];
     if (!empty($info['format callback'])) {
       if (!empty($info['format callback args'])) {
-        $format_value = call_user_func($info['format callback'], $value, $html, $info['format callback args']);
+        $format_value = call_user_func($info['format callback'], $value, $html, $subtype, $info['format callback args']);
       } else {
-        $format_value = call_user_func($info['format callback'], $value, $html);
+        $format_value = call_user_func($info['format callback'], $value, $html, $subtype);
       }
     }
     elseif (!empty($info['options callback'])) {
-      $options = call_user_func($info['options callback']);
+      if (!empty($info['options callback args'])) {
+        $options = call_user_func($info['options callback'], $subtype, $info['options callback args']);
+      } else {
+        $options = call_user_func($info['options callback'], $subtype);
+      }
       $format_value = isset($options[$value]) ? $options[$value] : t('Not available');
     }
     else {
Index: notifications.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notifications/Attic/notifications.pages.inc,v
retrieving revision 1.1.2.8.2.6
diff -u -r1.1.2.8.2.6 notifications.pages.inc
--- notifications.pages.inc	16 Jun 2009 15:23:09 -0000	1.1.2.8.2.6
+++ notifications.pages.inc	11 Aug 2009 13:56:00 -0000
@@ -82,7 +82,7 @@
   foreach ($info['fields'] as $fid => $field_type) {
     $field = notifications_subscription_fields($field_type);
     $form['info']['fields'][$fid]['type'] = array('#type' => 'value', '#value' => $field_type);
-    $form['info']['fields'][$fid]['value'] = notifications_subscription_form_field($field_type);
+    $form['info']['fields'][$fid]['value'] = notifications_subscription_form_field($field_type, NULL, $type);
     $form['info']['fields'][$fid]['value'] += array(
       '#title' => $field['name'],
       '#required' => TRUE,   
@@ -125,9 +125,9 @@
     $value = $field['value'];
     if ($callback = notifications_subscription_fields($field['type'], 'value callback')) {
       if ($args = notifications_subscription_fields($field['type'], 'value callback args')) {
-        $value = call_user_func($callback, $value, "fields][$fid][value", $args);
+        $value = call_user_func($callback, $value, "fields][$fid][value", $form_state['values']['type'], $args);
       } else {
-        $value = call_user_func($callback, $value, "fields][$fid][value");
+        $value = call_user_func($callback, $value, "fields][$fid][value", $form_state['values']['type']);
       }
     }
     // If we still have a value (mapping may have failed, go and save)
Index: notifications_content/notifications_content.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notifications/notifications_content/notifications_content.module,v
retrieving revision 1.4.2.9.2.36.2.11
diff -u -r1.4.2.9.2.36.2.11 notifications_content.module
--- notifications_content/notifications_content.module	17 Jul 2009 21:27:37 -0000	1.4.2.9.2.36.2.11
+++ notifications_content/notifications_content.module	11 Aug 2009 13:56:00 -0000
@@ -260,7 +260,7 @@
         'field' => 'author',
         'type' => 'int',
         'autocomplete path' => 'user/autocomplete',
-        'autocomplete callback' => 'notifications_content_author_name',
+        'autocomplete callback' => 'notifications_content_author_name_callback',
         'format callback' => 'notifications_content_author_name',
         'value callback' => 'notifications_content_author_uid',
       );
@@ -268,7 +268,7 @@
         'name' => t('Node type'),
         'field' => 'type',
         'type' => 'string',
-        'options callback' => 'notifications_content_types',
+        'options callback' => 'notifications_content_types_callback',
       );
       return $fields;
 
@@ -390,6 +390,18 @@
 }
 
 /**
+ * Wrapper for author autocomplete callback.
+ *
+ * @param $uid
+ *   uid of the author for which to return the name.
+ * @param $subs_type
+ *   Optional type of subscription for which to find allowed content types. Defaults to nodetype, can be any subscription type with event-type=node for which notifications_content handles content type settings.
+ */
+function notifications_content_author_name_callback($uid, $subs_type = '') {
+  return notifications_content_author_name($uid);
+}
+
+/**
  * Field name callback, author uid to user name
  */
 function notifications_content_author_name($uid, $html = FALSE) {
@@ -750,6 +762,16 @@
 }
 
 /**
+ * Wrapper for options callback based on subscription type.
+ *
+ * @param $subs_type
+ *   Optional type of subscription for which to find allowed content types. Defaults to nodetype, can be any subscription type with event-type=node for which notifications_content handles content type settings.
+ */
+function notifications_content_types_callback($subs_type = 'nodetype') {
+  return notifications_content_types('name', $subs_type);
+}
+
+/**
  * Get content types available for subscriptions to content type
  * 
  * @param $field
