Changeset 4414
- Timestamp:
- 11/15/2012 05:42:38 AM (11 years ago)
- Location:
- trunk/includes/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/admin.php
r4391 r4414 129 129 /** Ajax **************************************************************/ 130 130 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' ) );133 131 add_action( 'wp_ajax_bbp_suggest_topic', array( $this, 'suggest_topic' ) ); 134 132 add_action( 'wp_ajax_nopriv_bbp_suggest_topic', array( $this, 'suggest_topic' ) ); … … 538 536 <script type="text/javascript"> 539 537 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 } );549 538 550 539 var bbp_topic_id = jQuery( '#bbp_topic_id' ); … … 1258 1247 1259 1248 /** Ajax ******************************************************************/ 1260 1261 /**1262 * Ajax action for facilitating the forum auto-suggest1263 *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 forums1274 $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 them1285 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 }1292 1249 1293 1250 /** -
trunk/includes/admin/metaboxes.php
r4261 r4414 299 299 <strong class="label"><?php _e( 'Parent:', 'bbpress' ); ?></strong> 300 300 <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' => __( '— No parent —', 'bbpress' ), 316 'none_found' => false, 317 'disable_categories' => true, 318 'disabled' => '' 319 ) ); ?> 302 320 </p> 303 321 … … 339 357 <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong> 340 358 <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' => __( '— No parent —', 'bbpress' ), 374 'none_found' => false, 375 'disable_categories' => true, 376 'disabled' => '' 377 ) ); ?> 342 378 </p> 343 379 … … 374 410 <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong> 375 411 <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' => __( '— No parent —', 'bbpress' ), 427 'none_found' => false, 428 'disable_categories' => true, 429 'disabled' => '' 430 ) ); ?> 377 431 </p> 378 432 -
trunk/includes/admin/settings.php
r4396 r4414 923 923 */ 924 924 function 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' => __( '— Forum root —', '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 ) ); ?> 936 935 937 936 <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.