Changeset 6783
- Timestamp:
- 02/11/2013 02:01:12 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-template.php
r6697 r6783 1142 1142 } 1143 1143 1144 /** 1145 * Is the current component an active core component. 1146 * 1147 * Use this function when you need to check if the current component is an 1148 * active core component of BuddyPress. If the current component is inactive, it 1149 * will return false. If the current component is not part of BuddyPress core, 1150 * it will return false. If the current component is active, and is part of 1151 * BuddyPress core, it will return true. 1152 * 1153 * @since BuddyPress (1.7) 1154 * @return boolean 1155 */ 1156 function bp_is_current_component_core() { 1157 $retval = false; 1158 $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); 1159 1160 foreach ( array_keys( $active_components ) as $active_component ) { 1161 if ( bp_is_current_component( $active_component ) ) { 1162 $retval = true; 1163 break; 1164 } 1165 } 1166 1167 return $retval; 1168 } 1169 1144 1170 /** Activity ******************************************************************/ 1145 1171 -
trunk/bp-templates/bp-legacy/buddypress/members/single/blogs.php
r6284 r6783 30 30 </div><!-- .item-list-tabs --> 31 31 32 <?php do_action( 'bp_before_member_blogs_content' ); ?> 32 <?php 33 switch ( bp_current_action() ) : 33 34 34 <div class="blogs myblogs" role="main"> 35 // Home/My Blogs 36 case 'my-groups' : 37 do_action( 'bp_before_member_blogs_content' ); ?> 35 38 36 <?php bp_get_template_part( 'blogs/blogs-loop' ) ?>39 <div class="blogs myblogs" role="main"> 37 40 38 </div><!-- .blogs.myblogs -->41 <?php bp_get_template_part( 'blogs/blogs-loop' ) ?> 39 42 40 <?php do_action( 'bp_after_member_blogs_content' ); ?> 43 </div><!-- .blogs.myblogs --> 44 45 <?php do_action( 'bp_after_member_blogs_content' ); 46 break; 47 48 // Any other 49 default : 50 bp_get_template_part( 'members/single/plugins' ); 51 break; 52 endswitch; -
trunk/bp-templates/bp-legacy/buddypress/members/single/friends.php
r6284 r6783 35 35 36 36 <?php 37 switch ( bp_current_action() ) : 37 38 38 if ( bp_is_current_action( 'requests' ) ) : 39 bp_get_template_part( 'members/single/friends/requests' ); 39 // Home/My Friends 40 case 'my-friends' : 41 do_action( 'bp_before_member_friends_content' ); ?> 40 42 41 else : 42 do_action( 'bp_before_member_friends_content' ); ?> 43 <div class="members friends"> 43 44 44 <div class="members friends">45 <?php bp_get_template_part( 'members/members-loop' ) ?> 45 46 46 < ?php bp_get_template_part( 'members/members-loop' ) ?>47 </div><!-- .members.friends --> 47 48 48 </div><!-- .members.friends --> 49 <?php do_action( 'bp_after_member_friends_content' ); 50 break; 49 51 50 <?php do_action( 'bp_after_member_friends_content' ); ?> 52 case 'requests' : 53 bp_get_template_part( 'members/single/friends/requests' ); 54 break; 51 55 52 <?php endif; ?> 56 // Any other 57 default : 58 bp_get_template_part( 'members/single/plugins' ); 59 break; 60 endswitch; -
trunk/bp-templates/bp-legacy/buddypress/members/single/groups.php
r6284 r6783 37 37 <?php 38 38 39 if ( bp_is_current_action( 'invites' ) ) : 40 bp_get_template_part( 'members/single/groups/invites' ); 39 switch ( bp_current_action() ) : 41 40 42 else : 43 do_action( 'bp_before_member_groups_content' ); ?> 41 // Home/My Groups 42 case 'my-groups' : 43 do_action( 'bp_before_member_groups_content' ); ?> 44 44 45 <div class="groups mygroups">45 <div class="groups mygroups"> 46 46 47 <?php bp_get_template_part( 'groups/groups-loop' ); ?>47 <?php bp_get_template_part( 'groups/groups-loop' ); ?> 48 48 49 </div>49 </div> 50 50 51 <?php do_action( 'bp_after_member_groups_content' ); ?> 51 <?php do_action( 'bp_after_member_groups_content' ); 52 break; 52 53 53 <?php endif; ?> 54 // Group Invitations 55 case 'invites' : 56 bp_get_template_part( 'members/single/groups/invites' ); 57 break; 58 59 // Any other 60 default : 61 bp_get_template_part( 'members/single/plugins' ); 62 break; 63 endswitch; -
trunk/bp-templates/bp-legacy/buddypress/members/single/messages.php
r6284 r6783 26 26 27 27 <?php 28 switch ( bp_current_action() ) : 28 29 29 if ( bp_is_current_action( 'compose' ) ) : 30 bp_get_template_part( 'members/single/messages/compose' ); 31 32 elseif ( bp_is_current_action( 'view' ) ) : 33 bp_get_template_part( 'members/single/messages/single' ); 34 35 else : 30 // Inbox/Sentbox 31 case 'inbox' : 32 case 'sentbox' : 36 33 do_action( 'bp_before_member_messages_content' ); ?> 37 34 38 <div class="messages" role="main"> 35 <div class="messages" role="main"> 36 <?php bp_get_template_part( 'members/single/messages/messages-loop' ); ?> 37 </div><!-- .messages --> 39 38 40 <?php 41 if ( bp_is_current_action( 'notices' ) ) 42 bp_get_template_part( 'members/single/messages/notices-loop' ); 43 else 44 bp_get_template_part( 'members/single/messages/messages-loop' ); 45 ?> 39 <?php do_action( 'bp_after_member_messages_content' ); 40 break; 46 41 47 </div><!-- .messages --> 42 // Single Message View 43 case 'view' : 44 bp_get_template_part( 'members/single/messages/single' ); 45 break; 48 46 49 <?php do_action( 'bp_after_member_messages_content' ); ?> 47 // Compose 48 case 'compose' : 49 bp_get_template_part( 'members/single/messages/compose' ); 50 break; 50 51 51 <?php endif; ?> 52 // Sitewide Notices 53 case 'notices' : 54 do_action( 'bp_before_member_messages_content' ); ?> 55 56 <div class="messages" role="main"> 57 <?php bp_get_template_part( 'members/single/messages/notices-loop' );; ?> 58 </div><!-- .messages --> 59 60 <?php do_action( 'bp_after_member_messages_content' ); 61 break; 62 63 // Any other 64 default : 65 bp_get_template_part( 'members/single/plugins' ); 66 break; 67 endswitch; -
trunk/bp-templates/bp-legacy/buddypress/members/single/plugins.php
r6346 r6783 13 13 <?php do_action( 'bp_before_member_plugin_template' ); ?> 14 14 15 <?php if ( ! bp_is_current_component_core() ) : ?> 16 15 17 <div class="item-list-tabs no-ajax" id="subnav"> 16 18 <ul> … … 21 23 </div><!-- .item-list-tabs --> 22 24 25 <?php endif; ?> 26 23 27 <h3><?php do_action( 'bp_template_title' ); ?></h3> 24 28 -
trunk/bp-templates/bp-legacy/buddypress/members/single/profile.php
r6284 r6783 26 26 <div class="profile" role="main"> 27 27 28 <?php 29 // Profile Edit 30 if ( bp_is_current_action( 'edit' ) ) 31 bp_get_template_part( 'members/single/profile/edit' ); 28 <?php switch ( bp_current_action() ) : 32 29 33 // Change Avatar 34 elseif ( bp_is_current_action( 'change-avatar' ) ) 35 bp_get_template_part( 'members/single/profile/change-avatar' ); 30 // Edit 31 case 'edit' : 32 bp_get_template_part( 'members/single/profile/edit' ); 33 break; 34 35 // Change Avatar 36 case 'change-avatar' : 37 bp_get_template_part( 'members/single/profile/change-avatar' ); 38 break; 39 40 // Compose 41 case 'public' : 36 42 37 43 // Display XProfile 38 elseif ( bp_is_active( 'xprofile' ) )44 if ( bp_is_active( 'xprofile' ) ) 39 45 bp_get_template_part( 'members/single/profile/profile-loop' ); 40 46 41 47 // Display WordPress profile (fallback) 42 48 else 43 bp_get_template_part( 'members/single/profile/profile-wp' ) 44 ?> 49 bp_get_template_part( 'members/single/profile/profile-wp' ); 45 50 51 break; 52 53 // Any other 54 default : 55 bp_get_template_part( 'members/single/plugins' ); 56 break; 57 endswitch; ?> 46 58 </div><!-- .profile --> 47 59
Note: See TracChangeset
for help on using the changeset viewer.