Skip to:
Content

BuddyPress.org

Changeset 5349


Ignore:
Timestamp:
11/24/2011 02:23:20 AM (14 years ago)
Author:
boonebgorges
Message:

Allow users to edit their own forum posts, even when they're no longer part of the group in question. Fixes #3640

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/groups/single/forum/edit.php

    r4961 r5349  
    3939        </div>
    4040
    41         <?php if ( bp_group_is_member() ) : ?>
     41        <?php if ( bp_is_edit_topic() ) : ?>
    4242
    43             <?php if ( bp_is_edit_topic() ) : ?>
     43            <div id="edit-topic">
    4444
    45                 <div id="edit-topic">
     45                <?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
    4646
    47                     <?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
     47                <label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label>
     48                <input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" />
    4849
    49                     <label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label>
    50                     <input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" />
     50                <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label>
     51                <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
    5152
    52                     <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label>
    53                     <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
     53                <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
     54                <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" />
    5455
    55                     <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
    56                     <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" />
     56                <?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
    5757
    58                     <?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
     58                <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
    5959
    60                     <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
     60                <?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
    6161
    62                     <?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
     62            </div>
    6363
    64                 </div>
     64        <?php else : ?>
    6565
    66             <?php else : ?>
     66            <div id="edit-post">
    6767
    68                 <div id="edit-post">
     68                <?php do_action( 'bp_group_before_edit_forum_post' ); ?>
    6969
    70                     <?php do_action( 'bp_group_before_edit_forum_post' ); ?>
     70                <textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
    7171
    72                     <textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
     72                <?php do_action( 'bp_group_after_edit_forum_post' ) ?>
    7373
    74                     <?php do_action( 'bp_group_after_edit_forum_post' ) ?>
     74                <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
    7575
    76                     <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
     76                <?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
    7777
    78                     <?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
    79 
    80                 </div>
    81 
    82             <?php endif; ?>
     78            </div>
    8379
    8480        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.