Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/12/2015 05:45:14 AM (10 years ago)
Author:
tw2113
Message:

Further documentation cleanup for Activity Component.

See #6396.

File:
1 edited

Legend:

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

    r10081 r10253  
    1111 */
    1212
    13 // Exit if accessed directly
     13// Exit if accessed directly.
    1414defined( 'ABSPATH' ) || exit;
    1515
     
    253253    $bp = buddypress();
    254254
    255     // No displayed user or not viewing activity component
     255    // No displayed user or not viewing activity component.
    256256    if ( !bp_is_activity_component() )
    257257        return false;
     
    260260        return false;
    261261
    262     // Get the activity details
     262    // Get the activity details.
    263263    $activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only', ) );
    264264
     
    272272    }
    273273
    274     // Default access is true
     274    // Default access is true.
    275275    $has_access = true;
    276276
    277     // If activity is from a group, do an extra cap check
     277    // If activity is from a group, do an extra cap check.
    278278    if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) {
    279279
    280         // Activity is from a group, but groups is currently disabled
     280        // Activity is from a group, but groups is currently disabled.
    281281        if ( !bp_is_active( 'groups') ) {
    282282            bp_do_404();
     
    285285
    286286        // Check to see if the group is not public, if so, check the
    287         // user has access to see this activity
     287        // user has access to see this activity.
    288288        if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
    289289
    290             // Group is not public
     290            // Group is not public.
    291291            if ( 'public' != $group->status ) {
    292292
    293                 // User is not a member of group
     293                // User is not a member of group.
    294294                if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
    295295                    $has_access = false;
     
    318318    do_action( 'bp_activity_screen_single_activity_permalink', $activity, $has_access );
    319319
    320     // Access is specifically disallowed
     320    // Access is specifically disallowed.
    321321    if ( false === $has_access ) {
    322322
    323         // User feedback
     323        // User feedback.
    324324        bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' );
    325325
    326         // Redirect based on logged in status
     326        // Redirect based on logged in status.
    327327        if ( is_user_logged_in() ) {
    328328            $url = bp_loggedin_user_domain();
     
    442442    public function is_activity() {
    443443
    444         // Bail if not looking at a group
     444        // Bail if not looking at a group.
    445445        if ( ! bp_is_activity_component() )
    446446            return;
    447447
    448         // Activity Directory
     448        // Activity Directory.
    449449        if ( ! bp_displayed_user_id() && ! bp_current_action() ) {
    450450            bp_update_is_directory( true, 'activity' );
     
    457457            add_filter( 'bp_replace_the_content',                    array( $this, 'directory_content'    ) );
    458458
    459         // Single activity
     459        // Single activity.
    460460        } elseif ( bp_is_single_activity() ) {
    461461            add_filter( 'bp_get_buddypress_template',                array( $this, 'single_template_hierarchy' ) );
     
    475475     *
    476476     * @param string $templates The templates from bp_get_theme_compat_templates().
    477      *
    478477     * @return array $templates Array of custom templates to look for.
    479478     */
     
    492491
    493492        // Merge new templates with existing stack
    494         // @see bp_get_theme_compat_templates()
     493        // @see bp_get_theme_compat_templates().
    495494        $templates = array_merge( (array) $new_templates, $templates );
    496495
     
    536535     *
    537536     * @param string $templates The templates from bp_get_theme_compat_templates().
    538      *
    539537     * @return array $templates Array of custom templates to look for.
    540538     */
     
    553551
    554552        // Merge new templates with existing stack
    555         // @see bp_get_theme_compat_templates()
     553        // @see bp_get_theme_compat_templates().
    556554        $templates = array_merge( (array) $new_templates, $templates );
    557555
Note: See TracChangeset for help on using the changeset viewer.