Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/01/2011 09:01:00 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Fix issue where post form values would disappear when editing or creating a new topic. Addresses topic portion of #1466.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/form-topic.php

    r2943 r2976  
    3737                                        <?php endif; ?>
    3838
    39                                         <?php do_action( 'bbp_template_notices' ); ?>
    40 
    4139                                        <div>
    4240                                                <div class="alignright avatar">
     
    5048                                                <p>
    5149                                                        <label for="bbp_topic_title"><?php _e( 'Topic Title:', 'bbpress' ); ?></label><br />
    52                                                         <input type="text" id="bbp_topic_title" value="<?php echo ( bbp_is_topic_edit() && !empty( $post->post_title ) ) ? $post->post_title : ''; ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_title" />
     50                                                        <input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_title" />
    5351                                                </p>
    5452
    5553                                                <p>
    5654                                                        <label for="bbp_topic_content"><?php _e( 'Topic Description:', 'bbpress' ); ?></label><br />
    57                                                         <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="52" rows="6"><?php echo ( bbp_is_topic_edit() && !empty( $post->post_content ) ) ? $post->post_content : ''; ?></textarea>
     55                                                        <textarea id="bbp_topic_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_topic_content" cols="52" rows="6"><?php bbp_form_topic_content(); ?></textarea>
    5856                                                </p>
    5957
     
    6765                                                        <p>
    6866                                                                <label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
    69                                                                 <input type="text" value="" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" />
     67                                                                <input type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" />
    7068                                                        </p>
    7169
     
    7674                                                        <p>
    7775                                                                <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    78                                                                 <?php bbp_dropdown( array( 'selected' => bbp_is_topic_edit() ? bbp_get_topic_forum_id() : 0 ) ); ?>
     76                                                                <?php bbp_dropdown( array( 'selected' => bbp_get_form_topic_forum() ) ); ?>
    7977                                                        </p>
    8078
     
    9694
    9795                                                        <p>
    98                                                                 <?php if ( bbp_is_topic_edit() && $post->post_author != bbp_get_current_user_id() ) : ?>
     96                                                                <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
    9997
    100                                                                         <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php checked( true, bbp_is_user_subscribed( $post->post_author ) ); ?> tabindex="<?php bbp_tab_index(); ?>" />
     98                                                                <?php if ( bbp_is_topic_edit() && ( $post->post_author != bbp_get_current_user_id() ) ) : ?>
     99                                                                       
    101100                                                                        <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    102101
    103102                                                                <?php else : ?>
    104103
    105                                                                         <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php checked( true, bbp_is_user_subscribed( bbp_get_user_id( 0, false, true ) ) ); ?> tabindex="<?php bbp_tab_index(); ?>" />
    106104                                                                        <label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    107105
     
    116114                                                                <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
    117115                                                                <div>
    118                                                                         <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
     116                                                                        <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />
    119117                                                                        <label for="bbp_log_topic_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
    120118                                                                </div>
     
    122120                                                                <div>
    123121                                                                        <label for="bbp_topic_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
    124                                                                         <input type="text" value="" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_edit_reason" id="bbp_topic_edit_reason" />
     122                                                                        <input type="text" value="<?php bbp_form_topic_edit_reason(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_edit_reason" id="bbp_topic_edit_reason" />
    125123                                                                </div>
    126124                                                        </fieldset>
Note: See TracChangeset for help on using the changeset viewer.