Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/22/2011 10:13:25 AM (14 years ago)
Author:
johnjamesjacoby
Message:

First pass at normalizing bp-default template files. This includes:

A ton of code cleanup
Using new functions found in BP 1.3
Template header documentation
Improve pagination style and position on root component templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/activity/post-form.php

    r3771 r3810  
    1 <form action="<?php bp_activity_post_form_action() ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
     1<?php
    22
    3     <?php do_action( 'bp_before_activity_post_form' ) ?>
     3/**
     4 * BuddyPress - Activity Post Form
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
     13
     14    <?php do_action( 'bp_before_activity_post_form' ); ?>
    415
    516    <?php if ( isset( $_GET['r'] ) ) : ?>
    617        <div id="message" class="info">
    7             <p><?php printf( __( 'You are mentioning %s in a new update, this user will be sent a notification of your message.', 'buddypress' ), bp_get_mentioned_user_display_name( $_GET['r'] ) ) ?></p>
     18            <p><?php printf( __( 'You are mentioning %s in a new update, this user will be sent a notification of your message.', 'buddypress' ), bp_get_mentioned_user_display_name( $_GET['r'] ) ); ?></p>
    819        </div>
    920    <?php endif; ?>
    1021
    1122    <div id="whats-new-avatar">
    12         <a href="<?php echo bp_loggedin_user_domain() ?>">
    13             <?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?>
     23        <a href="<?php echo bp_loggedin_user_domain(); ?>">
     24            <?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?>
    1425        </a>
    1526    </div>
    1627
    17     <h5>
    18         <?php if ( bp_is_group() ) : ?>
    19             <?php printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() ) ?>
    20         <?php else : ?>
    21             <?php printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname() ) ?>
    22         <?php endif; ?>
    23     </h5>
     28    <h5><?php if ( bp_is_group() )
     29            printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() );
     30        else
     31            printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname() );
     32    ?></h5>
    2433
    2534    <div id="whats-new-content">
    2635        <div id="whats-new-textarea">
    27             <textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ) ?> <?php endif; ?></textarea>
     36            <textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ); ?> <?php endif; ?></textarea>
    2837        </div>
    2938
     
    3140            <div id="whats-new-submit">
    3241                <span class="ajax-loader"></span> &nbsp;
    33                 <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ) ?>" />
     42                <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ); ?>" />
    3443            </div>
    3544
    3645            <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
     46
    3747                <div id="whats-new-post-in-box">
     48
    3849                    <?php _e( 'Post in', 'buddypress' ) ?>:
    3950
    4051                    <select id="whats-new-post-in" name="whats-new-post-in">
    41                         <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ) ?></option>
     52                        <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
    4253
    43                         <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : while ( bp_groups() ) : bp_the_group(); ?>
    44                             <option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
    45                         <?php endwhile; endif; ?>
     54                        <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) :
     55                            while ( bp_groups() ) : bp_the_group(); ?>
     56
     57                                <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
     58
     59                            <?php endwhile;
     60                        endif; ?>
     61
    4662                    </select>
    4763                </div>
    4864                <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
     65
    4966            <?php elseif ( bp_is_group_home() ) : ?>
     67
    5068                <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    51                 <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id() ?>" />
     69                <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
     70
    5271            <?php endif; ?>
    5372
    54             <?php do_action( 'bp_activity_post_form_options' ) ?>
     73            <?php do_action( 'bp_activity_post_form_options' ); ?>
    5574
    5675        </div><!-- #whats-new-options -->
     
    5877
    5978    <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
    60     <?php do_action( 'bp_after_activity_post_form' ) ?>
     79    <?php do_action( 'bp_after_activity_post_form' ); ?>
    6180
    6281</form><!-- #whats-new-form -->
Note: See TracChangeset for help on using the changeset viewer.