Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/12/2010 01:17:56 AM (15 years ago)
Author:
apeatling
Message:

Fixed support for specific actions such as new update, new reply and favoriting activities when JS is turned off.

File:
1 edited

Legend:

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

    r2681 r2692  
    569569                $content .= '<div class="acomment-meta"><a href="' . bp_core_get_user_domain( $comment->user_id, $comment->user_nicename, $comment->user_login ) . '">' . apply_filters( 'bp_get_member_name', $comment->user_fullname ) . '</a> &middot; ' . sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( strtotime( $comment->date_recorded ) ) );
    570570
    571                 /* Reply link */
     571                /* Reply link - the span is so that threaded reply links can be hidden when JS is off. */
    572572                if ( is_user_logged_in() )
    573                     $content .= ' &middot; <a href="#acomment-' . $comment->id . '" class="acomment-reply" id="acomment-reply-' . $activities_template->activity->id . '">' . __( 'Reply', 'buddypress' ) . '</a>';
     573                    $content .= '<span class="acomment-replylink"> &middot; <a href="#acomment-' . $comment->id . '" class="acomment-reply" id="acomment-reply-' . $activities_template->activity->id . '">' . __( 'Reply', 'buddypress' ) . '</a></span>';
    574574
    575575                /* Delete link */
     
    615615        }
    616616
     617function bp_activity_comment_link() {
     618    echo bp_get_activity_comment_link();
     619}
     620    function bp_get_activity_comment_link() {
     621        global $activities_template;
     622        return apply_filters( 'bp_get_activity_comment_link', '?ac=' . $activities_template->activity->id . '/#ac-form-' . $activities_template->activity->id );
     623    }
     624
     625function bp_activity_comment_form_nojs_display() {
     626    echo bp_get_activity_comment_form_nojs_display();
     627}
     628    function bp_get_activity_comment_form_nojs_display() {
     629        global $activities_template;
     630        if ( $_GET['ac'] == $activities_template->activity->id . '/' )
     631            return 'style="display: block"';
     632
     633        return false;
     634    }
     635
     636function bp_activity_comment_form_action() {
     637    echo bp_get_activity_comment_form_action();
     638}
     639    function bp_get_activity_comment_form_action() {
     640        return apply_filters( 'bp_get_activity_comment_form_action', site_url( BP_ACTIVITY_SLUG . '/reply/' ) );
     641    }
     642
    617643function bp_activity_permalink_id() {
    618644    echo bp_get_activity_permalink_id();
     
    633659
    634660        return apply_filters( 'bp_get_activity_thread_permalink', $link );
     661    }
     662
     663function bp_activity_favorite_link() {
     664    echo bp_get_activity_favorite_link();
     665}
     666    function bp_get_activity_favorite_link() {
     667        global $activities_template;
     668        return apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/favorite/' . $activities_template->activity->id . '/' ), 'mark_favorite' ) );
     669    }
     670
     671function bp_activity_unfavorite_link() {
     672    echo bp_get_activity_unfavorite_link();
     673}
     674    function bp_get_activity_unfavorite_link() {
     675        global $activities_template;
     676        return apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/unfavorite/' . $activities_template->activity->id . '/' ), 'unmark_favorite' ) );
    635677    }
    636678
     
    792834    }
    793835
     836function bp_activity_post_form_action() {
     837    echo bp_get_activity_post_form_action();
     838}
     839    function bp_get_activity_post_form_action() {
     840        return apply_filters( 'bp_get_activity_post_form_action', site_url( BP_ACTIVITY_SLUG . '/post/' ) );
     841    }
    794842
    795843/* RSS Feed Template Tags ***************************/
Note: See TracChangeset for help on using the changeset viewer.