Skip to:
Content

BuddyPress.org

Changeset 5343


Ignore:
Timestamp:
11/21/2011 08:57:54 PM (10 years ago)
Author:
djpaul
Message:

See #3660. Tidy markup and fix number i18n.

File:
1 edited

Legend:

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

    r5341 r5343  
    159159    );
    160160
     161    $dev = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'dev.' : '';
     162
    161163    // Enqueue CSS and JavaScript
    162     if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
    163         wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . 'bp-activity/admin/js/admin.dev.js', array( 'jquery', 'wp-ajax-response' ), '20111120' );
    164         wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . 'bp-activity/admin/css/admin.dev.css', array(), '20111120' );
    165 
    166     } else {
    167         wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . 'bp-activity/admin/js/admin.js', array( 'jquery', 'wp-ajax-response' ), '20111120' );
    168         wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . 'bp-activity/admin/css/admin.css', array(), '20111120' );
    169     }
     164    wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$dev}js", array( 'jquery', 'wp-ajax-response' ), '20111120' );
     165    wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$dev}css", array(), '20111120' );
    170166
    171167    // Create the Activity screen list table
     
    307303
    308304        if ( $deleted > 0 )
    309             $messages[] = sprintf( _n( '%s activity was permanently deleted.', '%s activities were permanently deleted.', $deleted, 'buddypress' ), $deleted );
     305            $messages[] = sprintf( _n( '%s activity was permanently deleted.', '%s activities were permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
    310306
    311307        if ( $error > 0 )
    312             $messages[] = sprintf( __( 'An error occured when updating Activity ID #%d.', 'buddypress' ), $error );
     308            $messages[] = sprintf( __( 'An error occured when updating Activity ID #%s.', 'buddypress' ), number_format_i18n( $error ) );
    313309
    314310        if ( $spammed > 0 )
    315             $messages[] = sprintf( _n( '%s activity marked as spam.', '%s activities marked as spam.', $spammed, 'buddypress' ), $spammed );
     311            $messages[] = sprintf( _n( '%s activity marked as spam.', '%s activities marked as spam.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) );
    316312
    317313        if ( $unspammed > 0 )
    318             $messages[] = sprintf( _n( '%s activity restored from the spam.', '%s activities restored from the spam.', $unspammed, 'buddypress' ), $unspammed );
     314            $messages[] = sprintf( _n( '%s activity restored from the spam.', '%s activities restored from the spam.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
    319315
    320316    // Handle the edit screen
     
    332328        <h2>
    333329            <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
    334                 <?php printf( __( 'Activity (ID #%d)', 'buddypress' ), (int) $_REQUEST['aid'] ); ?>
     330                <?php printf( __( 'Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
    335331            <?php else : ?>
    336332                <?php _e( 'Activity', 'buddypress' ); ?>
     
    352348            <?php $bp_activity_list_table->search_box( __( 'Search Activities', 'buddypress' ), 'bp-activity' ); ?>
    353349
    354             <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
     350            <input type="hidden" name="page" value="<?php echo esc_attr( (int) $_REQUEST['page'] ); ?>" />
    355351            <?php $bp_activity_list_table->display(); ?>
    356352        </form>
     
    594590        <ul class="subsubsub">
    595591            <li class="all"><a href="<?php echo esc_attr( esc_url( $redirect_to ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
    596             <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%d)</span>', 'buddypress' ), $this->spam_count ); ?></a></li>
     592            <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
    597593        </ul>
    598594    <?php
     
    812808            return;
    813809
    814         $root_activity_id = (int) $root_activity_id[1];
     810        $root_activity_id  = (int) $root_activity_id[1];
     811        $root_activity_url = network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id );
    815812
    816813        // Is $item the root activity?
     
    819816
    820817            // Get root activity comment count
    821             $comment_count = !empty( $root_activity->children ) ? bp_activity_recurse_comment_count( $root_activity ) : 0;
     818            $comment_count = !empty( $root_activity->children ) ? number_format_i18n( bp_activity_recurse_comment_count( $root_activity ) ) : 0;
     819            $title_attr    = sprintf( __( '%s related activities', 'buddypress' ), $comment_count );
    822820
    823821            // Display a link to the root activity's permalink, with its comment count in a speech bubble
    824             printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$d</span></a>',  network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
     822            printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
    825823
    826824        // $item is not the root activity (it is probably an activity_comment).
     
    828826            $comment_count = count( BP_Activity_Activity::get_child_comments( $item['id'] ) );
    829827
    830             /// If a non-root activity has zero (child) comments, then don't show a zero bubble to keep the UI tidy
     828            // If a non-root activity has zero (child) comments, then don't show a zero bubble to keep the UI tidy
    831829            if ( 0 == $comment_count ) {
    832830                echo '<br />';
    833831
    834832            } else {
     833                $comment_count = number_format_i18n( $comment_count );
     834                $title_attr    = sprintf( __( '%s related activities', 'buddypress' ), $comment_count );
     835
    835836                // Display a link to the root activity's permalink, with the current activity's (child) comment count in a speech bubble
    836                 printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$d</span></a>',  network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
     837                printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
    837838            }
    838839        }
Note: See TracChangeset for help on using the changeset viewer.