Skip to:
Content

bbPress.org

Changeset 3260


Ignore:
Timestamp:
05/29/2011 09:53:53 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Improve support for orphaned topics and replies in admin post rows by displaying "No Forum" and "No Topic" if parents have been deleted.

Location:
branches/plugin/bbp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-replies.php

    r3243 r3260  
    569569                                // Output forum name
    570570                                if ( !empty( $topic_id ) ) {
    571                                         bbp_topic_title( $topic_id );
    572 
    573                                         // Link information
    574                                         $actions = apply_filters( 'reply_topic_row_actions', array (
    575                                                 'edit' => '<a href="' . add_query_arg( array( 'post' => $topic_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>',
    576                                                 'view' => '<a href="' . bbp_get_topic_permalink( $topic_id ) . '">' . __( 'View', 'bbpress' ) . '</a>'
    577                                         ) );
    578 
    579                                         // Output forum post row links
    580                                         foreach ( $actions as $action => $link )
    581                                                 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>';
    582 
    583                                         if ( !empty( $topic_id ) )
     571
     572                                        // Topic Title
     573                                        if ( !$topic_title = bbp_topic_title( $topic_id ) )
     574                                                $topic_title = __( 'No Topic', 'bbpress' );
     575
     576                                        // Output the title
     577                                        echo $topic_title;
     578
     579                                        // Show actions if topic exists
     580                                        if ( $topic_title != __( 'No Topic', 'bbpress' ) ) {
     581
     582                                                // Link information
     583                                                $actions = apply_filters( 'reply_topic_row_actions', array (
     584                                                        'edit' => '<a href="' . add_query_arg( array( 'post' => $topic_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>',
     585                                                        'view' => '<a href="' . bbp_get_topic_permalink( $topic_id ) . '">' . __( 'View', 'bbpress' ) . '</a>'
     586                                                ) );
     587
     588                                                // Output forum post row links
     589                                                foreach ( $actions as $action => $link )
     590                                                        $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>';
     591
    584592                                                echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>';
     593                                        }
    585594
    586595                                // Reply has no topic
    587596                                } else {
    588                                         _e( '(No Topic)', 'bbpress' );
     597                                        _e( 'No Topic', 'bbpress' );
    589598                                }
    590599
    … …  
    599608                                // Output forum name
    600609                                if ( !empty( $forum_id ) ) {
    601                                         bbp_forum_title( $forum_id );
    602 
    603                                         // Link information
    604                                         $actions = apply_filters( 'reply_topic_forum_row_actions', array (
    605                                                 'edit' => '<a href="' . add_query_arg( array( 'post' => $forum_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>',
    606                                                 'view' => '<a href="' . bbp_get_forum_permalink( $forum_id ) . '">' . __( 'View', 'bbpress' ) . '</a>'
    607                                         ) );
    608 
    609                                         // Output forum post row links
    610                                         foreach ( $actions as $action => $link )
    611                                                 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>';
    612 
    613                                         // Show forum actions
    614                                         if ( !empty( $forum_id ) )
     610
     611                                        // Forum Title
     612                                        if ( !$forum_title = bbp_get_forum_title( $forum_id ) )
     613                                                $forum_title = __( 'No Forum', 'bbpress' );
     614
     615                                        // Output the title
     616                                        echo $forum_title;
     617
     618                                        // Show actions if forum exists
     619                                        if ( $forum_title != __( 'No Forum', 'bbpress' ) ) {
     620
     621                                                // Link information
     622                                                $actions = apply_filters( 'reply_topic_forum_row_actions', array (
     623                                                        'edit' => '<a href="' . add_query_arg( array( 'post' => $forum_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>',
     624                                                        'view' => '<a href="' . bbp_get_forum_permalink( $forum_id ) . '">' . __( 'View', 'bbpress' ) . '</a>'
     625                                                ) );
     626
     627                                                // Output forum post row links
     628                                                foreach ( $actions as $action => $link )
     629                                                        $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>';
     630
     631                                                // Show forum actions
    615632                                                echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>';
     633                                        }
    616634
    617635                                // Reply has no forum
    618636                                } else {
    619                                         _e( '(No Forum)', 'bbpress' );
     637                                        _e( 'No Forum', 'bbpress' );
    620638                                }
    621639
  • branches/plugin/bbp-admin/bbp-topics.php

    r3243 r3260  
    641641                                // Output forum name
    642642                                if ( !empty( $forum_id ) ) {
    643                                         bbp_forum_title( $forum_id );
    644 
    645                                         // Link information
    646                                         $actions = apply_filters( 'topic_forum_row_actions', array (
    647                                                 'edit' => '<a href="' . add_query_arg( array( 'post' => $forum_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>',
    648                                                 'view' => '<a href="' . bbp_get_forum_permalink( $forum_id ) . '">' . __( 'View', 'bbpress' ) . '</a>'
    649                                         ) );
    650 
    651                                         // Output forum post row links
    652                                         foreach ( $actions as $action => $link )
    653                                                 $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>';
    654 
    655                                         echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>';
     643                                       
     644                                        // Forum Title
     645                                        if ( !$forum_title = bbp_get_forum_title( $forum_id ) )
     646                                                $forum_title = __( 'No Forum', 'bbpress' );
     647
     648                                        // Output the title
     649                                        echo $forum_title;
     650
     651                                        // Show actions if forum exists
     652                                        if ( $forum_title != __( 'No Forum', 'bbpress' ) ) {
     653
     654                                                // Link information
     655                                                $actions = apply_filters( 'topic_forum_row_actions', array (
     656                                                        'edit' => '<a href="' . add_query_arg( array( 'post' => $forum_id, 'action' => 'edit' ), admin_url( '/post.php' ) ) . '">' . __( 'Edit', 'bbpress' ) . '</a>',
     657                                                        'view' => '<a href="' . bbp_get_forum_permalink( $forum_id ) . '">' . __( 'View', 'bbpress' ) . '</a>'
     658                                                ) );
     659
     660                                                // Output forum post row links
     661                                                foreach ( $actions as $action => $link )
     662                                                        $formatted_actions[] = '<span class="' . $action . '">' . $link . '</span>';
     663
     664                                                echo '<div class="row-actions">' . implode( ' | ', $formatted_actions ) . '</div>';
     665                                        }
    656666                                } else {
    657667                                        _e( '(No Forum)', 'bbpress' );
Note: See TracChangeset for help on using the changeset viewer.