Changeset 5399
- Timestamp:
- 06/14/2014 10:14:34 PM (11 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/admin.php
r5325 r5399 568 568 // Topics admin 569 569 if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) { 570 wp_enqueue_script( 'bbp-admin- common-js', $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version );570 wp_enqueue_script( 'bbp-admin-topics-js', $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version ); 571 571 572 572 // Replies admin 573 573 } elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) { 574 wp_enqueue_script( 'bbp-admin- common-js', $this->js_url . 'replies' . $suffix . '.js', array( 'jquery' ), $version );574 wp_enqueue_script( 'bbp-admin-replies-js', $this->js_url . 'replies' . $suffix . '.js', array( 'jquery' ), $version ); 575 575 } 576 576 -
trunk/src/includes/admin/js/replies.js
r5225 r5399 1 1 jQuery( document ).ready(function() { 2 3 jQuery( '#misc-publishing-actions' ).find( '.misc-pub-section' ).first().remove(); 4 jQuery( '#save-action' ).remove(); 2 5 3 6 var bbp_topic_id = jQuery( '#bbp_topic_id' ); -
trunk/src/includes/admin/metaboxes.php
r5398 r5399 422 422 ?> 423 423 424 <hr /> 425 424 426 <p> 425 427 <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong> … … 471 473 $reply_topic_id = bbp_get_reply_topic_id( $post_id ); 472 474 $reply_forum_id = bbp_get_reply_forum_id( $post_id ); 475 476 477 /** Status ****************************************************************/ 478 479 ?> 480 481 <p> 482 <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong> 483 <label class="screen-reader-text" for="post_status"><?php esc_html_e( 'Select what status to give the reply.', 'bbpress' ); ?></label> 484 <?php bbp_form_reply_status_dropdown( array( 'select_id' => 'post_status', 'reply_id' => $post_id ) ); ?> 485 </p> 486 487 <hr /> 488 489 <?php 490 491 /** Forum *****************************************************************/ 473 492 474 493 // Allow individual manipulation of reply forum … … 497 516 </p> 498 517 499 <?php endif; ?> 518 <?php endif; 519 520 /** Topic *****************************************************************/ 521 522 ?> 500 523 501 524 <p> … … 504 527 <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" /> 505 528 </p> 529 530 <?php 531 532 /** Reply To **************************************************************/ 533 534 ?> 506 535 507 536 <p> -
trunk/src/includes/replies/functions.php
r5393 r5399 1665 1665 } 1666 1666 1667 /** Helpers *******************************************************************/ 1668 1669 /** 1670 * Return an associative array of available reply statuses 1671 * 1672 * @since bbPress (r5399) 1673 * 1674 * @return array 1675 */ 1676 function bbp_get_reply_statuses() { 1677 return apply_filters( 'bbp_get_reply_statuses', array( 1678 bbp_get_public_status_id() => _x( 'Publish', 'Publish the reply', 'bbpress' ), 1679 bbp_get_spam_status_id() => _x( 'Spam', 'Spam the reply', 'bbpress' ), 1680 bbp_get_trash_status_id() => _x( 'Trash', 'Trash the reply', 'bbpress' ), 1681 bbp_get_pending_status_id() => _x( 'Pending', 'Mark reply as pending', 'bbpress' ), 1682 ) ); 1683 } 1684 1667 1685 /** Reply Actions *************************************************************/ 1668 1686 -
trunk/src/includes/replies/template.php
r5395 r5399 2623 2623 return apply_filters( 'bbp_get_form_reply_edit_reason', esc_attr( $reply_edit_reason ) ); 2624 2624 } 2625 2626 /** 2627 * Output value topic status dropdown 2628 * 2629 * @since bbPress (r5399) 2630 * 2631 * @param $args This function supports these arguments: 2632 * - select_id: Select id. Defaults to bbp_reply_status 2633 * - tab: Tabindex 2634 * - reply_id: Reply id 2635 * - selected: Override the selected option 2636 */ 2637 function bbp_form_reply_status_dropdown( $args = '' ) { 2638 echo bbp_get_form_reply_status_dropdown( $args ); 2639 } 2640 /** 2641 * Returns topic status downdown 2642 * 2643 * This dropdown is only intended to be seen by users with the 'moderate' 2644 * capability. Because of this, no additional capablitiy checks are performed 2645 * within this function to check available topic statuses. 2646 * 2647 * @since bbPress (r5399) 2648 * 2649 * @param $args This function supports these arguments: 2650 * - select_id: Select id. Defaults to bbp_reply_status 2651 * - tab: Tabindex 2652 * - topic_id: Reply id 2653 * - selected: Override the selected option 2654 */ 2655 function bbp_get_form_reply_status_dropdown( $args = '' ) { 2656 2657 // Parse arguments against default values 2658 $r = bbp_parse_args( $args, array( 2659 'select_id' => 'bbp_reply_status', 2660 'tab' => bbp_get_tab_index(), 2661 'reply_id' => 0, 2662 'selected' => false 2663 ), 'reply_status_dropdown' ); 2664 2665 // No specific selected value passed 2666 if ( empty( $r['selected'] ) ) { 2667 2668 // Post value is passed 2669 if ( bbp_is_post_request() && isset( $_POST[ $r['select_id'] ] ) ) { 2670 $r['selected'] = $_POST[ $r['select_id'] ]; 2671 2672 // No Post value was passed 2673 } else { 2674 2675 // Edit topic 2676 if ( bbp_is_reply_edit() ) { 2677 $r['reply_id'] = bbp_get_reply_id( $r['reply_id'] ); 2678 $r['selected'] = bbp_get_reply_status( $r['reply_id'] ); 2679 2680 // New topic 2681 } else { 2682 $r['selected'] = bbp_get_public_status_id(); 2683 } 2684 } 2685 } 2686 2687 // Used variables 2688 $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : ''; 2689 2690 // Start an output buffer, we'll finish it after the select loop 2691 ob_start(); ?> 2692 2693 <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>> 2694 2695 <?php foreach ( bbp_get_reply_statuses( $r['topic_id'] ) as $key => $label ) : ?> 2696 2697 <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option> 2698 2699 <?php endforeach; ?> 2700 2701 </select> 2702 2703 <?php 2704 2705 // Return the results 2706 return apply_filters( 'bbp_get_form_reply_status_dropdown', ob_get_clean(), $r ); 2707 }
Note: See TracChangeset
for help on using the changeset viewer.