Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/08/2011 06:35:03 AM (14 years ago)
Author:
johnjamesjacoby
Message:

More auditing of _slug and _root_slug functions.

Introduce functions for updating '$bp->is_' globals to prevent loading $bp global in several functions.

Various phpDoc fixes and whitespace clean-up. (1.3 trunk)

File:
1 edited

Legend:

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

    r3982 r4088  
    11<?php
    2 
    3 /*******************************************************************************
    4  * Screen Functions
    5  *
    6  * Screen functions are the controllers of BuddyPress. They will execute when
    7  * their specific URL is caught. They will first save or manipulate data using
    8  * business functions, then pass on the user to a template file.
    9  */
    102
    113/**
     
    157 */
    168function bp_activity_screen_index() {
    17     global $bp;
    18 
    19     if ( !bp_displayed_user_id() && bp_is_current_component( 'activity' ) && !bp_current_action() ) {
    20         $bp->is_directory = true;
     9    if ( !bp_displayed_user_id() && bp_is_activity_component() && !bp_current_action() ) {
     10        bp_update_is_directory( true, 'activity' );
    2111
    2212        do_action( 'bp_activity_screen_index' );
     
    3323
    3424function bp_activity_screen_friends() {
    35     global $bp;
    36 
    3725    if ( !bp_is_active( 'friends' ) )
    3826        return false;
    3927
    40     if ( !is_super_admin() )
    41         $bp->is_item_admin = false;
    42 
     28    bp_update_is_item_admin( is_super_admin(), 'activity' );
    4329    do_action( 'bp_activity_screen_friends' );
    4430    bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ) );
     
    4632
    4733function bp_activity_screen_groups() {
    48     global $bp;
    49 
    5034    if ( !bp_is_active( 'groups' ) )
    5135        return false;
    5236
    53     if ( !is_super_admin() )
    54         $bp->is_item_admin = false;
    55 
     37    bp_update_is_item_admin( is_super_admin(), 'activity' );
    5638    do_action( 'bp_activity_screen_groups' );
    5739    bp_core_load_template( apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ) );
     
    5941
    6042function bp_activity_screen_favorites() {
    61     global $bp;
    62 
    63     if ( !is_super_admin() )
    64         $bp->is_item_admin = false;
    65 
     43    bp_update_is_item_admin( is_super_admin(), 'activity' );
    6644    do_action( 'bp_activity_screen_favorites' );
    6745    bp_core_load_template( apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ) );
     
    6947
    7048function bp_activity_screen_mentions() {
    71     global $bp;
    72 
    73     if ( !is_super_admin() )
    74         $bp->is_item_admin = false;
    75 
     49    bp_update_is_item_admin( is_super_admin(), 'activity' );
    7650    do_action( 'bp_activity_screen_mentions' );
    7751    bp_core_load_template( apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ) );
Note: See TracChangeset for help on using the changeset viewer.