Skip to:
Content

bbPress.org

Changeset 3686


Ignore:
Timestamp:
01/18/2012 02:49:20 AM (7 years ago)
Author:
johnjamesjacoby
Message:

Refactor forum/topic/reply contextual help, shamelessly sampled from the WordPress 'post' content type. See #1699.

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

Legend:

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

    r3683 r3686  
    4242        $this->setup_globals();
    4343        $this->setup_actions();
    44         $this->setup_help();
    4544    }
    4645
     
    8988    }
    9089
    91     /**
    92      * Contextual help for forums
     90    /** Contextual Help *******************************************************/
     91
     92    /**
     93     * Contextual help for bbPress forum edit page
    9394     *
    9495     * @since bbPress (r3119)
    95      * @access private
    96      */
    97     function setup_help() {
    98 
    99         // Define local variable(s)
    100         $contextual_help      = '';
    101         $bbp_contextual_help = array();
    102 
    103         /** New/Edit **********************************************************/
    104 
    105         $bbp_contextual_help[] = __( 'The forum title field and the big forum editing area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of the box. Use the Screen Options tab to unhide more boxes (like Slug) or to choose a 1- or 2-column layout for this screen.', 'bbpress' );
    106         $bbp_contextual_help[] = __( '<strong>Title</strong> - Enter a title for your forum. After you enter a title, you will see the permalink appear below it, which is fully editable.', 'bbpress' );
    107         $bbp_contextual_help[] = __( '<strong>Post editor</strong> - Enter the description for your forum. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The screen icon just before that allows you to expand the edit box to full screen. The HTML mode allows you to enter raw HTML along with your forum text. You can insert media files by clicking the icons above the post editor and following the directions.', 'bbpress' );
    108         $bbp_contextual_help[] = __( '<strong>Forum Attributes</strong> - Select the various attributes that your forum should have:', 'bbpress' );
    109         $bbp_contextual_help[] =
    110             '<ul>' .
    111                 '<li>' . __( 'Forum Type determines whether it is a Forum (by default) or a Category, which means no new topics (only other forums) can be created within it.', 'bbpress' ) . '</li>' .
    112                 '<li>' . __( 'Forum Status controls whether it is open (and thus can be posted to) or closed (thus not able to be posted to).',                                 'bbpress' ) . '</li>' .
    113                 '<li>' . __( 'Visibility can be set to either Public (by default, seen by everyone), Private (seen only by chosen users), and Hidden (hidden from all users).', 'bbpress' ) . '</li>' .
    114                 '<li>' . __( 'Parent turns the forum into a child forum of the selected forum/category in the dropdown.',                                                       'bbpress' ) . '</li>' .
    115                 '<li>' . __( 'Order determines the order that forums in the given hierarchy are displayed (lower numbers first, higher numbers last).',                         'bbpress' ) . '</li>' .
    116             '</ul>';
    117 
    118         $bbp_contextual_help[] = __( '<strong>Publish</strong> - The Publish box will allow you to Preview your forum before it is published, Publish your forum to your site, or Move to Trash will move your forum to the trash.', 'bbpress' );
    119         $bbp_contextual_help[] = __( '<strong>Revisions</strong> - Revisions show past versions of the saved forum. Each revision can be compared to the current version, or another revision. Revisions can also be restored to the current version.', 'bbpress' );
    120         $bbp_contextual_help[] = __( '<strong>For more information:</strong>', 'bbpress' );
    121         $bbp_contextual_help[] =
    122             '<ul>' .
    123                 '<li>' . __( '<a href="http://bbpress.org/documentation/">bbPress Documentation</a>', 'bbpress' ) . '</li>' .
    124                 '<li>' . __( '<a href="http://bbpress.org/forums/">bbPress Support Forums</a>',       'bbpress' ) . '</li>' .
    125             '</ul>';
    126 
    127         // Wrap each help item in paragraph tags
    128         foreach( $bbp_contextual_help as $paragraph )
    129             $contextual_help .= '<p>' . $paragraph . '</p>';
    130 
    131         // Add help
    132         add_contextual_help( bbp_get_forum_post_type(), $contextual_help );
    133 
    134         // Reset
    135         $contextual_help     = '';
    136         $bbp_contextual_help = array();
    137 
    138         /** Post Rows *********************************************************/
    139 
    140         $bbp_contextual_help[] = __( 'This screen displays the forums available on your site.',           'bbpress' );
    141         $bbp_contextual_help[] = __( 'You can customize the display of this screen in a number of ways:', 'bbpress' );
    142         $bbp_contextual_help[] =
    143             '<ul>' .
    144                 '<li>' . __( 'You can hide/display columns based on your needs and decide how many forums to list per screen using the Screen Options tab.',                                                                                                                                'bbpress' ) . '</li>' .
    145                 '<li>' . __( 'You can filter the list of forums by forum status using the text links in the upper left to show All, Published, or Trashed forums. The default view is to show all forums.',                                                                                 'bbpress' ) . '</li>' .
    146                 '<li>' . __( 'You can refine the list to show only forums from a specific month by using the dropdown menus above the forums list. Click the Filter button after making your selection. You also can refine the list by clicking on the forum creator in the forums list.', 'bbpress' ) . '</li>' .
    147             '</ul>';
    148 
    149         $bbp_contextual_help[] = __( 'Hovering over a row in the forums list will display action links that allow you to manage your forum. You can perform the following actions:', 'bbpress' );
    150         $bbp_contextual_help[] =
    151             '<ul>' .
    152                 '<li>' . __( 'Edit takes you to the editing screen for that forum. You can also reach that screen by clicking on the forum title.', 'bbpress' ) . '</li>' .
    153                 '<li>' . __( 'Trash removes your forum from this list and places it in the trash, from which you can permanently delete it.',       'bbpress' ) . '</li>' .
    154                 '<li>' . __( 'View will take you to your live forum to view the forum.',                                                            'bbpress' ) . '</li>' .
    155             '</ul>';
    156 
    157         $bbp_contextual_help[] = __( 'You can also edit multiple forums at once. Select the forums you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata for all selected forums at once. To remove a forum from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' );
    158         $bbp_contextual_help[] = __( 'The Bulk Actions menu may also be used to delete multiple forums at once. Select Delete from the dropdown after making your selection.', 'bbpress' );
    159         $bbp_contextual_help[] = __( '<strong>For more information:</strong>', 'bbpress' );
    160         $bbp_contextual_help[] =
    161             '<ul>' .
    162                 '<li>' . __( '<a href="http://bbpress.org/documentation/">bbPress Documentation</a>', 'bbpress' ) . '</li>' .
    163                 '<li>' . __( '<a href="http://bbpress.org/forums/">bbPress Support Forums</a>',       'bbpress' ) . '</li>' .
    164             '</ul>';
    165 
    166         // Wrap each help item in paragraph tags
    167         foreach( $bbp_contextual_help as $paragraph )
    168             $contextual_help .= '<p>' . $paragraph . '</p>';
    169 
    170         // Add help
    171         add_contextual_help( 'edit-' . bbp_get_forum_post_type(), $contextual_help );
     96     * @uses get_current_screen()
     97     */
     98    public function edit_help() {
     99
     100        $current_screen = get_current_screen();
     101        $post_type      = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
     102
     103        // Bail if current screen could not be found
     104        if ( empty( $current_screen ) )
     105            return;
     106
     107        // Bail if not the forum post type
     108        if ( $post_type != $this->post_type )
     109            return;
     110
     111        // Overview
     112        $current_screen->add_help_tab( array(
     113            'id'        => 'overview',
     114            'title'     => __( 'Overview', 'bbpress' ),
     115            'content'   =>
     116                '<p>' . __( 'This screen provides access to all of your replies. You can customize the display of this screen to suit your workflow.', 'bbpress' ) . '</p>'
     117        ) );
     118
     119        // Screen Content
     120        $current_screen->add_help_tab( array(
     121            'id'        => 'screen-content',
     122            'title'     => __( 'Screen Content', 'bbpress' ),
     123            'content'   =>
     124                '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:' ) . '</p>' .
     125                '<ul>' .
     126                    '<li>' . __( 'You can hide/display columns based on your needs and decide how many replies to list per screen using the Screen Options tab.',                                                                                                                                                                          'bbpress' ) . '</li>' .
     127                    '<li>' . __( 'You can filter the list of replies by forum status using the text links in the upper left to show All, Published, Draft, or Trashed replies. The default view is to show all replies.',                                                                                                                   'bbpress' ) . '</li>' .
     128                    '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.',                                                                                                                                             'bbpress' ) . '</li>' .
     129                    '<li>' . __( 'You can refine the list to show only replies in a specific category or from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection. You also can refine the list by clicking on the forum author, category or tag in the replies list.', 'bbpress' ) . '</li>' .
     130                '</ul>'
     131        ) );
     132
     133        // Available Actions
     134        $current_screen->add_help_tab( array(
     135            'id'        => 'action-links',
     136            'title'     => __( 'Available Actions', 'bbpress' ),
     137            'content'   =>
     138                '<p>' . __( 'Hovering over a row in the replies list will display action links that allow you to manage your forum. You can perform the following actions:', 'bbpress' ) . '</p>' .
     139                '<ul>' .
     140                    '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that forum. You can also reach that screen by clicking on the forum title.',                                                                                 'bbpress' ) . '</li>' .
     141                    //'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your forum, allowing you to update forum details without leaving this screen.',                                                                  'bbpress' ) . '</li>' .
     142                    '<li>' . __( '<strong>Trash</strong> removes your forum from this list and places it in the trash, from which you can permanently delete it.',                                                                                       'bbpress' ) . '</li>' .
     143                    '<li>' . __( '<strong>Spam</strong> removes your forum from this list and places it in the spam queue, from which you can permanently delete it.',                                                                                   'bbpress' ) . '</li>' .
     144                    '<li>' . __( '<strong>Preview</strong> will show you what your draft forum will look like if you publish it. View will take you to your live site to view the forum. Which link is available depends on your forum&#8217;s status.', 'bbpress' ) . '</li>' .
     145                '</ul>'
     146        ) );
     147
     148        // Bulk Actions
     149        $current_screen->add_help_tab( array(
     150            'id'        => 'bulk-actions',
     151            'title'     => __( 'Bulk Actions', 'bbpress' ),
     152            'content'   =>
     153                '<p>' . __( 'You can also edit or move multiple replies to the trash at once. Select the replies you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.',           'bbpress' ) . '</p>' .
     154                '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected replies at once. To remove a forum from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' ) . '</p>'
     155        ) );
     156
     157        // Help Sidebar
     158        $current_screen->set_help_sidebar(
     159            '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
     160            '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
     161            '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>',       'bbpress' ) . '</p>'
     162        );
     163    }
     164
     165    /**
     166     * Contextual help for bbPress forum edit page
     167     *
     168     * @since bbPress (r3119)
     169     * @uses get_current_screen()
     170     */
     171    public function new_help() {
     172
     173        $current_screen = get_current_screen();
     174        $post_type      = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
     175
     176        // Bail if current screen could not be found
     177        if ( empty( $current_screen ) )
     178            return;
     179
     180        // Bail if not the forum post type
     181        if ( $post_type != $this->post_type )
     182            return;
     183
     184        $customize_display = '<p>' . __( 'The title field and the big forum editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
     185
     186        $current_screen->add_help_tab( array(
     187            'id'      => 'customize-display',
     188            'title'   => __( 'Customizing This Display', 'bbpress' ),
     189            'content' => $customize_display,
     190        ) );
     191
     192        $current_screen->add_help_tab( array(
     193            'id'      => 'title-forum-editor',
     194            'title'   => __( 'Title and Forum Editor', 'bbpress' ),
     195            'content' =>
     196                '<p>' . __( '<strong>Title</strong> - Enter a title for your forum. After you enter a title, you&#8217;ll see the permalink below, which you can edit.', 'bbpress' ) . '</p>' .
     197                '<p>' . __( '<strong>Forum Editor</strong> - Enter the text for your forum. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your forum text. You can insert media files by clicking the icons above the forum editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular forum editor.', 'bbpress' ) . '</p>'
     198        ) );
     199
     200        $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your forum in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a forum or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a forum to be published in the future or backdate a forum.', 'bbpress' ) . '</p>';
     201
     202        if ( current_theme_supports( 'forum-formats' ) && forum_type_supports( 'forum', 'forum-formats' ) ) {
     203            $publish_box .= '<p>' . __( '<strong>forum Format</strong> - This designates how your theme will display a specific forum. For example, you could have a <em>standard</em> blog forum with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/forum_Formats#Supported_Formats">descriptions of each forum format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
     204        }
     205
     206        if ( current_theme_supports( 'forum-thumbnails' ) && forum_type_supports( 'forum', 'thumbnail' ) ) {
     207            $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your forum without inserting it. This is usually useful only if your theme makes use of the featured image as a forum thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
     208        }
     209
     210        $current_screen->add_help_tab( array(
     211            'id'      => 'publish-box',
     212            'title'   => __( 'Publish Box', 'bbpress' ),
     213            'content' => $publish_box,
     214        ) );
     215
     216        $current_screen->add_help_tab( array(
     217            'id'      => 'discussion-settings',
     218            'title'   => __( 'Discussion Settings', 'bbpress' ),
     219            'content' =>
     220                '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
     221                '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the forum, you can see them here and moderate them.', 'bbpress' ) . '</p>'
     222        ) );
     223
     224        $current_screen->set_help_sidebar(
     225            '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
     226            '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
     227            '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>',       'bbpress' ) . '</p>'
     228        );
    172229    }
    173230
  • branches/plugin/bbp-admin/bbp-replies.php

    r3627 r3686  
    4242        $this->setup_globals();
    4343        $this->setup_actions();
    44         $this->setup_help();
    4544    }
    4645
     
    8786        add_filter( 'restrict_manage_posts', array( $this, 'filter_dropdown'  ) );
    8887        add_filter( 'request',               array( $this, 'filter_post_rows' ) );
     88
     89        // Contextual Help
     90        add_action( 'load-edit.php',     array( $this, 'edit_help' ) );
     91        add_action( 'load-post-new.php', array( $this, 'new_help'  ) );
    8992    }
    9093
     
    101104    }
    102105
    103     /**
    104      * Contextual help for replies
     106    /** Contextual Help *******************************************************/
     107
     108    /**
     109     * Contextual help for bbPress reply edit page
    105110     *
    106111     * @since bbPress (r3119)
    107      * @access private
    108      */
    109     function setup_help() {
    110 
    111         // Define local variable(s)
    112         $contextual_help     = '';
    113         $bbp_contextual_help = array();
    114 
    115         /** New/Edit **********************************************************/
    116 
    117         $bbp_contextual_help[] = __( 'The reply title field and the big reply editing area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of the box. Use the Screen Options tab to unhide more boxes (Reply Attributes, Slug) or to choose a 1- or 2-column layout for this screen.', 'bbpress' );
    118         $bbp_contextual_help[] = __( '<strong>Title</strong> - Enter a title for your reply. After you enter a title, you will see the permalink below, which you can edit.', 'bbpress' );
    119         $bbp_contextual_help[] = __( '<strong>Post editor</strong> - Enter the text for your reply. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The screen icon just before that allows you to expand the edit box to full screen. The HTML mode allows you to enter raw HTML along with your forum text. You can insert media files by clicking the icons above the post editor and following the directions.', 'bbpress' );
    120         $bbp_contextual_help[] = __( '<strong>Reply Attributes</strong> - Select the attributes that your reply should have. The Parent Topic dropdown determines the parent topic that the reply belongs to.', 'bbpress' );
    121         $bbp_contextual_help[] = __( '<strong>Publish</strong> - The Publish box will allow you to save your reply as Draft or Pending Review. You may Preview your reply before it is published as well. The Visibility will determine whether the reply is Public, Password protected (requiring a password on the site to view) or Private (only the author will have access to it). Replies may be published immediately by clicking the dropdown, or at a specific date and time by clicking the Edit link.', 'bbpress' );
    122         $bbp_contextual_help[] = __( '<strong>Revisions</strong> - Revisions show past versions of the saved reply. Each revision can be compared to the current version, or another revision. Revisions can also be restored to the current version.', 'bbpress' );
    123         $bbp_contextual_help[] = __( '<strong>For more information:</strong>', 'bbpress' );
    124         $bbp_contextual_help[] =
    125             '<ul>' .
    126                 '<li>' . __( '<a href="http://bbpress.org/documentation/">bbPress Documentation</a>', 'bbpress' ) . '</li>' .
    127                 '<li>' . __( '<a href="http://bbpress.org/forums/">bbPress Support Forums</a>', 'bbpress' ) . '</li>' .
    128             '</ul>' ;
    129 
    130         // Wrap each help item in paragraph tags
    131         foreach( $bbp_contextual_help as $paragraph )
    132             $contextual_help .= '<p>' . $paragraph . '</p>';
    133 
    134         // Add help
    135         add_contextual_help( bbp_get_reply_post_type(), $contextual_help );
    136 
    137         // Reset
    138         $contextual_help     = '';
    139         $bbp_contextual_help = array();
    140 
    141         /** Post Rows *********************************************************/
    142 
    143         $bbp_contextual_help[] = __( 'This screen displays the replies created on your site.', 'bbpress' );
    144         $bbp_contextual_help[] = __( 'You can customize the display of this screen in a number of ways:', 'bbpress' );
    145         $bbp_contextual_help[] =
    146             '<ul>' .
    147                 '<li>' . __( 'You can hide/display columns based on your needs (Forum, Topic, Author, and Created) and decide how many replies to list per screen using the Screen Options tab.', 'bbpress' ) . '</li>' .
    148                 '<li>' . __( 'You can filter the list of replies by reply status using the text links in the upper left to show All, Published, Pending Review, Draft, or Trashed topics. The default view is to show all replies.', 'bbpress' ) . '</li>' .
    149                 '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.', 'bbpress' ) . '</li>' .
    150                 '<li>' . __( 'You can refine the list to show only replies from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection.', 'bbpress' ) . '</li>' .
    151                 '<li>' . __( 'You can also show only replies from a specific parent forum by using the parent forum dropdown above the replies list and selecting the parent forum. Click the Filter button after making your selection.', 'bbpress' ) . '</li>' .
    152             '</ul>';
    153 
    154         $bbp_contextual_help[] = __( 'Hovering over a row in the replies list will display action links that allow you to manage your reply. You can perform the following actions:', 'bbpress' );
    155         $bbp_contextual_help[] =
    156             '<ul>' .
    157                 '<li>' . __( 'Edit takes you to the editing screen for that reply. You can also reach that screen by clicking on the reply title.', 'bbpress' ) . '</li>' .
    158                 '<li>' . __( 'Trash removes your reply from this list and places it in the trash, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
    159                 '<li>' . __( 'View will take you to your live reply to view the reply.', 'bbpress' ) . '</li>' .
    160                 '<li>' . __( 'Spam will mark the topic as spam, preventing further replies to it and removing it from the site&rsquo;s public view.', 'bbpress' ) . '</li>' .
    161             '</ul>';
    162 
    163         $bbp_contextual_help[] = __( 'You can also edit multiple replies at once. Select the replies you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata for all selected replies at once. To remove a reply from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' );
    164         $bbp_contextual_help[] = __( 'The Bulk Actions menu may also be used to delete multiple replies at once. Select Delete from the dropdown after making your selection.', 'bbpress' );
    165         $bbp_contextual_help[] = __( '<strong>For more information:</strong>', 'bbpress' );
    166         $bbp_contextual_help[] =
    167             '<ul>' .
    168                 '<li>' . __( '<a href="http://bbpress.org/documentation/">bbPress Documentation</a>', 'bbpress' ) . '</li>' .
    169                 '<li>' . __( '<a href="http://bbpress.org/forums/">bbPress Support Forums</a>', 'bbpress', 'bbpress' ) . '</li>' .
    170             '</ul>';
    171 
    172         // Wrap each help item in paragraph tags
    173         foreach( $bbp_contextual_help as $paragraph )
    174             $contextual_help .= '<p>' . $paragraph . '</p>';
    175 
    176         // Add help
    177         add_contextual_help( 'edit-' . bbp_get_reply_post_type(), $contextual_help );
     112     * @uses get_current_screen()
     113     */
     114    public function edit_help() {
     115
     116        $current_screen = get_current_screen();
     117        $post_type      = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
     118
     119        // Bail if current screen could not be found
     120        if ( empty( $current_screen ) )
     121            return;
     122
     123        // Bail if not the reply post type
     124        if ( $post_type != $this->post_type )
     125            return;
     126
     127        // Overview
     128        $current_screen->add_help_tab( array(
     129            'id'        => 'overview',
     130            'title'     => __( 'Overview', 'bbpress' ),
     131            'content'   =>
     132                '<p>' . __( 'This screen provides access to all of your replies. You can customize the display of this screen to suit your workflow.', 'bbpress' ) . '</p>'
     133        ) );
     134
     135        // Screen Content
     136        $current_screen->add_help_tab( array(
     137            'id'        => 'screen-content',
     138            'title'     => __( 'Screen Content', 'bbpress' ),
     139            'content'   =>
     140                '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:' ) . '</p>' .
     141                '<ul>' .
     142                    '<li>' . __( 'You can hide/display columns based on your needs and decide how many replies to list per screen using the Screen Options tab.',                                                                                                                                                                          'bbpress' ) . '</li>' .
     143                    '<li>' . __( 'You can filter the list of replies by reply status using the text links in the upper left to show All, Published, Draft, or Trashed replies. The default view is to show all replies.',                                                                                                                   'bbpress' ) . '</li>' .
     144                    '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.',                                                                                                                                             'bbpress' ) . '</li>' .
     145                    '<li>' . __( 'You can refine the list to show only replies in a specific category or from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection. You also can refine the list by clicking on the reply author, category or tag in the replies list.', 'bbpress' ) . '</li>' .
     146                '</ul>'
     147        ) );
     148
     149        // Available Actions
     150        $current_screen->add_help_tab( array(
     151            'id'        => 'action-links',
     152            'title'     => __( 'Available Actions', 'bbpress' ),
     153            'content'   =>
     154                '<p>' . __( 'Hovering over a row in the replies list will display action links that allow you to manage your reply. You can perform the following actions:', 'bbpress' ) . '</p>' .
     155                '<ul>' .
     156                    '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that reply. You can also reach that screen by clicking on the reply title.',                                                                                 'bbpress' ) . '</li>' .
     157                    //'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your reply, allowing you to update reply details without leaving this screen.',                                                                  'bbpress' ) . '</li>' .
     158                    '<li>' . __( '<strong>Trash</strong> removes your reply from this list and places it in the trash, from which you can permanently delete it.',                                                                                       'bbpress' ) . '</li>' .
     159                    '<li>' . __( '<strong>Spam</strong> removes your reply from this list and places it in the spam queue, from which you can permanently delete it.',                                                                                   'bbpress' ) . '</li>' .
     160                    '<li>' . __( '<strong>Preview</strong> will show you what your draft reply will look like if you publish it. View will take you to your live site to view the reply. Which link is available depends on your reply&#8217;s status.', 'bbpress' ) . '</li>' .
     161                '</ul>'
     162        ) );
     163
     164        // Bulk Actions
     165        $current_screen->add_help_tab( array(
     166            'id'        => 'bulk-actions',
     167            'title'     => __( 'Bulk Actions', 'bbpress' ),
     168            'content'   =>
     169                '<p>' . __( 'You can also edit or move multiple replies to the trash at once. Select the replies you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.',           'bbpress' ) . '</p>' .
     170                '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected replies at once. To remove a reply from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' ) . '</p>'
     171        ) );
     172
     173        // Help Sidebar
     174        $current_screen->set_help_sidebar(
     175            '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
     176            '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
     177            '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>',       'bbpress' ) . '</p>'
     178        );
     179    }
     180
     181    /**
     182     * Contextual help for bbPress reply edit page
     183     *
     184     * @since bbPress (r3119)
     185     * @uses get_current_screen()
     186     */
     187    public function new_help() {
     188
     189        $current_screen = get_current_screen();
     190        $post_type      = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
     191
     192        // Bail if current screen could not be found
     193        if ( empty( $current_screen ) )
     194            return;
     195
     196        // Bail if not the reply post type
     197        if ( $post_type != $this->post_type )
     198            return;
     199
     200        $customize_display = '<p>' . __( 'The title field and the big reply editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
     201
     202        $current_screen->add_help_tab( array(
     203            'id'      => 'customize-display',
     204            'title'   => __( 'Customizing This Display', 'bbpress' ),
     205            'content' => $customize_display,
     206        ) );
     207
     208        $current_screen->add_help_tab( array(
     209            'id'      => 'title-reply-editor',
     210            'title'   => __( 'Title and Reply Editor', 'bbpress' ),
     211            'content' =>
     212                '<p>' . __( '<strong>Title</strong> - Enter a title for your reply. After you enter a title, you&#8217;ll see the permalink below, which you can edit.', 'bbpress' ) . '</p>' .
     213                '<p>' . __( '<strong>Reply Editor</strong> - Enter the text for your reply. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your reply text. You can insert media files by clicking the icons above the reply editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular reply editor.', 'bbpress' ) . '</p>'
     214        ) );
     215
     216        $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your reply in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a reply or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a reply to be published in the future or backdate a reply.', 'bbpress' ) . '</p>';
     217
     218        if ( current_theme_supports( 'reply-formats' ) && reply_type_supports( 'reply', 'reply-formats' ) ) {
     219            $publish_box .= '<p>' . __( '<strong>reply Format</strong> - This designates how your theme will display a specific reply. For example, you could have a <em>standard</em> blog reply with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/reply_Formats#Supported_Formats">descriptions of each reply format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
     220        }
     221
     222        if ( current_theme_supports( 'reply-thumbnails' ) && reply_type_supports( 'reply', 'thumbnail' ) ) {
     223            $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your reply without inserting it. This is usually useful only if your theme makes use of the featured image as a reply thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
     224        }
     225
     226        $current_screen->add_help_tab( array(
     227            'id'      => 'publish-box',
     228            'title'   => __( 'Publish Box', 'bbpress' ),
     229            'content' => $publish_box,
     230        ) );
     231
     232        $current_screen->add_help_tab( array(
     233            'id'      => 'discussion-settings',
     234            'title'   => __( 'Discussion Settings', 'bbpress' ),
     235            'content' =>
     236                '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
     237                '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the reply, you can see them here and moderate them.', 'bbpress' ) . '</p>'
     238        ) );
     239
     240        $current_screen->set_help_sidebar(
     241            '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
     242            '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
     243            '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>',       'bbpress' ) . '</p>'
     244        );
    178245    }
    179246
     
    263330     */
    264331    function author_metabox() {
    265         global $current_screen;
    266332
    267333        // Bail if post_type is not a reply
  • branches/plugin/bbp-admin/bbp-topics.php

    r3660 r3686  
    4242        $this->setup_globals();
    4343        $this->setup_actions();
    44         $this->setup_help();
    4544    }
    4645
     
    8786        add_filter( 'restrict_manage_posts', array( $this, 'filter_dropdown'  ) );
    8887        add_filter( 'request',               array( $this, 'filter_post_rows' ) );
     88
     89        // Contextual Help
     90        add_action( 'load-edit.php',     array( $this, 'edit_help' ) );
     91        add_action( 'load-post-new.php', array( $this, 'new_help'  ) );
    8992    }
    9093
     
    101104    }
    102105
    103     /**
    104      * Contextual help for topics
     106    /** Contextual Help *******************************************************/
     107
     108    /**
     109     * Contextual help for bbPress topic edit page
    105110     *
    106111     * @since bbPress (r3119)
    107      * @access private
    108      */
    109     function setup_help() {
    110 
    111         // Define local variable(s)
    112         $contextual_help     = '';
    113         $bbp_contextual_help = array();
    114 
    115         /** New/Edit **********************************************************/
    116 
    117         $bbp_contextual_help[] = __( 'The topic title field and the big topic editing area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of the box. Use the Screen Options tab to unhide more boxes (Topic Tags, Topic Attributes, or Slug) or to choose a 1- or 2-column layout for this screen.', 'bbpress' );
    118         $bbp_contextual_help[] = __( '<strong>Title</strong> - Enter a title for your topic. After you enter a title, you will see the permalink below, which you can edit.', 'bbpress' );
    119         $bbp_contextual_help[] = __( '<strong>Post editor</strong> - Enter the text for your topic. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The screen icon just before that allows you to expand the edit box to full screen. The HTML mode allows you to enter raw HTML along with your forum text. You can insert media files by clicking the icons above the post editor and following the directions.', 'bbpress' );
    120         $bbp_contextual_help[] = __( '<strong>Topic Attributes</strong> - Select the attributes that your topic should have. The Forum dropdown determines the parent forum that the topic belongs to. Select the forum or category from the dropdown, or leave the default (No Forum) to post the topic without an assigned forum. The topic type drop down indicates the sticky status of the topic. Selecting the super sticky option would stick the topic to the front of your forums, i.e. the topic index, sticky option would stick the topic to its respective forum. Selecting normal would not stick the topic anywhere.', 'bbpress' );
    121         $bbp_contextual_help[] = __( '<strong>Publish</strong> - The Publish box will allow you to save your topic as Draft or Pending Review. You may Preview your topic before it is published as well. The Visibility will determine whether the topic is Public, Password protected (requiring a password on the site to view) or Private (only the author will have access to it). Topics may be published immediately by clicking the dropdown, or at a specific date and time by clicking the Edit link.', 'bbpress' );
    122         $bbp_contextual_help[] = __( '<strong>Topic Tags</strong> - You can assign keywords to your topics using Topic Tags. Unlike categories, tags have no hierarchy, meaning there is no relationship from one tag to another. Topics can be added and modified further from the Topic Tags screen.', 'bbpress' );
    123         $bbp_contextual_help[] = __( '<strong>Revisions</strong> - Revisions show past versions of the saved topic. Each revision can be compared to the current version, or another revision. Revisions can also be restored to the current version.', 'bbpress' );
    124         $bbp_contextual_help[] = __( '<strong>For more information:</strong>', 'bbpress' );
    125         $bbp_contextual_help[] =
    126             '<ul>' .
    127                 '<li>' . __( '<a href="http://bbpress.org/documentation/">bbPress Documentation</a>', 'bbpress' ) . '</li>' .
    128                 '<li>' . __( '<a href="http://bbpress.org/forums/">bbPress Support Forums</a>',       'bbpress' ) . '</li>' .
    129             '</ul>';
    130 
    131         // Wrap each help item in paragraph tags
    132         foreach( $bbp_contextual_help as $paragraph )
    133             $contextual_help .= '<p>' . $paragraph . '</p>';
    134 
    135         // Add help
    136         add_contextual_help( bbp_get_topic_post_type(), $contextual_help );
    137 
    138         // Reset
    139         $contextual_help     = '';
    140         $bbp_contextual_help = array();
    141 
    142         /** Post Rows *********************************************************/
    143 
    144         $bbp_contextual_help[] = __( 'This screen displays the topics created on your site.',             'bbpress' );
    145         $bbp_contextual_help[] = __( 'You can customize the display of this screen in a number of ways:', 'bbpress' );
    146         $bbp_contextual_help[] =
    147             '<ul>' .
    148                 '<li>' . __( 'You can hide/display columns based on your needs and decide how many topics to list per screen using the Screen Options tab.',                                                                             'bbpress' ) . '</li>' .
    149                 '<li>' . __( 'You can filter the list of topics by topics status using the text links in the upper left to show All, Published, Pending Review, Draft, or Trashed topics. The default view is to show all topics.',      'bbpress' ) . '</li>' .
    150                 '<li>' . __( 'You can view topics in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.',                                                  'bbpress' ) . '</li>' .
    151                 '<li>' . __( 'You can refine the list to show only topics from a specific month by using the dropdown menus above the topics list. Click the Filter button after making your selection.',                                'bbpress' ) . '</li>' .
    152                 '<li>' . __( 'You can also show only topics from a specific parent forum by using the parent forum dropdown above the topics list and selecting the parent forum. Click the Filter button after making your selection.', 'bbpress' ) . '</li>' .
    153                 '<li>' . __( 'You can refine the list by clicking on the topic creator in the topics list.', 'bbpress' ) . '</li>' .
    154             '</ul>' .
    155 
    156         $bbp_contextual_help[] = __( 'Hovering over a row in the topics list will display action links that allow you to manage your topic. You can perform the following actions:', 'bbpress' );
    157         $bbp_contextual_help[] =
    158             '<ul>' .
    159                 '<li>' . __( 'Edit takes you to the editing screen for that topic. You can also reach that screen by clicking on the topic title.',                                                                            'bbpress' ) . '</li>' .
    160                 '<li>' . __( 'Trash removes your topic from this list and places it in the trash, from which you can permanently delete it.',                                                                                  'bbpress' ) . '</li>' .
    161                 '<li>' . __( 'View will take you to your live topic to view the topic.',                                                                                                                                       'bbpress' ) . '</li>' .
    162                 '<li>' . __( 'Close will close your topic, disabling new replies within it. It will remain viewable to users, but replies will not be allowed.',                                                               'bbpress' ) . '</li>' .
    163                 '<li>' . __( 'Stick (to front) will pin the topic to the front page of the forum that it&rsquo;s in. New topics will begin beneath the list of "stuck" topics, which will always sit at the top of the list.', 'bbpress' ) . '</li>' .
    164                 '<li>' . __( 'Spam will mark the topic as spam, closing the post to new replies and removing it from the public view.',                                                                                        'bbpress' ) . '</li>' .
    165             '</ul>' .
    166 
    167         $bbp_contextual_help[] = __( 'You can also edit multiple topics at once. Select the topics you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata for all selected topics at once. To remove a topic from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' );
    168         $bbp_contextual_help[] = __( 'The Bulk Actions menu may also be used to delete multiple topics at once. Select Delete from the dropdown after making your selection.', 'bbpress' );
    169         $bbp_contextual_help[] = __( '<strong>For more information:</strong>', 'bbpress' );
    170         $bbp_contextual_help[] =
    171             '<ul>' .
    172                 '<li>' . __( '<a href="http://bbpress.org/documentation/">bbPress Documentation</a>', 'bbpress' ) . '</li>' .
    173                 '<li>' . __( '<a href="http://bbpress.org/forums/">bbPress Support Forums</a>'      , 'bbpress' ) . '</li>' .
    174             '</ul>';
    175 
    176         // Wrap each help item in paragraph tags
    177         foreach( $bbp_contextual_help as $paragraph )
    178             $contextual_help .= '<p>' . $paragraph . '</p>';
    179 
    180         // Add help
    181         add_contextual_help( 'edit-' . bbp_get_topic_post_type(), $contextual_help );
    182 
    183         // Reset
    184         $contextual_help = '';
    185         $bbp_contextual_help = array();
    186 
    187         /** Topic Tags **********************************************************/
    188 
    189         $bbp_contextual_help[] = __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen (20 by default) and to display/hide columns in the table (Description, Slug, and Topics).', 'bbpress' );
    190         $bbp_contextual_help[] = __( 'You can assign keywords to your topics using Topic Tags. Unlike categories, tags have no hierarchy, meaning there is no relationship from one tag to another.', 'bbpress' );
    191         $bbp_contextual_help[] = __( 'Normally, tags are ad-hoc keywords that identify important information in your topic (names, subjects, etc) that may or may not recur in other topics. If you think of your forum like a book, the tags are like the terms in the index.', 'bbpress' );
    192         $bbp_contextual_help[] = __( 'When editing a topic tag on this screen, you will fill in the following fields:', 'bbpress' );
    193         $bbp_contextual_help[] =
    194             '<ul>' .
    195                 '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.',                                                                                       'bbpress' ) . '</li>' .
    196                 '<li>' . __( '<strong>Slug</strong> - The Slug is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'bbpress' ) . '</li>' .
    197                 '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some forum themes may display it.',                                 'bbpress' ) . '</li>' .
    198             '</ul>' ;
    199 
    200         // Wrap each help item in paragraph tags
    201         foreach( $bbp_contextual_help as $paragraph )
    202             $contextual_help .= '<p>' . $paragraph . '</p>';
    203 
    204         // Add help
    205         add_contextual_help( 'edit-' . bbp_get_topic_tag_tax_id(), $contextual_help );
     112     * @uses get_current_screen()
     113     */
     114    public function edit_help() {
     115
     116        $current_screen = get_current_screen();
     117        $post_type      = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
     118
     119        // Bail if current screen could not be found
     120        if ( empty( $current_screen ) )
     121            return;
     122
     123        // Bail if not the topic post type
     124        if ( $post_type != $this->post_type )
     125            return;
     126
     127        // Overview
     128        $current_screen->add_help_tab( array(
     129            'id'        => 'overview',
     130            'title'     => __( 'Overview', 'bbpress' ),
     131            'content'   =>
     132                '<p>' . __( 'This screen provides access to all of your replies. You can customize the display of this screen to suit your workflow.', 'bbpress' ) . '</p>'
     133        ) );
     134
     135        // Screen Content
     136        $current_screen->add_help_tab( array(
     137            'id'        => 'screen-content',
     138            'title'     => __( 'Screen Content', 'bbpress' ),
     139            'content'   =>
     140                '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:' ) . '</p>' .
     141                '<ul>' .
     142                    '<li>' . __( 'You can hide/display columns based on your needs and decide how many replies to list per screen using the Screen Options tab.',                                                                                                                                                                          'bbpress' ) . '</li>' .
     143                    '<li>' . __( 'You can filter the list of replies by topic status using the text links in the upper left to show All, Published, Draft, or Trashed replies. The default view is to show all replies.',                                                                                                                   'bbpress' ) . '</li>' .
     144                    '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.',                                                                                                                                             'bbpress' ) . '</li>' .
     145                    '<li>' . __( 'You can refine the list to show only replies in a specific category or from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection. You also can refine the list by clicking on the topic author, category or tag in the replies list.', 'bbpress' ) . '</li>' .
     146                '</ul>'
     147        ) );
     148
     149        // Available Actions
     150        $current_screen->add_help_tab( array(
     151            'id'        => 'action-links',
     152            'title'     => __( 'Available Actions', 'bbpress' ),
     153            'content'   =>
     154                '<p>' . __( 'Hovering over a row in the replies list will display action links that allow you to manage your topic. You can perform the following actions:', 'bbpress' ) . '</p>' .
     155                '<ul>' .
     156                    '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that topic. You can also reach that screen by clicking on the topic title.',                                                                                 'bbpress' ) . '</li>' .
     157                    //'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your topic, allowing you to update topic details without leaving this screen.',                                                                  'bbpress' ) . '</li>' .
     158                    '<li>' . __( '<strong>Trash</strong> removes your topic from this list and places it in the trash, from which you can permanently delete it.',                                                                                       'bbpress' ) . '</li>' .
     159                    '<li>' . __( '<strong>Spam</strong> removes your topic from this list and places it in the spam queue, from which you can permanently delete it.',                                                                                   'bbpress' ) . '</li>' .
     160                    '<li>' . __( '<strong>Preview</strong> will show you what your draft topic will look like if you publish it. View will take you to your live site to view the topic. Which link is available depends on your topic&#8217;s status.', 'bbpress' ) . '</li>' .
     161                '</ul>'
     162        ) );
     163
     164        // Bulk Actions
     165        $current_screen->add_help_tab( array(
     166            'id'        => 'bulk-actions',
     167            'title'     => __( 'Bulk Actions', 'bbpress' ),
     168            'content'   =>
     169                '<p>' . __( 'You can also edit or move multiple replies to the trash at once. Select the replies you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.',           'bbpress' ) . '</p>' .
     170                '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected replies at once. To remove a topic from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' ) . '</p>'
     171        ) );
     172
     173        // Help Sidebar
     174        $current_screen->set_help_sidebar(
     175            '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
     176            '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
     177            '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>',       'bbpress' ) . '</p>'
     178        );
     179    }
     180
     181    /**
     182     * Contextual help for bbPress topic edit page
     183     *
     184     * @since bbPress (r3119)
     185     * @uses get_current_screen()
     186     */
     187    public function new_help() {
     188
     189        $current_screen = get_current_screen();
     190        $post_type      = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
     191
     192        // Bail if current screen could not be found
     193        if ( empty( $current_screen ) )
     194            return;
     195
     196        // Bail if not the topic post type
     197        if ( $post_type != $this->post_type )
     198            return;
     199
     200        $customize_display = '<p>' . __( 'The title field and the big topic editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
     201
     202        $current_screen->add_help_tab( array(
     203            'id'      => 'customize-display',
     204            'title'   => __( 'Customizing This Display', 'bbpress' ),
     205            'content' => $customize_display,
     206        ) );
     207
     208        $current_screen->add_help_tab( array(
     209            'id'      => 'title-topic-editor',
     210            'title'   => __( 'Title and Topic Editor', 'bbpress' ),
     211            'content' =>
     212                '<p>' . __( '<strong>Title</strong> - Enter a title for your topic. After you enter a title, you&#8217;ll see the permalink below, which you can edit.', 'bbpress' ) . '</p>' .
     213                '<p>' . __( '<strong>Topic Editor</strong> - Enter the text for your topic. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your topic text. You can insert media files by clicking the icons above the topic editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular topic editor.', 'bbpress' ) . '</p>'
     214        ) );
     215
     216        $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your topic in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a topic or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a topic to be published in the future or backdate a topic.', 'bbpress' ) . '</p>';
     217
     218        if ( current_theme_supports( 'topic-formats' ) && topic_type_supports( 'topic', 'topic-formats' ) ) {
     219            $publish_box .= '<p>' . __( '<strong>topic Format</strong> - This designates how your theme will display a specific topic. For example, you could have a <em>standard</em> blog topic with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/topic_Formats#Supported_Formats">descriptions of each topic format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
     220        }
     221
     222        if ( current_theme_supports( 'topic-thumbnails' ) && topic_type_supports( 'topic', 'thumbnail' ) ) {
     223            $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your topic without inserting it. This is usually useful only if your theme makes use of the featured image as a topic thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
     224        }
     225
     226        $current_screen->add_help_tab( array(
     227            'id'      => 'publish-box',
     228            'title'   => __( 'Publish Box', 'bbpress' ),
     229            'content' => $publish_box,
     230        ) );
     231
     232        $current_screen->add_help_tab( array(
     233            'id'      => 'discussion-settings',
     234            'title'   => __( 'Discussion Settings', 'bbpress' ),
     235            'content' =>
     236                '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
     237                '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the topic, you can see them here and moderate them.', 'bbpress' ) . '</p>'
     238        ) );
     239
     240        $current_screen->set_help_sidebar(
     241            '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
     242            '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
     243            '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>',       'bbpress' ) . '</p>'
     244        );
    206245    }
    207246
Note: See TracChangeset for help on using the changeset viewer.