Changeset 4620 for trunk/bp-members/bp-members-notifications.php
- Timestamp:
- 07/06/2011 07:10:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-notifications.php
r4605 r4620 44 44 } 45 45 46 function bp_core_get_notifications_for_user( $user_id ) {46 function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) { 47 47 global $bp; 48 48 … … 72 72 if ( isset( $bp->{$component_name}->format_notification_function ) && function_exists( $bp->{$component_name}->format_notification_function ) ) { 73 73 $renderable[] = call_user_func( $bp->{$component_name}->format_notification_function, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count ); 74 } elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) { 75 $renderable[] = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count ); 74 } elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) { 75 if ( 'object' == $format ) { 76 $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count, 'array' ); 77 78 // Minimal backpat with non-compatible notification 79 // callback functions 80 if ( is_string( $content ) ) { 81 $notification->content = $content; 82 $notification->href = bp_loggedin_user_domain(); 83 } else { 84 $notification->content = $content['text']; 85 $notification->href = $content['link']; 86 } 87 88 $renderable[] = $notification; 89 } else { 90 $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count ); 91 $renderable[] = $content; 92 } 76 93 } 77 94 }
Note: See TracChangeset
for help on using the changeset viewer.