Skip to:
Content

bbPress.org

Changeset 4414


Ignore:
Timestamp:
11/15/2012 05:42:38 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Forums Admin:

  • Revert usage of Suggest for choosing a forum parent via auto-complete.
  • Revert parts of r4260 and r4261.
  • See #1910, #2014.
Location:
trunk/includes/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/admin.php

    r4391 r4414  
    129129        /** Ajax **************************************************************/
    130130
    131         add_action( 'wp_ajax_bbp_suggest_forum',        array( $this, 'suggest_forum' ) );
    132         add_action( 'wp_ajax_nopriv_bbp_suggest_forum', array( $this, 'suggest_forum' ) );
    133131        add_action( 'wp_ajax_bbp_suggest_topic',        array( $this, 'suggest_topic' ) );
    134132        add_action( 'wp_ajax_nopriv_bbp_suggest_topic', array( $this, 'suggest_topic' ) );
     
    538536        <script type="text/javascript">
    539537            jQuery(document).ready(function() {
    540 
    541                 var bbp_forum_id = jQuery( '#bbp_forum_id' );
    542 
    543                 bbp_forum_id.suggest( ajaxurl + '?action=bbp_suggest_forum', {
    544                     onSelect: function() {
    545                         var value = this.value;
    546                         bbp_forum_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
    547                     }
    548                 } );
    549538
    550539                var bbp_topic_id = jQuery( '#bbp_topic_id' );
     
    12581247
    12591248    /** Ajax ******************************************************************/
    1260 
    1261     /**
    1262      * Ajax action for facilitating the forum auto-suggest
    1263      *
    1264      * @since bbPress (r4261)
    1265      *
    1266      * @uses get_posts()
    1267      * @uses bbp_get_forum_post_type()
    1268      * @uses bbp_get_forum_id()
    1269      * @uses bbp_get_forum_title()
    1270      */
    1271     public function suggest_forum() {
    1272 
    1273         // Try to get some forums
    1274         $forums = get_posts( array(
    1275             's'           => like_escape( $_REQUEST['q'] ),
    1276             'post_type'   => bbp_get_forum_post_type(),
    1277             'post_status' => array(
    1278                 bbp_get_public_status_id(),
    1279                 bbp_get_hidden_status_id(),
    1280                 bbp_get_private_status_id()
    1281             )
    1282         ) );
    1283 
    1284         // If we found some forums, loop through and display them
    1285         if ( ! empty( $forums ) ) {
    1286             foreach ( (array) $forums as $post ) {
    1287                 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_forum_id( $post->ID ), bbp_get_forum_title( $post->ID ) ) . "\n";
    1288             }
    1289         }
    1290         die();
    1291     }
    12921249
    12931250    /**
  • trunk/includes/admin/metaboxes.php

    r4261 r4414  
    299299        <strong class="label"><?php _e( 'Parent:', 'bbpress' ); ?></strong>
    300300        <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum Parent', 'bbpress' ); ?></label>
    301         <input name="parent_id" id="bbp_forum_id" type="text" value="<?php echo esc_attr( $post_parent ); ?>" />
     301        <?php bbp_dropdown( array(
     302            'post_type'          => bbp_get_forum_post_type(),
     303            'selected'           => $post_parent,
     304            'sort_column'        => 'post_title',
     305            'child_of'           => '0',
     306            'numberposts'        => -1,
     307            'order'              => 'DESC',
     308            'walker'             => '',
     309            'exclude'            => $post_id,
     310
     311            // Output-related
     312            'select_id'          => 'parent_id',
     313            'tab'                => bbp_get_tab_index(),
     314            'options_only'       => false,
     315            'show_none'          => __( '&mdash; No parent &mdash;', 'bbpress' ),
     316            'none_found'         => false,
     317            'disable_categories' => true,
     318            'disabled'           => ''
     319        ) ); ?>
    302320    </p>
    303321
     
    339357        <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong>
    340358        <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
    341         <input name="parent_id" id="bbp_forum_id" type="text" value="<?php bbp_topic_forum_id( $post_id ); ?>" />
     359        <?php bbp_dropdown( array(
     360            'post_type'          => bbp_get_forum_post_type(),
     361            'selected'           => bbp_get_topic_forum_id( $post_id ),
     362            'sort_column'        => 'post_title',
     363            'child_of'           => '0',
     364            'numberposts'        => -1,
     365            'order'              => 'DESC',
     366            'walker'             => '',
     367            'exclude'            => '',
     368
     369            // Output-related
     370            'select_id'          => 'parent_id',
     371            'tab'                => bbp_get_tab_index(),
     372            'options_only'       => false,
     373            'show_none'          => __( '&mdash; No parent &mdash;', 'bbpress' ),
     374            'none_found'         => false,
     375            'disable_categories' => true,
     376            'disabled'           => ''
     377        ) ); ?>
    342378    </p>
    343379
     
    374410            <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong>
    375411            <label class="screen-reader-text" for="bbp_forum_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
    376             <input name="bbp_forum_id" id="bbp_forum_id" type="text" value="<?php echo esc_attr( $reply_forum_id ); ?>" />
     412            <?php bbp_dropdown( array(
     413                'post_type'          => bbp_get_forum_post_type(),
     414                'selected'           => $reply_forum_id,
     415                'sort_column'        => 'post_title',
     416                'child_of'           => '0',
     417                'numberposts'        => -1,
     418                'order'              => 'DESC',
     419                'walker'             => '',
     420                'exclude'            => '',
     421
     422                // Output-related
     423                'select_id'          => 'bbp_forum_id',
     424                'tab'                => bbp_get_tab_index(),
     425                'options_only'       => false,
     426                'show_none'          => __( '&mdash; No parent &mdash;', 'bbpress' ),
     427                'none_found'         => false,
     428                'disable_categories' => true,
     429                'disabled'           => ''
     430            ) ); ?>
    377431        </p>
    378432
  • trunk/includes/admin/settings.php

    r4396 r4414  
    923923 */
    924924function bbp_admin_setting_callback_group_forums_root_id() {
    925 ?>
    926 
    927     <?php
    928         bbp_dropdown( array(
    929             'selected'           => bbp_get_group_forums_root_id(),
    930             'show_none'          => __( '(Forum Root)', 'bbpress' ),
    931             'select_id'          => '_bbp_group_forums_root_id',
    932             'disable_categories' => false,
    933             'disabled'           => '_bbp_group_forums_root_id'
    934         ) );
    935     ?>
     925
     926    // Output the dropdown for all forums
     927    bbp_dropdown( array(
     928        'selected'           => bbp_get_group_forums_root_id(),
     929        'show_none'          => __( '&mdash; Forum root &mdash;', 'bbpress' ),
     930        'sort_column'        => 'post_title',
     931        'select_id'          => '_bbp_group_forums_root_id',
     932        'disable_categories' => false,
     933        'disabled'           => '_bbp_group_forums_root_id'
     934    ) ); ?>
    936935
    937936    <label for="_bbp_group_forums_root_id"><?php _e( 'is the parent for all group forums', 'bbpress' ); ?></label>
Note: See TracChangeset for help on using the changeset viewer.