Changeset 4261
- Timestamp:
- 10/19/2012 01:14:09 PM (13 years ago)
- Location:
- trunk/bbp-includes/admin
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbp-includes/admin/admin.php
r4260 r4261 99 99 require( $this->admin_dir . 'replies.php' ); 100 100 require( $this->admin_dir . 'users.php' ); 101 require( $this->admin_dir . 'ajax.php' );102 101 } 103 102 … … 121 120 add_action( 'bbp_register_admin_settings', array( $this, 'register_admin_settings' ) ); // Add settings 122 121 add_action( 'bbp_activation', array( $this, 'new_install' ) ); // Add menu item to settings menu 122 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Add enqueued JS and CSS 123 123 add_action( 'wp_dashboard_setup', array( $this, 'dashboard_widget_right_now' ) ); // Forums 'Right now' Dashboard widget 124 125 /** Ajax **************************************************************/ 126 127 add_action( 'wp_ajax_bbp_suggest_forum', array( $this, 'suggest_forum' ) ); 128 add_action( 'wp_ajax_nopriv_bbp_suggest_forum', array( $this, 'suggest_forum' ) ); 129 add_action( 'wp_ajax_bbp_suggest_topic', array( $this, 'suggest_topic' ) ); 130 add_action( 'wp_ajax_nopriv_bbp_suggest_topic', array( $this, 'suggest_topic' ) ); 124 131 125 132 /** Filters ***********************************************************/ … … 468 475 469 476 /** 477 * Enqueue any admin scripts we might need 478 * @since bbPress (4260) 479 */ 480 public function enqueue_scripts() { 481 wp_enqueue_script( 'suggest' ); 482 } 483 484 /** 470 485 * Add some general styling to the admin area 471 486 * … … 503 518 $topic_class = sanitize_html_class( bbp_get_topic_post_type() ); 504 519 $reply_class = sanitize_html_class( bbp_get_reply_post_type() ); ?> 520 521 <script type="text/javascript"> 522 jQuery(document).ready(function() { 523 524 var bbp_forum_id = jQuery( '#bbp_forum_id' ); 525 526 bbp_forum_id.suggest( ajaxurl + '?action=bbp_suggest_forum', { 527 onSelect: function() { 528 var value = this.value; 529 bbp_forum_id.val( value.substr( 0, value.indexOf( ' ' ) ) ); 530 } 531 } ); 532 533 var bbp_topic_id = jQuery( '#bbp_topic_id' ); 534 535 bbp_topic_id.suggest( ajaxurl + '?action=bbp_suggest_topic', { 536 onSelect: function() { 537 var value = this.value; 538 bbp_topic_id.val( value.substr( 0, value.indexOf( ' ' ) ) ); 539 } 540 } ); 541 }); 542 </script> 505 543 506 544 <style type="text/css" media="screen"> … … 1177 1215 } 1178 1216 1217 /** Ajax ******************************************************************/ 1218 1219 /** 1220 * Ajax action for facilitating the forum auto-suggest 1221 * 1222 * @since bbPress (rxxxx) 1223 * 1224 * @uses get_posts() 1225 * @uses bbp_get_forum_post_type() 1226 * @uses bbp_get_forum_id() 1227 * @uses bbp_get_forum_title() 1228 */ 1229 public function suggest_forum() { 1230 foreach ( get_posts( array( 's' => like_escape( $_REQUEST['q'] ), 'post_type' => bbp_get_forum_post_type() ) ) as $post ) { 1231 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_forum_id( $post->ID ), bbp_get_forum_title( $post->ID ) ) . "\n"; 1232 } 1233 die(); 1234 } 1235 1236 /** 1237 * Ajax action for facilitating the forum auto-suggest 1238 * 1239 * @since bbPress (rxxxx) 1240 * 1241 * @uses get_posts() 1242 * @uses bbp_get_topic_post_type() 1243 * @uses bbp_get_topic_id() 1244 * @uses bbp_get_topic_title() 1245 */ 1246 public function suggest_topic() { 1247 foreach ( get_posts( array( 's' => like_escape( $_REQUEST['q'] ), 'post_type' => bbp_get_topic_post_type() ) ) as $post ) { 1248 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) ) . "\n"; 1249 } 1250 die(); 1251 } 1252 1179 1253 /** About *****************************************************************/ 1180 1254 -
trunk/bbp-includes/admin/metaboxes.php
r4260 r4261 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" value="<?php echo esc_attr( $post_parent ); ?>" />301 <input name="parent_id" id="bbp_forum_id" type="text" value="<?php echo esc_attr( $post_parent ); ?>" /> 302 302 </p> 303 303 … … 330 330 $post_id = get_the_ID(); ?> 331 331 332 <p><strong><?php _e( 'Topic Type', 'bbpress' ); ?></strong></p> 333 334 <p> 332 <p> 333 <strong class="label"><?php _e( 'Type:', 'bbpress' ); ?></strong> 335 334 <label class="screen-reader-text" for="bbp_stick_topic"><?php _e( 'Topic Type', 'bbpress' ); ?></label> 336 335 <?php bbp_topic_type_select( array( 'topic_id' => $post_id ) ); ?> 337 336 </p> 338 337 339 <p><strong><?php _e( 'Forum', 'bbpress' ); ?></strong></p> 340 341 <p> 338 <p> 339 <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong> 342 340 <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum', 'bbpress' ); ?></label> 343 341 <input name="parent_id" id="bbp_forum_id" type="text" value="<?php bbp_topic_forum_id( $post_id ); ?>" /> … … 373 371 if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?> 374 372 375 <p><strong><?php _e( 'Forum', 'bbpress' ); ?></strong></p>376 377 373 <p> 374 <strong class="label"><?php _e( 'Forum:', 'bbpress' ); ?></strong> 378 375 <label class="screen-reader-text" for="bbp_forum_id"><?php _e( 'Forum', 'bbpress' ); ?></label> 379 376 <input name="bbp_forum_id" id="bbp_forum_id" type="text" value="<?php echo esc_attr( $reply_forum_id ); ?>" /> … … 382 379 <?php endif; ?> 383 380 384 <p><strong><?php _e( 'Topic', 'bbpress' ); ?></strong></p> 385 386 <p> 381 <p> 382 <strong class="label"><?php _e( 'Topic:', 'bbpress' ); ?></strong> 387 383 <label class="screen-reader-text" for="parent_id"><?php _e( 'Topic', 'bbpress' ); ?></label> 388 384 <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" /> … … 414 410 if ( bbp_is_reply_anonymous( $post_id ) || bbp_is_topic_anonymous( $post_id ) ) : ?> 415 411 416 <p><strong><?php _e( 'Name', 'bbpress' ); ?></strong></p>417 418 412 <p> 413 <strong class="label"><?php _e( 'Name:', 'bbpress' ); ?></strong> 419 414 <label class="screen-reader-text" for="bbp_anonymous_name"><?php _e( 'Name', 'bbpress' ); ?></label> 420 <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_name', true ) ); ?>" size="25"/>415 <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_name', true ) ); ?>" /> 421 416 </p> 422 417 423 <p><strong><?php _e( 'Email', 'bbpress' ); ?></strong></p>424 425 418 <p> 419 <strong class="label"><?php _e( 'Email:', 'bbpress' ); ?></strong> 426 420 <label class="screen-reader-text" for="bbp_anonymous_email"><?php _e( 'Email', 'bbpress' ); ?></label> 427 <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_email', true ) ); ?>" size="25"/>421 <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_email', true ) ); ?>" /> 428 422 </p> 429 423 430 <p><strong><?php _e( 'Website', 'bbpress' ); ?></strong></p>431 432 424 <p> 425 <strong class="label"><?php _e( 'Website:', 'bbpress' ); ?></strong> 433 426 <label class="screen-reader-text" for="bbp_anonymous_website"><?php _e( 'Website', 'bbpress' ); ?></label> 434 <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_website', true ) ); ?>" size="25"/>427 <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_website', true ) ); ?>" /> 435 428 </p> 436 429 437 430 <?php endif; ?> 438 431 439 <p><strong><?php _e( 'IP Address', 'bbpress' ); ?></strong></p> 440 441 <p> 432 <p> 433 <strong class="label"><?php _e( 'IP:', 'bbpress' ); ?></strong> 442 434 <label class="screen-reader-text" for="bbp_author_ip_address"><?php _e( 'IP Address', 'bbpress' ); ?></label> 443 <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_author_ip', true ) ); ?>" size="25"disabled="disabled" />435 <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_author_ip', true ) ); ?>" disabled="disabled" /> 444 436 </p> 445 437 -
trunk/bbp-includes/admin/replies.php
r4250 r4261 425 425 <style type="text/css" media="screen"> 426 426 /*<![CDATA[*/ 427 428 strong.label { 429 display: inline-block; 430 width: 60px; 431 } 427 432 428 433 .column-bbp_forum_topic_count, -
trunk/bbp-includes/admin/topics.php
r4250 r4261 440 440 <style type="text/css" media="screen"> 441 441 /*<![CDATA[*/ 442 443 strong.label { 444 display: inline-block; 445 width: 60px; 446 } 442 447 443 448 .column-bbp_forum_topic_count,
Note: See TracChangeset
for help on using the changeset viewer.