Ticket #23312: 23312-2.patch

File 23312-2.patch, 5.2 KB (added by azaozz, 4 months ago)
  • wp-admin/css/wp-admin.css

     
    25272527        background-repeat: no-repeat; 
    25282528} 
    25292529 
     2530tr.wp-locked .locked-indicator { 
     2531        background: url('../images/lock16.png') no-repeat; 
     2532        margin: -2px 0 0 8px; 
     2533        height: 16px; 
     2534        width: 16px; 
     2535} 
     2536 
     2537tr.wp-locked .check-column label, 
     2538tr.wp-locked .check-column input[type="checkbox"], 
     2539tr.wp-locked .row-actions .inline { 
     2540        display: none; 
     2541} 
     2542 
    25302543.fixed .column-comments .sorting-indicator { 
    25312544        margin-top: 3px; 
    25322545} 
  • wp-admin/images/lock16.png

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
  • wp-admin/includes/class-wp-posts-list-table.php

    Property changes on: wp-admin/images/lock16.png
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
     
    472472                $title = _draft_or_post_title(); 
    473473                $post_type_object = get_post_type_object( $post->post_type ); 
    474474                $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID ); 
     475                $post_is_locked = wp_check_post_lock( $post->ID ); 
     476                $lock_holder = ''; 
    475477 
    476478                $alternate = 'alternate' == $alternate ? '' : 'alternate'; 
    477479                $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); 
     480         
     481                if ( $post_is_locked ) { 
     482                        $classes .= ' wp-locked'; 
     483                        $lock_holder_data = get_user_by( 'id', $post_is_locked ); 
     484 
     485                        if ( $lock_holder_data ) 
     486                                $lock_holder = esc_html( sprintf( __('Currently edited by %s'), $lock_holder_data->data->display_name ) ); 
     487                } 
    478488        ?> 
    479489                <tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>" valign="top"> 
    480490        <?php 
     
    495505                        case 'cb': 
    496506                        ?> 
    497507                        <th scope="row" class="check-column"> 
    498                                 <?php if ( $can_edit_post ) { ?> 
     508                                <?php 
     509                                if ( $can_edit_post ) { 
     510 
     511                                ?> 
    499512                                <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label> 
    500513                                <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" /> 
    501                                 <?php } ?> 
     514                                <div class="locked-indicator"></div> 
     515                                <?php 
     516                                } 
     517                                ?> 
    502518                        </th> 
    503519                        <?php 
    504520                        break; 
     
    525541                                        } 
    526542 
    527543                                        $pad = str_repeat( '&#8212; ', $level ); 
    528 ?> 
    529                         <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?></strong> 
    530 <?php 
    531                                 } 
    532                                 else { 
     544 
     545                                        ?> 
     546                                        <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?></strong> 
     547                                        <?php 
     548 
     549                                        if ( $can_edit_post && $post->post_status != 'trash' ) { 
     550                                                ?> 
     551                                                <span class="post-lock-holder"><?php echo $lock_holder; ?></span> 
     552                                                <?php 
     553                                        } 
     554                                } else { 
    533555                                        $attributes = 'class="post-title page-title column-title"' . $style; 
    534556 
    535557                                        $pad = str_repeat( '&#8212; ', $level ); 
    536 ?> 
    537                         <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); ?></strong> 
    538 <?php 
     558 
     559                                        ?> 
     560                                        <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); ?></strong> 
     561                                        <?php 
     562 
     563                                        if ( $can_edit_post && $post->post_status != 'trash' ) { 
     564                                                ?> 
     565                                                <span class="post-lock-holder"><?php echo $lock_holder; ?></span> 
     566                                                <?php 
     567                                        } 
     568 
    539569                                        if ( 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) 
    540570                                                the_excerpt(); 
    541571                                }