Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2011 05:41:37 PM (15 years ago)
Author:
boonebgorges
Message:

Pass concatenated alt parameter to bp_core_fetch_avatar() throughout activity component. References #3806

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r5447 r5477  
    899899
    900900                $defaults = array(
    901                         'alt'     => __( 'Profile picture of %s', 'buddypress' ),
     901                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ),
    902902                        'class'   => 'avatar',
    903903                        'email'   => false,
     
    990990                switch ( $activities_template->activity->component ) {
    991991                        case 'groups' :
    992                                 $object = 'group';
     992                                $object  = 'group';
    993993                                $item_id = $activities_template->activity->item_id;
    994 
    995                                 if ( empty( $alt ) )
    996                                         $alt = __( 'Group logo of %s', 'buddypress' );
     994                               
     995                                if ( empty( $alt ) ) {
     996                                        $group = groups_get_group( $item_id );
     997                                        if ( isset( $group->name ) ) {
     998                                                $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $group->name );
     999                                        } else {
     1000                                                $alt = __( 'Group logo', 'buddypress' );
     1001                                        }
     1002                                }
    9971003
    9981004                                break;
    9991005                        case 'blogs' :
    1000                                 $object = 'blog';
     1006                                $object  = 'blog';
    10011007                                $item_id = $activities_template->activity->item_id;
    10021008
    1003                                 if ( !$alt )
    1004                                         $alt = sprintf( __( 'Site authored by %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );
     1009                                if ( !$alt ) {
     1010                                        $alt = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );
     1011                                }
    10051012
    10061013                                break;
     
    10091016                                $item_id = $activities_template->activity->secondary_item_id;
    10101017
    1011                                 if ( empty( $alt ) )
    1012                                         $alt = __( 'Profile picture of %s', 'buddypress' );
     1018                                if ( empty( $alt ) ) {
     1019                                        $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) );
     1020                                }
    10131021
    10141022                                break;
     
    10161024                                $object  = 'user';
    10171025                                $item_id = $activities_template->activity->user_id;
    1018                                 $email = $activities_template->activity->user_email;
    1019 
    1020                                 if ( !$alt )
    1021                                         $alt = __( 'Profile picture of %s', 'buddypress' );
     1026                                $email   = $activities_template->activity->user_email;
     1027
     1028                                if ( !$alt ) {
     1029                                        $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name );
     1030                                }
    10221031
    10231032                                break;
Note: See TracChangeset for help on using the changeset viewer.