WordPress.org

Make WordPress Core

Changeset 18853


Ignore:
Timestamp:
10/01/2011 12:24:44 AM (10 years ago)
Author:
koopersmith
Message:

Make screen options a help tab. Move screen option functions into WP_Screen. see #18690, #18785.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r18779 r18853  
    118118<div id="wpbody-content">
    119119<?php
    120 screen_meta($current_screen);
     120
     121$current_screen->render_screen_meta();
    121122
    122123if ( is_network_admin() )
  • trunk/wp-admin/edit-form-advanced.php

    r18823 r18853  
    165165    $customize_display = '<p>' . __('The title field and the big Post 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.') . '</p>';
    166166
    167     $current_screen->add_help_tab( 'customize-display', __('Customizing This Display'), $customize_display );
     167    $current_screen->add_help_tab( array(
     168        'id'      => 'customize-display',
     169        'title'   => __('Customizing This Display'),
     170        'content' => $customize_display,
     171    ) );
    168172
    169173    $title_and_editor  = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.') . '</p>';
    170174    $title_and_editor .= '<p>' . __('<strong>Post editor</strong> - Enter the text for your post. 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 post text. You can insert media files by clicking the icons above the post editor and following the directions. You can go the distraction-free writing screen, new in 3.2, 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 post editor.') . '</p>';
    171175
    172     $current_screen->add_help_tab( 'title-post-editor', __('Title and Post Editor'), $title_and_editor );
     176    $current_screen->add_help_tab( array(
     177        'id'      => 'title-post-editor',
     178        'title'   => __('Title and Post Editor'),
     179        'content' => $title_and_editor,
     180    ) );
    173181
    174182    $publish_box = '<p>' . __('<strong>Publish</strong> - You can set the terms of publishing your post 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 post 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 post to be published in the future or backdate a post.') . '</p>';
     
    182190    }
    183191
    184     $current_screen->add_help_tab( 'publish-box', __('Publish Box'), $publish_box );
     192    $current_screen->add_help_tab( array(
     193        'title'   => __('Publish Box'),
     194        'content' => $publish_box,
     195    ) );
    185196
    186197    $discussion_settings  = '<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.') . '</p>';
    187198    $discussion_settings .= '<p>' . __('<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>';
    188199
    189     $current_screen->add_help_tab( 'discussion-settings', __('Discussion Settings'), $discussion_settings );
     200    $current_screen->add_help_tab( array(
     201        'title'   => __('Discussion Settings'),
     202        'content' => $discussion_settings,
     203    ) );
    190204
    191205    $current_screen->add_help_sidebar(
  • trunk/wp-admin/includes/class-wp-list-table.php

    r18632 r18853  
    898898     */
    899899    function _js_vars() {
     900        $current_screen = get_current_screen();
     901
    900902        $args = array(
    901             'class' => get_class( $this ),
    902             'screen' => get_current_screen()
     903            'class'  => get_class( $this ),
     904            'screen' => array(
     905                'id'   => $current_screen->id,
     906                'base' => $current_screen->base,
     907            )
    903908        );
    904909
  • trunk/wp-admin/includes/screen.php

    r18808 r18853  
    237237}
    238238
    239 function screen_meta($screen) {
    240     global $wp_meta_boxes, $_wp_contextual_help, $wp_list_table, $wp_current_screen_options;
     239function screen_meta( $screen ) {
     240    $current_screen = get_current_screen();
     241    $current_screen->render_screen_meta();
     242}
     243
     244/**
     245 * Add contextual help text for a page.
     246 *
     247 * Creates a 'Screen Info' help tab.
     248 *
     249 * @since 2.7.0
     250 *
     251 * @param string    $screen The handle for the screen to add help to.  This is usually the hook name returned by the add_*_page() functions.
     252 * @param string    $help   The content of a 'Screen Info' help tab.
     253 *
     254 * @todo: deprecate?
     255 */
     256function add_contextual_help($screen, $help) {
     257    global $_wp_contextual_help;
    241258
    242259    if ( is_string($screen) )
    243260        $screen = convert_to_screen($screen);
    244261
    245     $columns = get_column_headers( $screen );
    246     $hidden = get_hidden_columns( $screen );
    247 
    248     $meta_screens = array('index' => 'dashboard');
    249 
    250     if ( isset($meta_screens[$screen->id]) ) {
    251         $screen->id = $meta_screens[$screen->id];
    252         $screen->base = $screen->id;
    253     }
    254 
    255     $show_screen = false;
    256     if ( !empty($wp_meta_boxes[$screen->id]) || !empty($columns) )
    257         $show_screen = true;
    258 
    259     $screen_options = screen_options($screen);
    260     if ( $screen_options )
    261         $show_screen = true;
    262 
    263262    if ( !isset($_wp_contextual_help) )
    264263        $_wp_contextual_help = array();
    265264
    266     $settings = apply_filters('screen_settings', '', $screen);
    267 
    268     switch ( $screen->id ) {
    269         case 'widgets':
    270             $settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
    271             $show_screen = true;
    272             break;
    273     }
    274     if ( ! empty( $settings ) )
    275         $show_screen = true;
    276 
    277     if ( !empty($wp_current_screen_options) )
    278         $show_screen = true;
    279 
    280     $show_screen = apply_filters('screen_options_show_screen', $show_screen, $screen);
    281 
    282     // If we have screen options, add the menu to the admin bar.
    283     if ( $show_screen )
    284         add_action( 'admin_bar_menu', 'wp_admin_bar_screen_options_menu', 80 );
    285 
    286 
    287 ?>
    288 <div id="screen-meta">
    289 <?php if ( $show_screen ) : ?>
    290 <div id="screen-options-wrap" class="hidden">
    291     <form id="adv-settings" action="" method="post">
    292     <?php if ( isset($wp_meta_boxes[$screen->id]) ) : ?>
    293         <h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>
    294         <div class="metabox-prefs">
    295             <?php meta_box_prefs($screen); ?>
    296             <br class="clear" />
    297         </div>
    298         <?php endif;
    299         if ( ! empty($columns) ) : ?>
    300         <h5><?php echo ( isset( $columns['_title'] ) ?  $columns['_title'] :  _x('Show on screen', 'Columns') ) ?></h5>
    301         <div class="metabox-prefs">
    302 <?php
    303     $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname');
    304 
    305     foreach ( $columns as $column => $title ) {
    306         // Can't hide these for they are special
    307         if ( in_array( $column, $special ) )
    308             continue;
    309         if ( empty( $title ) )
    310             continue;
    311 
    312         if ( 'comments' == $column )
    313             $title = __( 'Comments' );
    314         $id = "$column-hide";
    315         echo '<label for="' . $id . '">';
    316         echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';
    317         echo "$title</label>\n";
    318     }
    319 ?>
    320             <br class="clear" />
    321         </div>
    322     <?php endif;
    323     echo screen_layout($screen);
    324 
    325     if ( !empty( $screen_options ) ) {
    326         ?>
    327         <h5><?php _ex('Show on screen', 'Screen Options') ?></h5>
    328         <?php
    329     }
    330 
    331     echo $screen_options;
    332     echo $settings; ?>
    333     <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
    334     </form>
    335 </div>
    336 
    337 <?php endif; // $show_screen
    338 
    339     $_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen);
    340     ?>
    341     <div id="contextual-help-wrap" class="hidden">
    342     <?php
    343     $contextual_help = '';
    344     if ( isset($_wp_contextual_help[$screen->id]) && is_array($_wp_contextual_help[$screen->id]) ) {
    345 
    346         /*
    347          * Loop through ['contextual-help-tabs']
    348          *   - It's a nested array where $key=>$value >> $title=>$content
    349          * Has no output so can only loop the array once
    350          */
    351         $contextual_help_links = ''; // store looped content for later
    352         $contextual_help_panels = ''; // store looped content for later
    353 
    354         $tab_active = true;
    355 
    356         foreach ( $_wp_contextual_help[$screen->id]['tabs'] as $tab ) {
    357             list( $id, $title, $content ) = $tab;
    358 
    359             // Generate IDs
    360             $id = sanitize_html_class( $id );
    361             $link_id  = "tab-link-$id";
    362             $panel_id = "tab-panel-$id";
    363 
    364             $link_classes  = '';
    365             $panel_classes = 'help-tab-content';
    366 
    367             if ( $tab_active ) {
    368                 $link_classes  .= ' active';
    369                 $panel_classes .= ' active';
    370             }
    371 
    372             $link_classes = ( $tab_active ) ? 'active' : '';
    373 
    374             $contextual_help_links .= '<li id="' . esc_attr( $link_id ) . '" class="' . esc_attr( $link_classes ) . '">';
    375             $contextual_help_links .= '<a href="' . esc_url( "#$panel_id" ) . '">' . esc_html( $title ) . '</a>';
    376             $contextual_help_links .= '</li>';
    377 
    378             $contextual_help_panels .= '<div id="' . esc_attr( $panel_id ) . '" class="' . esc_attr( $panel_classes ) . '">';
    379             $contextual_help_panels .= '<h3>' . esc_html( $title ) . '</h3>';
    380             $contextual_help_panels .= $content;
    381             $contextual_help_panels .= "</div>";
    382 
    383             $tab_active = false;
    384         }
    385 
    386         // Start output from loop: Tabbed help content
    387         $contextual_help .= '<ul class="contextual-help-tabs">' . "\n";
    388         $contextual_help .= $contextual_help_links;
    389         $contextual_help .= '</ul>' ."\n";
    390 
    391         // Sidebar to right of tabs
    392         $contextual_help .= '<div class="contextual-help-sidebar">' . "\n";
    393         $contextual_help .= $_wp_contextual_help[$screen->id]['sidebar'];
    394         $contextual_help .= "</div>\n";
    395 
    396         // Panel content
    397         $contextual_help .= '<div class="contextual-help-tabs-wrap">' . "\n";
    398         $contextual_help .= $contextual_help_panels;
    399         $contextual_help .= "</div>\n";
    400 
    401     } elseif ( isset( $_wp_contextual_help[ $screen->id ] ) ) {
    402         $contextual_help .= $_wp_contextual_help[ $screen->id ];
    403 
    404     } else {
    405         $default_help  = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' );
    406         $default_help .= '<br />';
    407         $default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' );
    408 
    409         $contextual_help .= apply_filters( 'default_contextual_help', $default_help );
    410     }
    411 
    412     $contextual_help = "<div class='metabox-prefs'>$contextual_help</div>";
    413 
    414     echo apply_filters('contextual_help', $contextual_help, $screen->id, $screen);
    415     ?>
    416     </div>
    417 
    418 </div> <?php // #screen-meta
    419 }
    420 
    421 /**
    422  * Add contextual help text for a page
    423  *
    424  * The array $help takes the following format:
    425  *  array( 'contextual-help-tabs'   => array( $tab1_title => $tab1_value [, $tab2_title => $tab2_value, ...] ),
    426  *      'contextual-help-sidebar' => $help_links_as_string )
    427  *
    428  * For backwards compatability, a string is also accepted.
    429  *
    430  * @since 2.7.0
    431  *
    432  * @param string    $screen The handle for the screen to add help to.  This is usually the hook name returned by the add_*_page() functions.
    433  * @param array|string  $help   Creates tabs & links columns within help text in array.
    434  *
    435  */
    436 function add_contextual_help($screen, $help) {
    437     global $_wp_contextual_help;
    438 
    439     if ( is_string($screen) )
    440         $screen = convert_to_screen($screen);
    441 
    442     if ( !isset($_wp_contextual_help) )
    443         $_wp_contextual_help = array();
    444 
    445265    $_wp_contextual_help[$screen->id] = $help;
    446266}
    447267
     268/**
     269 * Returns the screen layout options.
     270 *
     271 * @todo: deprecate?
     272 */
    448273function screen_layout($screen) {
    449     global $screen_layout_columns, $wp_current_screen_options;
    450 
    451     if ( is_string($screen) )
    452         $screen = convert_to_screen($screen);
    453 
    454     // Back compat for plugins using the filter instead of add_screen_option()
    455     $columns = apply_filters('screen_layout_columns', array(), $screen->id, $screen);
    456     if ( !empty($columns) && isset($columns[$screen->id]) )
    457         add_screen_option('layout_columns', array('max' => $columns[$screen->id]) );
    458 
    459     if ( !isset($wp_current_screen_options['layout_columns']) ) {
    460         $screen_layout_columns = 0;
     274    $current_screen = get_current_screen();
     275
     276    if ( ! $current_screen )
    461277        return '';
    462     }
    463 
    464     $screen_layout_columns = get_user_option("screen_layout_$screen->id");
    465     $num = $wp_current_screen_options['layout_columns']['max'];
    466 
    467     if ( ! $screen_layout_columns ) {
    468         if ( isset($wp_current_screen_options['layout_columns']['default']) )
    469             $screen_layout_columns = $wp_current_screen_options['layout_columns']['default'];
    470         else
    471             $screen_layout_columns = 'auto';
    472     }
    473 
    474     $i = 1;
    475     $return = '<h5>' . __('Screen Layout') . "</h5>\n<div class='columns-prefs'>" . __('Number of Columns:') . "\n";
    476     while ( $i <= $num ) {
    477         $return .= "<label><input type='radio' name='screen_columns' value='$i'" . ( ($screen_layout_columns == $i) ? " checked='checked'" : "" ) . " /> $i</label>\n";
    478         ++$i;
    479     }
    480     $return .= "<label><input type='radio' id='wp_auto_columns' name='screen_columns' value='auto'" . ( ($screen_layout_columns == 'auto') ? " checked='checked'" : "" ) . " /> " . __('Auto') . "</label>\n";
    481     $return .= "</div>\n";
    482     return $return;
     278
     279    ob_start();
     280    $current_screen->render_screen_layout();
     281    $screen_layout = ob_get_clean();
     282
     283    return $screen_layout;
    483284}
    484285
     
    493294 */
    494295function add_screen_option( $option, $args = array() ) {
    495     global $wp_current_screen_options;
    496 
    497     if ( !isset($wp_current_screen_options) )
    498         $wp_current_screen_options = array();
    499 
    500     $wp_current_screen_options[$option] = $args;
    501 }
    502 
     296    $current_screen = get_current_screen();
     297
     298    if ( ! $current_screen )
     299        return;
     300
     301    return $current_screen->add_option( $option, $args );
     302}
     303
     304
     305/**
     306 * Returns the screen's per-page options.
     307 *
     308 * @todo: deprecate?
     309 */
    503310function screen_options($screen) {
    504     global $wp_current_screen_options;
    505 
    506     if ( is_string($screen) )
    507         $screen = convert_to_screen($screen);
    508 
    509     if ( !isset($wp_current_screen_options['per_page']) )
     311    $current_screen = get_current_screen();
     312
     313    if ( ! $current_screen )
    510314        return '';
    511315
    512     $per_page_label = $wp_current_screen_options['per_page']['label'];
    513 
    514     if ( empty($wp_current_screen_options['per_page']['option']) ) {
    515         $option = str_replace( '-', '_', "{$screen->id}_per_page" );
    516     } else {
    517         $option = $wp_current_screen_options['per_page']['option'];
    518     }
    519 
    520     $per_page = (int) get_user_option( $option );
    521     if ( empty( $per_page ) || $per_page < 1 ) {
    522         if ( isset($wp_current_screen_options['per_page']['default']) )
    523             $per_page = $wp_current_screen_options['per_page']['default'];
    524         else
    525             $per_page = 20;
    526     }
    527 
    528     if ( 'edit_comments_per_page' == $option )
    529         $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
    530     elseif ( 'categories_per_page' == $option )
    531         $per_page = apply_filters( 'edit_categories_per_page', $per_page );
    532     else
    533         $per_page = apply_filters( $option, $per_page );
    534 
    535     // Back compat
    536     if ( isset( $screen->post_type ) )
    537         $per_page = apply_filters( 'edit_posts_per_page', $per_page, $screen->post_type );
    538 
    539     $return = "<div class='screen-options'>\n";
    540     if ( !empty($per_page_label) )
    541         $return .= "<input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>\n";
    542     $return .= get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );
    543     $return .= "<input type='hidden' name='wp_screen_options[option]' value='" . esc_attr($option) . "' />";
    544     $return .= "</div>\n";
    545     return $return;
     316    ob_start();
     317    $current_screen->render_per_page_options();
     318    $per_page_options = ob_get_clean();
     319
     320    return $per_page_options;
    546321}
    547322
     
    706481     */
    707482    public $taxonomy;
     483
     484    /**
     485     * The help tab data associated with the screen, if any.
     486     *
     487     * @since 3.3.0
     488     * @var array
     489     * @access private
     490     */
     491    public $help_tabs = array();
     492
     493    /**
     494     * The help sidebar data associated with the screen, if any.
     495     *
     496     * @since 3.3.0
     497     * @var string
     498     * @access private
     499     */
     500    public $help_sidebar = '';
     501
     502    /**
     503     * The screen options associated with the screen, if any.
     504     *
     505     * @since 3.3.0
     506     * @var array
     507     * @access private
     508     */
     509    public $options = array();
     510
     511
     512    /**
     513     * Stores the result of the public show_screen_options function.
     514     *
     515     * @since 3.3.0
     516     * @var bool
     517     * @access private
     518     */
     519    private $_show_screen_options;
     520
     521    /**
     522     * Stores the 'screen_settings' section of screen options.
     523     *
     524     * @since 3.3.0
     525     * @var string
     526     * @access private
     527     */
     528    private $_screen_settings;
    708529
    709530    /**
     
    801622     */
    802623    public function add_option( $option, $args = array() ) {
    803         return add_screen_option( $option, $args );
     624        $this->options[ $option ] = $args;
    804625    }
    805626
     
    810631     * @since 3.3.0
    811632     *
    812      * @param string $id Tab ID
    813      * @param string $title Title for the tab
    814      * @param string $content Help tab content in plain text or HTML.
    815      */
    816     public function add_help_tab( $id, $title, $content) {
    817         global $_wp_contextual_help;
    818 
    819         $_wp_contextual_help[$this->id]['tabs'][] = array( $id, $title, $content );
     633     * @param array $args
     634     * - string   - title    - Title for the tab.
     635     * - string   - id       - Tab ID. Optional.
     636     * - string   - content  - Help tab content in plain text or HTML. Optional.
     637     * - callback - callback - A callback to generate the tab content. Optional.
     638     *
     639     */
     640    public function add_help_tab( $args ) {
     641        $defaults = array(
     642            'title'    => false,
     643            'id'       => false,
     644            'content'  => '',
     645            'callback' => false,
     646        );
     647        $args = wp_parse_args( $args, $defaults );
     648
     649        // Ensure we have a title.
     650        if ( ! $args['title'] )
     651            return;
     652
     653        // Create an id from the title if one is not provided.
     654        if ( ! $args['id'] )
     655            $args['id'] = sanitize_html_class( $args['title'] );
     656
     657        $this->help_tabs[] = $args;
    820658    }
    821659
     
    829667     */
    830668    public function add_help_sidebar( $content ) {
     669        $this->help_sidebar = $content;
     670    }
     671
     672    /**
     673     * Render the screen's help section.
     674     *
     675     * This will trigger the deprecated filters for backwards compatibility.
     676     *
     677     * @since 3.3.0
     678     */
     679    public function render_screen_meta() {
    831680        global $_wp_contextual_help;
    832681
    833         $_wp_contextual_help[$this->id]['sidebar'] = $content;
    834     }
    835 }
     682        // Call old contextual_help_list filter.
     683        if ( ! isset( $_wp_contextual_help ) )
     684            $_wp_contextual_help = array();
     685        $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this );
     686
     687        if ( isset( $_wp_contextual_help[ $this->id ] ) ) {
     688            // Call old contextual_help filter.
     689            $contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this );
     690
     691            $this->add_help_tab( array(
     692                'title'   => __('Screen Info'),
     693                'content' => $contextual_help,
     694            ) );
     695        }
     696
     697        // Add screen options tab
     698        if ( $this->show_screen_options() ) {
     699            $this->add_help_tab( array(
     700                'title'    => __('Screen Options'),
     701                'callback' => array( $this, 'render_screen_options' ),
     702            ) );
     703        }
     704
     705        // Time to render!
     706        ?>
     707        <div id="screen-meta" class='metabox-prefs'>
     708            <div id="contextual-help-wrap" class="hidden">
     709                <ul class="contextual-help-tabs">
     710                    <?php foreach ( $this->help_tabs as $i => $tab ):
     711                        $link_id  = "tab-link-{$tab['id']}";
     712                        $panel_id = "tab-panel-{$tab['id']}";
     713                        $classes  = ( $i == 0 ) ? 'active' : '';
     714                        ?>
     715
     716                        <li id="<?php echo esc_attr( $link_id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
     717                            <a href="<?php echo esc_url( "#$panel_id" ); ?>">
     718                                <?php echo esc_html( $tab['title'] ); ?>
     719                            </a>
     720                        </li>
     721                    <?php endforeach; ?>
     722                </ul>
     723
     724                <div class="contextual-help-sidebar">
     725                    <?php echo $this->help_sidebar; ?>
     726                </div>
     727
     728                <div class="contextual-help-tabs-wrap">
     729                    <?php foreach ( $this->help_tabs as $i => $tab ):
     730                        $panel_id = "tab-panel-{$tab['id']}";
     731                        $classes  = ( $i == 0 ) ? 'active' : '';
     732                        $classes .= ' help-tab-content';
     733                        ?>
     734
     735                        <div id="<?php echo esc_attr( $panel_id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
     736                            <h3><?php echo esc_html( $tab['title'] ); ?></h3>
     737                            <?php
     738                            // Print tab content.
     739                            echo $tab['content'];
     740
     741                            // If it exists, fire tab callback.
     742                            if ( ! empty( $tab['callback'] ) )
     743                                call_user_func( $tab['callback'], $this );
     744                            ?>
     745                        </div>
     746                    <?php endforeach; ?>
     747                </div>
     748            </div>
     749        </div>
     750        <?php
     751    }
     752
     753    public function show_screen_options() {
     754        global $wp_meta_boxes, $wp_list_table;
     755
     756        if ( is_bool( $this->_show_screen_options ) )
     757            return $this->_show_screen_options;
     758
     759        $columns = get_column_headers( $this );
     760
     761        $show_screen = false;
     762        if ( ! empty( $wp_meta_boxes[ $this->id ] ) || ! empty( $columns ) )
     763            $show_screen = true;
     764
     765        // Check if there are per-page options.
     766        $show_screen = $show_screen || isset( $this->options['per_page'] );
     767
     768        $this->_screen_settings = apply_filters( 'screen_settings', '', $this );
     769
     770        switch ( $this->id ) {
     771            case 'widgets':
     772                $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
     773                $show_screen = true;
     774                break;
     775        }
     776
     777        if ( ! empty( $this->_screen_settings ) )
     778            $show_screen = true;
     779
     780        if ( ! empty( $this->options ) )
     781            $show_screen = true;
     782
     783        $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
     784        return $this->_show_screen_options;
     785    }
     786
     787    /**
     788     * Render the screen options tab.
     789     *
     790     * @since 3.3.0
     791     */
     792    public function render_screen_options() {
     793        global $wp_meta_boxes, $wp_list_table;
     794
     795        $columns = get_column_headers( $this );
     796        $hidden  = get_hidden_columns( $this );
     797
     798        ?>
     799        <form id="adv-settings" action="" method="post">
     800        <?php if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?>
     801            <h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>
     802            <div class="metabox-prefs">
     803                <?php meta_box_prefs( $this ); ?>
     804                <br class="clear" />
     805            </div>
     806            <?php endif;
     807            if ( ! empty( $columns ) ) : ?>
     808            <h5><?php echo ( isset( $columns['_title'] ) ?  $columns['_title'] :  _x('Show on screen', 'Columns') ) ?></h5>
     809            <div class="metabox-prefs">
     810                <?php
     811                $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname');
     812
     813                foreach ( $columns as $column => $title ) {
     814                    // Can't hide these for they are special
     815                    if ( in_array( $column, $special ) )
     816                        continue;
     817                    if ( empty( $title ) )
     818                        continue;
     819
     820                    if ( 'comments' == $column )
     821                        $title = __( 'Comments' );
     822                    $id = "$column-hide";
     823                    echo '<label for="' . $id . '">';
     824                    echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';
     825                    echo "$title</label>\n";
     826                }
     827                ?>
     828                <br class="clear" />
     829            </div>
     830        <?php endif;
     831
     832        $this->render_screen_layout();
     833        $this->render_per_page_options();
     834        echo $this->_screen_settings;
     835
     836        ?>
     837        <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
     838        </form>
     839        <?php
     840    }
     841
     842    function render_screen_layout() {
     843        global $screen_layout_columns;
     844
     845        // Back compat for plugins using the filter instead of add_screen_option()
     846        $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
     847
     848        if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
     849            add_screen_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
     850
     851        if ( ! isset( $this->options['layout_columns'] ) ) {
     852            $screen_layout_columns = 0;
     853            return;
     854        }
     855
     856        $screen_layout_columns = get_user_option("screen_layout_$this->id");
     857        $num = $this->options['layout_columns']['max'];
     858
     859        if ( ! $screen_layout_columns ) {
     860            if ( isset( $this->options['layout_columns']['default'] ) )
     861                $screen_layout_columns = $this->options['layout_columns']['default'];
     862            else
     863                $screen_layout_columns = 'auto';
     864        }
     865
     866        ?>
     867        <h5><?php _e('Screen Layout'); ?></h5>
     868        <div class='columns-prefs'><?php
     869            _e('Number of Columns:');
     870            for ( $i = 1; $i <= $num; ++$i ):
     871                ?>
     872                <label>
     873                    <input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
     874                        <?php checked( $screen_layout_columns, $i ); ?> />
     875                    <?php echo esc_html( $i ); ?>
     876                </label>
     877                <?php
     878            endfor; ?>
     879            <label>
     880                <input type='radio' id='wp_auto_columns' name='screen_columns' value='auto'
     881                    <?php checked( $screen_layout_columns, 'auto' ); ?> />
     882                <?php esc_html_e('Auto'); ?>
     883            </label>
     884        </div>
     885        <?php
     886    }
     887
     888    function render_per_page_options() {
     889        if ( ! isset( $this->options['per_page'] ) )
     890            return;
     891
     892        $per_page_label = $this->options['per_page']['label'];
     893
     894        if ( empty( $this->options['per_page']['option'] ) ) {
     895            $option = str_replace( '-', '_', "{$this->id}_per_page" );
     896        } else {
     897            $option = $this->options['per_page']['option'];
     898        }
     899
     900        $per_page = (int) get_user_option( $option );
     901        if ( empty( $per_page ) || $per_page < 1 ) {
     902            if ( isset($this->options['per_page']['default']) )
     903                $per_page = $this->options['per_page']['default'];
     904            else
     905                $per_page = 20;
     906        }
     907
     908        if ( 'edit_comments_per_page' == $option ) {
     909            $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
     910            $per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );
     911        } elseif ( 'categories_per_page' == $option ) {
     912            $per_page = apply_filters( 'edit_categories_per_page', $per_page );
     913        } else {
     914            $per_page = apply_filters( $option, $per_page );
     915        }
     916
     917        // Back compat
     918        if ( isset( $this->post_type ) )
     919            $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type );
     920
     921        ?>
     922        <h5><?php _ex('Show on screen', 'Screen Options') ?></h5>
     923        <div class='screen-options'>
     924            <?php if ( !empty($per_page_label) ): ?>
     925                <input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>
     926            <?php endif;
     927
     928            echo get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); ?>
     929            <input type='hidden' name='wp_screen_options[option]' value='<?php echo esc_attr($option); ?>' />
     930        </div>
     931        <?php
     932    }
     933}
  • trunk/wp-admin/index.php

    r18797 r18853  
    3333$help_overview = '<p>' . __('Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the top bar.') . '</p>';
    3434
    35 $current_screen->add_help_tab( 'overview', __('Overview'), $help_overview );
     35$current_screen->add_help_tab( array(
     36    'title'   => __('Overview'),
     37    'content' => $help_overview,
     38) );
    3639
    3740$help_navigation  = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>';
    3841$help_navigation .= '<p>' . __('Links in the &#8220;admin bar&#8221; at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';
    3942
    40 $current_screen->add_help_tab( 'navigation', __('Navigation'), $help_navigation );
     43$current_screen->add_help_tab( array(
     44    'title'   => __('Navigation'),
     45    'content' => $help_navigation,
     46) );
    4147
    4248$help_layout  = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>';
     
    4551$help_layout .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.') . '</p>';
    4652
    47 $current_screen->add_help_tab( 'layout', __('Layout'), $help_layout );
     53$current_screen->add_help_tab( array(
     54    'title'   => __('Layout'),
     55    'content' => $help_layout,
     56) );
    4857
    4958$help_content  = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>';
     
    5766$help_content .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>';
    5867
    59 $current_screen->add_help_tab( 'content', __('Content'), $help_content );
     68$current_screen->add_help_tab( array(
     69    'title'   => __('Content'),
     70    'content' => $help_content,
     71) );
    6072
    6173$current_screen->add_help_sidebar(
  • trunk/wp-admin/js/common.dev.js

    r18797 r18853  
    267267
    268268    // Adjust the height of the help columns
    269     columns = $('#contextual-help-wrap').children('.metabox-prefs').children();
     269    columns = $('#contextual-help-wrap').children();
    270270    columns.height('auto');
    271271
  • trunk/wp-admin/js/common.js

    r18797 r18853  
    1 var showNotice,adminMenu,columns,validateForm,screenMeta,autofold_menu;(function(a){adminMenu={init:function(){var b=a("#adminmenu");this.favorites();a("#collapse-menu",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});this.flyout(a("#adminmenu li.wp-has-submenu"));this.fold(!a("body").hasClass("folded"))},restoreMenuState:function(){},flyout:function(c,b){if(b){c.unbind();return}c.hoverIntent({over:function(k){var g,d,i,l,j;g=a(this).find(".wp-submenu");d=a(this).offset().top+g.height()+1;i=a("#wpwrap").height();l=60+d-i;j=a(window).height()+a(window).scrollTop()-15;if(j<(d-l)){l=d-j}if(l>1){g.css({marginTop:"-"+l+"px"})}else{if(g.css("marginTop")){g.css({marginTop:""})}}g.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:220,sensitivity:8,interval:100})},toggle:function(){},fold:function(c){var b=a("#adminmenu li.wp-has-current-submenu");a("body").toggleClass("folded",!c);this.flyout(b,c);if(c){b.find(".wp-submenu").css("marginTop","0")}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,padding:null,top:null,map:{"wp-admin-bar-screen-options":"screen-options-wrap","wp-admin-bar-help":"contextual-help-wrap"},init:function(){screenMeta.element=a("#screen-meta");screenMeta.toggles=a(".screen-meta-toggle");screenMeta.page=a("#wpcontent");screenMeta.toggles.click(screenMeta.toggleEvent)},toggleEvent:function(c){var b;c.preventDefault();if(!screenMeta.map[this.id]){return}b=a("#"+screenMeta.map[this.id]);if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){screenMeta.toggles.filter(".selected").click();c.addClass("selected");screenMeta.padding=parseInt(screenMeta.page.css("paddingTop"),10);screenMeta.top=parseInt(screenMeta.element.css("top"),10);b.show();screenMeta.refresh()},refresh:function(b,c){screenMeta.element.css({top:0});screenMeta.page.css({paddingTop:screenMeta.padding+screenMeta.element.outerHeight()})},close:function(b,c){screenMeta.element.css({top:screenMeta.top});screenMeta.page.css({paddingTop:screenMeta.padding});b.hide();c.removeClass("selected")}};a(".contextual-help-tabs").delegate("a","click focus",function(g){var f=a(this),c,d,b;g.preventDefault();if(f.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");f.parent("li").addClass("active");c=a(f.attr("href"));a(".help-tab-content").not(c).removeClass("active").hide();c.addClass("active").show();d=a("#contextual-help-wrap").children(".metabox-prefs").children();d.height("auto");b=Math.max.apply(null,a.map(d,function(e){return a(e).height()}));d.height(b);screenMeta.refresh()});a(document).ready(function(){var h=false,b,f,e,d,g=a("input.current-page"),c=g.val();a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(i){if("undefined"==i.shiftKey){return true}if(i.shiftKey){if(!h){return true}b=a(h).closest("form").find(":checkbox");f=b.index(h);e=b.index(this);d=a(this).prop("checked");if(0<f&&0<e&&f!=e){b.slice(f,e).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return d}return false})}}h=this;return true});a("thead, tfoot").find(".check-column :checkbox").click(function(k){var l=a(this).prop("checked"),j="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,i=k.shiftKey||j;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).closest("tr").is(":hidden")){return false}if(i){return a(this).prop("checked")}else{if(l){return true}}return false});a(this).closest("table").children("thead,  tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(i){return false}else{if(l){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(n){if(n.keyCode!=9){return true}var k=n.target,p=k.selectionStart,j=k.selectionEnd,o=k.value,i,m;try{this.lastKey=9}catch(l){}if(document.selection){k.focus();m=document.selection.createRange();m.text="\t"}else{if(p>=0){i=this.scrollTop;k.value=o.substring(0,p).concat("\t",o.substring(j));k.selectionStart=k.selectionEnd=p+1;this.scrollTop=i}}if(n.stopPropagation){n.stopPropagation()}if(n.preventDefault){n.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(i){if(this.lastKey&&9==this.lastKey){this.focus()}});if(g.length){g.closest("form").submit(function(i){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&g.val()==c){g.val("1")}})}a(window).bind("resize.autofold",function(){if(getUserSetting("mfold")=="f"){return}var i=a(window).width();adminMenu.fold(i>=800)}).triggerHandler("resize")});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
     1var showNotice,adminMenu,columns,validateForm,screenMeta,autofold_menu;(function(a){adminMenu={init:function(){var b=a("#adminmenu");this.favorites();a("#collapse-menu",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});this.flyout(a("#adminmenu li.wp-has-submenu"));this.fold(!a("body").hasClass("folded"))},restoreMenuState:function(){},flyout:function(c,b){if(b){c.unbind();return}c.hoverIntent({over:function(k){var g,d,i,l,j;g=a(this).find(".wp-submenu");d=a(this).offset().top+g.height()+1;i=a("#wpwrap").height();l=60+d-i;j=a(window).height()+a(window).scrollTop()-15;if(j<(d-l)){l=d-j}if(l>1){g.css({marginTop:"-"+l+"px"})}else{if(g.css("marginTop")){g.css({marginTop:""})}}g.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:220,sensitivity:8,interval:100})},toggle:function(){},fold:function(c){var b=a("#adminmenu li.wp-has-current-submenu");a("body").toggleClass("folded",!c);this.flyout(b,c);if(c){b.find(".wp-submenu").css("marginTop","0")}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,padding:null,top:null,map:{"wp-admin-bar-screen-options":"screen-options-wrap","wp-admin-bar-help":"contextual-help-wrap"},init:function(){screenMeta.element=a("#screen-meta");screenMeta.toggles=a(".screen-meta-toggle");screenMeta.page=a("#wpcontent");screenMeta.toggles.click(screenMeta.toggleEvent)},toggleEvent:function(c){var b;c.preventDefault();if(!screenMeta.map[this.id]){return}b=a("#"+screenMeta.map[this.id]);if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){screenMeta.toggles.filter(".selected").click();c.addClass("selected");screenMeta.padding=parseInt(screenMeta.page.css("paddingTop"),10);screenMeta.top=parseInt(screenMeta.element.css("top"),10);b.show();screenMeta.refresh()},refresh:function(b,c){screenMeta.element.css({top:0});screenMeta.page.css({paddingTop:screenMeta.padding+screenMeta.element.outerHeight()})},close:function(b,c){screenMeta.element.css({top:screenMeta.top});screenMeta.page.css({paddingTop:screenMeta.padding});b.hide();c.removeClass("selected")}};a(".contextual-help-tabs").delegate("a","click focus",function(g){var f=a(this),c,d,b;g.preventDefault();if(f.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");f.parent("li").addClass("active");c=a(f.attr("href"));a(".help-tab-content").not(c).removeClass("active").hide();c.addClass("active").show();d=a("#contextual-help-wrap").children();d.height("auto");b=Math.max.apply(null,a.map(d,function(e){return a(e).height()}));d.height(b);screenMeta.refresh()});a(document).ready(function(){var h=false,b,f,e,d,g=a("input.current-page"),c=g.val();a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(i){if("undefined"==i.shiftKey){return true}if(i.shiftKey){if(!h){return true}b=a(h).closest("form").find(":checkbox");f=b.index(h);e=b.index(this);d=a(this).prop("checked");if(0<f&&0<e&&f!=e){b.slice(f,e).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return d}return false})}}h=this;return true});a("thead, tfoot").find(".check-column :checkbox").click(function(k){var l=a(this).prop("checked"),j="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,i=k.shiftKey||j;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).closest("tr").is(":hidden")){return false}if(i){return a(this).prop("checked")}else{if(l){return true}}return false});a(this).closest("table").children("thead,  tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(i){return false}else{if(l){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(n){if(n.keyCode!=9){return true}var k=n.target,p=k.selectionStart,j=k.selectionEnd,o=k.value,i,m;try{this.lastKey=9}catch(l){}if(document.selection){k.focus();m=document.selection.createRange();m.text="\t"}else{if(p>=0){i=this.scrollTop;k.value=o.substring(0,p).concat("\t",o.substring(j));k.selectionStart=k.selectionEnd=p+1;this.scrollTop=i}}if(n.stopPropagation){n.stopPropagation()}if(n.preventDefault){n.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(i){if(this.lastKey&&9==this.lastKey){this.focus()}});if(g.length){g.closest("form").submit(function(i){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&g.val()==c){g.val("1")}})}a(window).bind("resize.autofold",function(){if(getUserSetting("mfold")=="f"){return}var i=a(window).width();adminMenu.fold(i>=800)}).triggerHandler("resize")});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
  • trunk/wp-includes/admin-bar.php

    r18844 r18853  
    578578
    579579/**
    580  * Add screen options link.
    581  *
    582  * @since 3.3.0
    583  */
    584 function wp_admin_bar_screen_options_menu( $wp_admin_bar ) {
    585     $wp_admin_bar->add_menu( array(
    586         'id'    => 'screen-options',
    587         'title' => __('Screen Options'),
    588         'href'  => '#',
    589         'meta'  => array(
    590             'class' => 'screen-meta-toggle hide-if-no-js',
    591         ),
    592     ) );
    593 }
    594 
    595 /**
    596580 * Add help link.
    597581 *
  • trunk/wp-includes/script-loader.php

    r18851 r18853  
    6262    $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
    6363
    64     $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110927', 1 );
     64    $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110930', 1 );
    6565    $scripts->add_script_data( 'common', 'commonL10n', array(
    6666        'warnDelete' => __("You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.")
Note: See TracChangeset for help on using the changeset viewer.