Changeset 3685
- Timestamp:
- 01/09/2011 05:40:12 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
bp-activity/bp-activity-templatetags.php (modified) (1 diff)
-
bp-blogs/bp-blogs-templatetags.php (modified) (1 diff)
-
bp-core/bp-core-classes.php (modified) (6 diffs)
-
bp-core/bp-core-templatetags.php (modified) (1 diff)
-
bp-friends/bp-friends-templatetags.php (modified) (5 diffs)
-
bp-groups/bp-groups-templatetags.php (modified) (5 diffs)
-
bp-messages/bp-messages-templatetags.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r3670 r3685 1051 1051 'link_href' => bp_get_send_public_message_link(), 1052 1052 'link_title' => __( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ), 1053 'link_text' => __( 'Mention this User', 'buddypress' ) 1053 'link_text' => __( 'Mention this User', 'buddypress' ), 1054 'link_class' => 'activity-button mention' 1054 1055 ); 1055 1056 -
trunk/bp-blogs/bp-blogs-templatetags.php
r3666 r3685 540 540 'wrapper_class' => 'blog-button visit', 541 541 'link_href' => bp_get_blog_permalink(), 542 'link_class' => ' visit',542 'link_class' => 'blog-button visit', 543 543 'link_text' => __( 'Visit Blog', 'buddypress' ), 544 544 'link_title' => __( 'Visit Blog', 'buddypress' ), -
trunk/bp-core/bp-core-classes.php
r3592 r3685 547 547 var $block_self; 548 548 549 // Wrapper div 549 // Wrapper 550 var $wrapper; 550 551 var $wrapper_class; 551 552 var $wrapper_id; … … 570 571 * must_be_logged_in: Button only appears for logged in users 571 572 * block_self: Button will not appear when viewing your own profile. 573 * wrapper: div|span|p|li|false for no wrapper 572 574 * wrapper_id: The DOM ID of the button wrapper 573 575 * wrapper_class: The DOM class of the button wrapper … … 584 586 function bp_button( $args = '' ) { 585 587 588 // Default arguments 586 589 $defaults = array( 587 590 'id' => '', … … 590 593 'block_self' => true, 591 594 595 'wrapper' => 'div', 592 596 'wrapper_id' => '', 593 597 'wrapper_class' => '', … … 609 613 $this->must_be_logged_in = (bool)$must_be_logged_in; 610 614 $this->block_self = (bool)$block_self; 615 $this->wrapper = $wrapper; 611 616 612 617 // $id and $component are required … … 627 632 628 633 // Wrapper properties 629 if ( !empty( $wrapper_id ) ) 630 $this->wrapper_id = ' id="' . $wrapper_id . '"'; 631 632 if ( !empty( $wrapper_class ) ) 633 $this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"'; 634 else 635 $this->wrapper_class = ' class="generic-button"'; 634 if ( false !== $this->wrapper ) { 635 636 // Wrapper ID 637 if ( !empty( $wrapper_id ) ) 638 $this->wrapper_id = ' id="' . $wrapper_id . '"'; 639 640 // Wrapper class 641 if ( !empty( $wrapper_class ) ) 642 $this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"'; 643 else 644 $this->wrapper_class = ' class="generic-button"'; 645 646 // Set before and after 647 $before = '<' . $wrapper . $this->wrapper_class . $this->wrapper_id . '>'; 648 $after = '</' . $wrapper . '>'; 649 650 // No wrapper 651 } else { 652 $before = $after = ''; 653 } 636 654 637 655 // Link properties 638 656 if ( !empty( $link_id ) ) 639 $this->link_id = ' id="' . $link_id . '"';657 $this->link_id = ' id="' . $link_id . '"'; 640 658 641 659 if ( !empty( $link_href ) ) 642 $this->link_href = ' href="' . $link_href . '"';660 $this->link_href = ' href="' . $link_href . '"'; 643 661 644 662 if ( !empty( $link_title ) ) 645 $this->link_title = ' title="' . $link_title . '"';663 $this->link_title = ' title="' . $link_title . '"'; 646 664 647 665 if ( !empty( $link_rel ) ) 648 $this->link_rel = ' rel="' . $link_rel . '"';666 $this->link_rel = ' rel="' . $link_rel . '"'; 649 667 650 668 if ( !empty( $link_class ) ) 651 $this->link_class = ' class="' . $link_class . '"';669 $this->link_class = ' class="' . $link_class . '"'; 652 670 653 671 if ( !empty( $link_text ) ) 654 $this->link_text = $link_text;672 $this->link_text = $link_text; 655 673 656 674 // Build the button 657 $this->contents = '<div' . $this->wrapper_class . $this->wrapper_id . '>'; 658 $this->contents .= '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>'; 659 $this->contents .= '</div>'; 675 $this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after; 660 676 661 677 // Allow button to be manipulated externally 662 $this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this );678 $this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this, $before, $after ); 663 679 } 664 680 -
trunk/bp-core/bp-core-templatetags.php
r3666 r3685 1116 1116 1117 1117 /** 1118 * bp_button( $button )1119 *1120 1118 * Creates and outputs a button. 1121 * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text1122 * 1123 * @ param array $button1119 * 1120 * @param array $args See bp_get_button() for the list of arguments. 1121 * @see bp_get_button() 1124 1122 */ 1125 function bp_button( $ button= '' ) {1126 echo bp_get_button( $ button);1123 function bp_button( $args = '' ) { 1124 echo bp_get_button( $args ); 1127 1125 } 1128 1126 /** 1129 * bp_get_button( $button )1127 * Creates and returns a button. 1130 1128 * 1131 * Creates and returns a button. 1132 * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text 1129 * Args: 1130 * component: Which component this button is for 1131 * must_be_logged_in: Button only appears for logged in users 1132 * block_self: Button will not appear when viewing your own profile. 1133 * wrapper: div|span|p|li| 1134 * wrapper_id: The DOM ID of the button wrapper 1135 * wrapper_class: The DOM class of the button wrapper 1136 * link_href: The destination link of the button 1137 * link_title: Title of the button 1138 * link_id: The DOM ID of the button 1139 * link_class: The DOM class of the button 1140 * link_rel: The DOM rel of the button 1141 * link_text: The contents of the button 1133 1142 * 1134 1143 * @param array $button 1135 1144 * @return string 1145 * @see bp_add_friend_button() 1146 * @see bp_send_public_message_button() 1147 * @see bp_send_private_message_button() 1136 1148 */ 1137 function bp_get_button( $ button= '' ) {1138 $b tn = new BP_Button( $button);1139 return apply_filters( 'bp_get_button', $b tn->contents, $button );1149 function bp_get_button( $args = '' ) { 1150 $button = new BP_Button( $args ); 1151 return apply_filters( 'bp_get_button', $button->contents, $args, $button ); 1140 1152 } 1141 1153 -
trunk/bp-friends/bp-friends-templatetags.php
r3523 r3685 220 220 'wrapper_class' => 'friendship-button pending', 221 221 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 222 'link_class' => 'requested',223 222 'link_href' => trailingslashit( $bp->loggedin_user->domain . $bp->friends->slug . '/requests' ), 224 223 'link_text' => __( 'Friendship Requested', 'buddypress' ), 225 'link_title' => __( 'Friendship Requested', 'buddypress' ) 224 'link_title' => __( 'Friendship Requested', 'buddypress' ), 225 'link_class' => 'friendship-button pending requested' 226 226 ); 227 227 break; … … 235 235 'wrapper_class' => 'friendship-button is_friend', 236 236 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 237 'link_class' => '',238 237 'link_href' => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ), 239 238 'link_text' => __( 'Cancel Friendship', 'buddypress' ), … … 241 240 'link_id' => 'friend-' . $potential_friend_id, 242 241 'link_rel' => 'remove', 243 'link_class' => ' remove'242 'link_class' => 'friendship-button is_friend remove' 244 243 ); 245 244 break; … … 253 252 'wrapper_class' => 'friendship-button not_friends', 254 253 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 255 'link_class' => '',256 254 'link_href' => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ), 257 255 'link_text' => __( 'Add Friend', 'buddypress' ), … … 259 257 'link_id' => 'friend-' . $potential_friend_id, 260 258 'link_rel' => 'add', 261 'link_class' => ' add'259 'link_class' => 'friendship-button not_friends add' 262 260 ); 263 261 break; -
trunk/bp-groups/bp-groups-templatetags.php
r3648 r3685 1151 1151 'wrapper_class' => 'group-button', 1152 1152 'link_href' => '#post-new', 1153 'link_class' => ' ',1153 'link_class' => 'group-button', 1154 1154 'link_id' => 'new-topic-button', 1155 1155 'link_text' => __( 'New Topic', 'buddypress' ), … … 1192 1192 'wrapper_class' => 'group-button ' . $group->status, 1193 1193 'wrapper_id' => 'groupbutton-' . $group->id, 1194 'link_class' => 'leave-group',1195 1194 'link_href' => wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ), 1196 1195 'link_text' => __( 'Leave Group', 'buddypress' ), 1197 'link_title' => __( 'Leave Group', 'buddypress' ) 1196 'link_title' => __( 'Leave Group', 'buddypress' ), 1197 'link_class' => 'group-button leave-group', 1198 1198 ); 1199 1199 … … 1215 1215 'wrapper_class' => 'group-button ' . $group->status, 1216 1216 'wrapper_id' => 'groupbutton-' . $group->id, 1217 'link_class' => 'join-group',1218 1217 'link_href' => wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ), 1219 1218 'link_text' => __( 'Join Group', 'buddypress' ), 1220 'link_title' => __( 'Join Group', 'buddypress' ) 1219 'link_title' => __( 'Join Group', 'buddypress' ), 1220 'link_class' => 'group-button join-group', 1221 1221 ); 1222 1222 break; … … 1233 1233 'wrapper_class' => 'group-button ' . $group->status, 1234 1234 'wrapper_id' => 'groupbutton-' . $group->id, 1235 'link_class' => 'request-membership',1236 1235 'link_href' => wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ), 1237 1236 'link_text' => __( 'Request Membership', 'buddypress' ), 1238 1237 'link_title' => __( 'Request Membership', 'buddypress' ), 1238 'link_class' => 'group-button request-membership', 1239 1239 ); 1240 1240 … … 1248 1248 'wrapper_class' => 'group-button pending ' . $group->status, 1249 1249 'wrapper_id' => 'groupbutton-' . $group->id, 1250 'link_class' => 'membership-requested',1251 1250 'link_href' => bp_get_group_permalink( $group ), 1252 1251 'link_text' => __( 'Request Sent', 'buddypress' ), 1253 1252 'link_title' => __( 'Request Sent', 'buddypress' ), 1253 'link_class' => 'group-button pending membership-requested', 1254 1254 ); 1255 1255 } -
trunk/bp-messages/bp-messages-templatetags.php
r3616 r3685 548 548 'wrapper_id' => 'send-private-message', 549 549 'link_href' => bp_get_send_private_message_link(), 550 'link_title' => __( 'Send a private message to this user.', 'buddypress' ), 551 'link_text' => __( 'Send Private Message', 'buddypress' ), 550 552 'link_class' => 'send-message', 551 'link_title' => __( 'Send a private message to this user.', 'buddypress' ),552 'link_text' => __( 'Send Private Message', 'buddypress' )553 553 ) ) 554 554 );
Note: See TracChangeset
for help on using the changeset viewer.