Skip to:
Content

BuddyPress.org

Changeset 3728 for trunk/bp-activity.php


Ignore:
Timestamp:
01/18/2011 12:53:31 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Code normalization and whitespace clean-up. Introduce bp-core-deprecated.php. Introduce root_slug globals into components with directories, to help with WP page slugs. Fixes #2600. Optimus Props boonebgorges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3666 r3728  
    11<?php
     2
     3// Required Files
    24require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-classes.php' );
    35require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-templatetags.php' );
     
    79    global $bp, $current_blog;
    810
     11    // Define a slug, if necessary
    912    if ( !defined( 'BP_ACTIVITY_SLUG' ) )
    10         define ( 'BP_ACTIVITY_SLUG', $bp->pages->activity->slug );
     13        define( 'BP_ACTIVITY_SLUG', bp_core_component_slug_from_root_slug( $bp->pages->activity->slug ) );
    1114
    1215    // For internal identification
    13     $bp->activity->id = 'activity';
     16    $bp->activity->id   = 'activity';
    1417    $bp->activity->name = $bp->pages->activity->name;
    15     $bp->activity->slug = BP_ACTIVITY_SLUG;
    16 
     18
     19    // Slugs
     20    $bp->activity->slug      = BP_ACTIVITY_SLUG;
     21    $bp->activity->root_slug = $bp->pages->activity->slug;
     22
     23    // Tables
    1724    $bp->activity->table_name      = $bp->table_prefix . 'bp_activity';
    1825    $bp->activity->table_name_meta = $bp->table_prefix . 'bp_activity_meta';
    1926
     27    // Notifications
    2028    $bp->activity->format_notification_function = 'bp_activity_format_notifications';
    2129
     
    3846    $user_domain = ( isset( $bp->displayed_user->domain ) ) ? $bp->displayed_user->domain : $bp->loggedin_user->domain;
    3947    $user_login = ( isset( $bp->displayed_user->userdata->user_login ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
    40     $activity_link = $user_domain . $bp->activity->name . '/';
     48    $activity_link = $user_domain . $bp->activity->slug . '/';
    4149
    4250    /* Add the subnav items to the activity nav item if we are using a theme that supports this */
     
    4452
    4553    if ( bp_is_active( 'friends' ) )
    46         bp_core_new_subnav_item( array( 'name' => __( 'Friends', 'buddypress' ), 'slug' => BP_FRIENDS_SLUG, 'parent_url' => $activity_link, 'parent_slug' => $bp->activity->name, 'screen_function' => 'bp_activity_screen_friends', 'position' => 20, 'item_css_id' => 'activity-friends' ) );
     54        bp_core_new_subnav_item( array( 'name' => __( 'Friends', 'buddypress' ), 'slug' => BP_FRIENDS_SLUG, 'parent_url' => $activity_link, 'parent_slug' => $bp->activity->slug, 'screen_function' => 'bp_activity_screen_friends', 'position' => 20, 'item_css_id' => 'activity-friends' ) );
    4755
    4856    if ( bp_is_active( 'groups' ) )
    49         bp_core_new_subnav_item( array( 'name' => __( 'Groups', 'buddypress' ), 'slug' => BP_GROUPS_SLUG, 'parent_url' => $activity_link, 'parent_slug' => $bp->activity->name, 'screen_function' => 'bp_activity_screen_groups', 'position' => 30, 'item_css_id' => 'activity-groups' ) );
     57        bp_core_new_subnav_item( array( 'name' => __( 'Groups', 'buddypress' ), 'slug' => BP_GROUPS_SLUG, 'parent_url' => $activity_link, 'parent_slug' => $bp->activity->slug, 'screen_function' => 'bp_activity_screen_groups', 'position' => 30, 'item_css_id' => 'activity-groups' ) );
    5058
    5159    bp_core_new_subnav_item( array( 'name' => __( 'Favorites', 'buddypress' ), 'slug' => 'favorites', 'parent_url' => $activity_link, 'parent_slug' => $bp->activity->name, 'screen_function' => 'bp_activity_screen_favorites', 'position' => 40, 'item_css_id' => 'activity-favs' ) );
     
    6068        }
    6169    }
    62 
     70   
    6371    do_action( 'bp_activity_setup_nav' );
    6472}
Note: See TracChangeset for help on using the changeset viewer.