Changeset 5687 for trunk/bp-groups/bp-groups-template.php
- Timestamp:
- 02/09/2012 11:00:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r5673 r5687 303 303 return true; 304 304 305 if ( !$group)305 if ( empty( $group ) ) 306 306 $group =& $groups_template->group; 307 307 … … 323 323 global $groups_template; 324 324 325 if ( !$group)325 if ( empty( $group ) ) 326 326 $group =& $groups_template->group; 327 327 … … 335 335 global $groups_template; 336 336 337 if ( !$group)337 if ( empty( $group ) ) 338 338 $group =& $groups_template->group; 339 339 … … 347 347 global $groups_template; 348 348 349 if ( !$group)349 if ( empty( $group ) ) 350 350 $group =& $groups_template->group; 351 351 … … 369 369 global $groups_template; 370 370 371 if ( !$group)371 if ( empty( $group ) ) 372 372 $group =& $groups_template->group; 373 373 … … 420 420 global $groups_template; 421 421 422 if ( !$group)422 if ( empty( $group ) ) 423 423 $group =& $groups_template->group; 424 424 … … 441 441 global $groups_template, $bp; 442 442 443 if ( !$group)443 if ( empty( $group ) ) 444 444 $group =& $groups_template->group; 445 445 … … 453 453 global $groups_template, $bp; 454 454 455 if ( !$group)455 if ( empty( $group ) ) 456 456 $group =& $groups_template->group; 457 457 … … 465 465 global $groups_template; 466 466 467 if ( !$group)467 if ( empty( $group ) ) 468 468 $group =& $groups_template->group; 469 469 … … 477 477 global $groups_template; 478 478 479 if ( !$group)479 if ( empty( $group ) ) 480 480 $group =& $groups_template->group; 481 481 … … 489 489 global $groups_template; 490 490 491 if ( !$group)491 if ( empty( $group ) ) 492 492 $group =& $groups_template->group; 493 493 … … 501 501 global $groups_template; 502 502 503 if ( !$group)503 if ( empty( $group ) ) 504 504 $group =& $groups_template->group; 505 505 … … 514 514 global $groups_template; 515 515 516 if ( !$group)516 if ( empty( $group ) ) 517 517 $group =& $groups_template->group; 518 518 … … 530 530 global $groups_template; 531 531 532 if ( !$group)532 if ( empty( $group ) ) 533 533 $group =& $groups_template->group; 534 534 … … 542 542 global $groups_template; 543 543 544 if ( !$group)544 if ( empty( $group ) ) 545 545 $group =& $groups_template->group; 546 546 … … 549 549 550 550 function bp_group_is_admin() { 551 global $bp; 552 553 return $bp->is_item_admin; 551 return bp_is_item_admin(); 554 552 } 555 553 556 554 function bp_group_is_mod() { 557 global $bp; 558 559 return $bp->is_item_mod; 555 return bp_is_item_mod(); 560 556 } 561 557 … … 563 559 global $groups_template; 564 560 565 if ( !$group)561 if ( empty( $group ) ) 566 562 $group =& $groups_template->group; 567 563 … … 621 617 global $groups_template; 622 618 623 if ( !$group)619 if ( empty( $group ) ) 624 620 $group =& $groups_template->group; 625 621 … … 651 647 global $groups_template; 652 648 653 if ( !$group)649 if ( empty( $group ) ) 654 650 $group =& $groups_template->group; 655 651 … … 674 670 global $groups_template, $bp; 675 671 676 if ( !$group)672 if ( empty( $group ) ) 677 673 $group =& $groups_template->group; 678 674 … … 747 743 global $groups_template; 748 744 749 if ( !$group)745 if ( empty( $group ) ) 750 746 $group =& $groups_template->group; 751 747 … … 771 767 global $groups_template; 772 768 773 if ( !$group)769 if ( empty( $group ) ) 774 770 $group =& $groups_template->group; 775 771 … … 848 844 global $groups_template; 849 845 850 if ( !$group)846 if ( empty( $group ) ) 851 847 $group =& $groups_template->group; 852 848 … … 868 864 global $groups_template; 869 865 870 if ( !$group)866 if ( empty( $group ) ) 871 867 $group =& $groups_template->group; 872 868 … … 878 874 global $groups_template; 879 875 880 if ( !$group)876 if ( empty( $group ) ) 881 877 $group =& $groups_template->group; 882 878 … … 1144 1140 global $group_mods, $groups_template; 1145 1141 1146 if ( !$group)1142 if ( empty( $group ) ) 1147 1143 $group =& $groups_template->group; 1148 1144 … … 1195 1191 global $members_template, $groups_template, $bp; 1196 1192 1197 if ( !$group)1193 if ( empty( $group ) ) 1198 1194 $group =& $groups_template->group; 1199 1195 … … 1215 1211 global $members_template, $groups_template, $bp; 1216 1212 1217 if ( !$group)1213 if ( empty( $group ) ) 1218 1214 $group =& $groups_template->group; 1219 1215 … … 1235 1231 $user_id = $members_template->member->user_id; 1236 1232 1237 if ( !$group)1233 if ( empty( $group ) ) 1238 1234 $group =& $groups_template->group; 1239 1235 … … 1253 1249 global $members_template, $groups_template; 1254 1250 1255 if ( !$group)1251 if ( empty( $group ) ) 1256 1252 $group =& $groups_template->group; 1257 1253 … … 1262 1258 global $bp, $groups_template; 1263 1259 1264 if ( !$group)1260 if ( empty( $group ) ) 1265 1261 $group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group; 1266 1262 1267 1263 $current_tab = bp_action_variable( 0 ); 1268 ?> 1269 <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?> 1264 1265 if ( bp_is_item_admin() || bp_is_item_mod() ) : ?> 1266 1270 1267 <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li> 1271 <?php } ?> 1272 1273 <?php 1274 if ( !$bp->is_item_admin)1275 return false; 1276 ?> 1268 1269 <?php endif; ?> 1270 1271 <?php if ( ! bp_is_item_admin() ) 1272 return false; ?> 1273 1277 1274 <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li> 1278 1275 1279 1276 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> 1277 1280 1278 <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li> 1279 1281 1280 <?php endif; ?> 1282 1281 … … 1284 1283 1285 1284 <?php if ( $groups_template->group->status == 'private' ) : ?> 1285 1286 1286 <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li> 1287 1287 1288 <?php endif; ?> 1288 1289 … … 1290 1291 1291 1292 <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li> 1293 1292 1294 <?php 1293 1295 } … … 1304 1306 } 1305 1307 function bp_get_group_form_action( $page, $group = false ) { 1306 global $ bp, $groups_template;1307 1308 if ( !$group)1308 global $groups_template; 1309 1310 if ( empty( $group ) ) 1309 1311 $group =& $groups_template->group; 1310 1312 … … 1318 1320 global $groups_template; 1319 1321 1320 if ( !$group)1321 $group =& $groups_template->group; 1322 1323 if ( !$page)1322 if ( empty( $group ) ) 1323 $group =& $groups_template->group; 1324 1325 if ( empty( $page ) ) 1324 1326 $page = bp_action_variable( 0 ); 1325 1327 … … 1330 1332 global $groups_template; 1331 1333 1332 if ( !$group)1334 if ( empty( $group ) ) 1333 1335 $group =& $groups_template->group; 1334 1336 … … 1347 1349 * @uses apply_filters Creates bp_group_is_member filter and passes $is_member 1348 1350 * @usedby groups/activity.php, groups/single/forum/edit.php, groups/single/forum/topic.php to determine template part visibility 1349 * @global array $bp BuddyPress Master global1350 1351 * @global object $groups_template Current Group (usually in template loop) 1351 1352 * @param object $group Group to check is_member … … 1353 1354 */ 1354 1355 function bp_group_is_member( $group = false ) { 1355 global $ bp, $groups_template;1356 global $groups_template; 1356 1357 1357 1358 // Site admins always have access … … 1359 1360 return true; 1360 1361 1361 if ( !$group)1362 if ( empty( $group ) ) 1362 1363 $group =& $groups_template->group; 1363 1364 … … 1385 1386 return false; 1386 1387 1387 if ( !$group) {1388 if ( empty( $group ) ) { 1388 1389 $group =& $groups_template->group; 1389 1390 … … 1404 1405 global $groups_template, $bp; 1405 1406 1406 if ( !$group)1407 if ( empty( $group ) ) 1407 1408 $group =& $groups_template->group; 1408 1409 … … 1416 1417 global $groups_template, $bp; 1417 1418 1418 if ( !$group)1419 if ( empty( $group ) ) 1419 1420 $group =& $groups_template->group; 1420 1421 … … 1426 1427 } 1427 1428 function bp_get_group_leave_confirm_link( $group = false ) { 1428 global $groups_template , $bp;1429 1430 if ( !$group)1429 global $groups_template; 1430 1431 if ( empty( $group ) ) 1431 1432 $group =& $groups_template->group; 1432 1433 … … 1438 1439 } 1439 1440 function bp_get_group_leave_reject_link( $group = false ) { 1440 global $groups_template , $bp;1441 1442 if ( !$group)1441 global $groups_template; 1442 1443 if ( empty( $group ) ) 1443 1444 $group =& $groups_template->group; 1444 1445 … … 1450 1451 } 1451 1452 function bp_get_group_send_invite_form_action( $group = false ) { 1452 global $groups_template , $bp;1453 1454 if ( !$group)1453 global $groups_template; 1454 1455 if ( empty( $group ) ) 1455 1456 $group =& $groups_template->group; 1456 1457 … … 1459 1460 1460 1461 function bp_has_friends_to_invite( $group = false ) { 1461 global $groups_template , $bp;1462 global $groups_template; 1462 1463 1463 1464 if ( !bp_is_active( 'friends' ) ) 1464 1465 return false; 1465 1466 1466 if ( !$group)1467 if ( empty( $group ) ) 1467 1468 $group =& $groups_template->group; 1468 1469 … … 1474 1475 1475 1476 function bp_group_new_topic_button( $group = false ) { 1476 echo bp_get_group_new_topic_button( );1477 echo bp_get_group_new_topic_button( $group ); 1477 1478 } 1478 1479 function bp_get_group_new_topic_button( $group = false ) { 1479 1480 global $groups_template; 1480 1481 1481 if ( !$group)1482 if ( empty( $group ) ) 1482 1483 $group =& $groups_template->group; 1483 1484 … … 1506 1507 } 1507 1508 function bp_get_group_join_button( $group = false ) { 1508 global $ bp, $groups_template;1509 1510 if ( !$group)1509 global $groups_template; 1510 1511 if ( empty( $group ) ) 1511 1512 $group =& $groups_template->group; 1512 1513 … … 1687 1688 1688 1689 function __construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) { 1689 global $bp;1690 1690 1691 1691 $this->pag_page = isset( $_REQUEST['mlpage'] ) ? intval( $_REQUEST['mlpage'] ) : 1; 1692 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 1693 1694 $this->members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude ); 1692 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 1693 $this->members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude ); 1695 1694 1696 1695 if ( !$max || $max >= (int)$this->members['count'] ) … … 1756 1755 1757 1756 function the_member() { 1758 global $member;1759 1757 1760 1758 $this->in_the_loop = true; 1761 $this->member = $this->next_member();1759 $this->member = $this->next_member(); 1762 1760 1763 1761 if ( 0 == $this->current_member ) // loop has just started … … 1767 1765 1768 1766 function bp_group_has_members( $args = '' ) { 1769 global $ bp, $members_template;1767 global $members_template; 1770 1768 1771 1769 $defaults = array( … … 1878 1876 } 1879 1877 function bp_get_group_member_is_banned() { 1880 global $members_template , $groups_template;1878 global $members_template; 1881 1879 1882 1880 return apply_filters( 'bp_get_group_member_is_banned', $members_template->member->is_banned ); … … 1921 1919 } 1922 1920 function bp_get_group_pag_id() { 1923 global $bp;1924 1925 1921 return apply_filters( 'bp_get_group_pag_id', 'pag' ); 1926 1922 } … … 2262 2258 2263 2259 function bp_directory_groups_search_form() { 2264 global $bp;2265 2260 2266 2261 $default_search_value = bp_get_search_default_text( 'groups' ); … … 2282 2277 */ 2283 2278 function bp_groups_header_tabs() { 2284 global $ create_group_step, $completed_to_step;2285 ?> 2279 global $bp;?> 2280 2286 2281 <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li> 2287 2282 <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/recently-joined' ) ?>"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li> … … 2290 2285 <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/mod-of' ) ?>"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li> 2291 2286 <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li> 2287 2292 2288 <?php 2293 2289 do_action( 'groups_header_tabs' ); … … 2417 2413 function __construct( $group_id, $per_page, $max ) { 2418 2414 2419 global $bp;2420 2421 2415 $this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : 1; 2422 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 2423 2416 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 2424 2417 $this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page ); 2425 2418 … … 2486 2479 2487 2480 function the_request() { 2488 global $request;2489 2490 2481 $this->in_the_loop = true; 2491 $this->request = $this->next_request();2482 $this->request = $this->next_request(); 2492 2483 2493 2484 if ( 0 == $this->current_request ) // loop has just started … … 2591 2582 2592 2583 function __construct( $user_id, $group_id ) { 2593 2594 global $bp; 2595 2596 $this->invites = groups_get_invites_for_group( $user_id, $group_id ); 2584 $this->invites = groups_get_invites_for_group( $user_id, $group_id ); 2597 2585 $this->invite_count = count( $this->invites ); 2598 2599 2586 } 2600 2587 … … 2633 2620 2634 2621 function the_invite() { 2635 global $invite, $group_id; 2636 2637 $this->in_the_loop = true; 2638 $user_id = $this->next_invite(); 2639 2640 $this->invite = new stdClass; 2641 $this->invite->user = new BP_Core_User( $user_id ); 2622 global $group_id; 2623 2624 $this->in_the_loop = true; 2625 $user_id = $this->next_invite(); 2626 $this->invite = new stdClass; 2627 $this->invite->user = new BP_Core_User( $user_id ); 2642 2628 $this->invite->group_id = $group_id; // Globaled in bp_group_has_invites() 2643 2629
Note: See TracChangeset
for help on using the changeset viewer.