Changeset 8973 for trunk/wp-admin/includes/template.php
- Timestamp:
- 09/25/2008 01:42:34 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/template.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r8967 r8973 623 623 $col_count = count($columns) - $hidden_count; 624 624 $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list'; 625 ?> 626 <tr title="<?php _e('Double-click to cancel'); ?>" id="inline-edit" style="display: none"><td colspan="<?php echo $col_count; ?>"> 625 $can_publish = current_user_can('publish_posts'); ?> 626 627 <form method="get" action=""><table style="display: none"><tbody id="inlineedit"> 628 <?php 629 $bulk = 0; 630 while ( $bulk < 2 ) { ?> 631 632 <tr title="<?php _e('Double-click to cancel'); ?>" id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" style="display: none"><td colspan="<?php echo $col_count; ?>"> 627 633 <?php 628 634 foreach($columns as $column_name=>$column_display_name) { … … 641 647 case 'modified': 642 648 case 'date': 643 ?>649 if ( ! $bulk ) { ?> 644 650 <div <?php echo $attributes; ?> title="<?php _e('Timestamp'); ?>"> 645 651 <div class="title"><?php _e('Timestamp'); ?></div> … … 649 655 </div> 650 656 <?php 657 } 651 658 break; 652 659 653 660 case 'title': 654 661 $attributes = "class=\"$type-title column-title quick-edit-div\"" . $style; ?> 662 <?php if ( $bulk ) { ?> 663 <div <?php echo $attributes; ?> id="bulk-title-div" title="<?php $is_page ? _e('Selected pages') : _e('Selected posts'); ?>"> 664 <div class="title"><?php $is_page ? _e('Selected pages') : _e('Selected posts'); ?></div> 665 <div class="in"> 666 <div id="bulk-titles"></div> 667 </div> 668 </div> 669 <?php } else { ?> 655 670 <div <?php echo $attributes ?>> 656 671 <div class="title"><?php _e('Title'); ?></div> … … 661 676 </div> 662 677 </div> 678 <?php } ?> 679 663 680 <?php if ( $is_page ) { ?> 664 681 <div class="parent quick-edit-div" title="<?php _e('Page Parent'); ?>"> … … 666 683 <div class="in"> 667 684 <select name="post_parent"> 685 <?php if ( $bulk ) { ?> 686 <option value=""><?php _e('- No Change -'); ?></option> 687 <?php } ?> 668 688 <option value="0"><?php _e('Main Page (no parent)'); ?></option> 669 689 <?php parent_dropdown(); ?> … … 671 691 </div> 672 692 </div> 693 673 694 <div class="template quick-edit-div" title="<?php _e('Page Template'); ?>"> 674 695 <div class="title"><?php _e('Page Template'); ?></div> 675 696 <div class="in"> 676 697 <select name="page_template"> 677 <option value='default'><?php _e('Default Template'); ?></option> 698 <?php if ( $bulk ) { ?> 699 <option value=""><?php _e('- No Change -'); ?></option> 700 <?php } ?> 701 <option value="default"><?php _e('Default Template'); ?></option> 678 702 <?php page_template_dropdown() ?> 679 703 </select> 680 704 </div> 681 705 </div> 706 707 <?php if ( ! $bulk ) { ?> 682 708 <div class="order quick-edit-div" title="<?php _e('Page Order'); ?>"> 683 709 <div class="title"><?php _e('Page Order'); ?></div> … … 687 713 </div> 688 714 <?php } 715 } 689 716 690 717 break; 691 718 692 719 case 'categories': ?> 720 <?php if ( ! $bulk ) { ?> 693 721 <div <?php echo $attributes ?> title="<?php _e('Categories'); ?>"> 694 722 <div class="title"><?php _e('Categories'); ?> … … 699 727 </ul> 700 728 </div> 701 <?php 729 <?php } 702 730 break; 703 731 704 732 case 'tags': ?> 733 <?php if ( ! $bulk ) { ?> 705 734 <div <?php echo $attributes ?> title="<?php _e('Tags'); ?>"> 706 735 <div class="title"><?php _e('Tags'); ?></div> … … 709 738 </div> 710 739 </div> 711 <?php 740 <?php } 712 741 break; 713 742 714 743 case 'comments': 715 $attributes = 'class="comments column-comments num quick-edit-div"' . $style;?>744 ?> 716 745 <div <?php echo $attributes ?> title="<?php _e('Comments and Pings'); ?>"> 717 746 <div class="title"><?php _e('Comments and Pings'); ?></div> 718 747 <div class="in"> 748 <?php if ( $bulk ) { ?> 749 <select name="comment_status"> 750 <option value=""><?php _e('- No Change -'); ?></option> 751 <option value="open"><?php _e('Allow Comments'); ?></option> 752 <option value="closed"><?php _e('Disallow Comments'); ?></option> 753 </select> 754 <select name="ping_status"> 755 <option value=""><?php _e('- No Change -'); ?></option> 756 <option value="open"><?php _e('Allow Pings'); ?></option> 757 <option value="closed"><?php _e('Disallow Pings'); ?></option> 758 </select> 759 <?php } else { ?> 719 760 <label><input type="checkbox" name="comment_status" value="open" /> 720 761 <?php _e('Allow Comments'); ?></label><br /> 721 762 <label><input type="checkbox" name="ping_status" value="open" /> 722 763 <?php _e('Allow Pings'); ?></label> 764 <?php } ?> 723 765 </div> 724 766 </div> … … 732 774 <div class="title"><?php _e('Author'); ?></div> 733 775 <div class="in"> 734 <?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'selected' => $post->post_author) ); ?> 776 <?php 777 $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors'); 778 if ( $bulk ) $users_opt['show_option_none'] = __('- No Change -'); 779 wp_dropdown_users( $users_opt ); ?> 735 780 </div> 736 781 </div> 737 782 <?php } ?> 738 783 784 <?php if ( ! $bulk ) { ?> 739 785 <div class="password quick-edit-div" title="<?php _e('Password'); ?>"> 740 786 <div class="title"><?php _e('Password'); ?></div> 741 787 <div class="in"> 742 <input type="text" name="post_password" value=" <?php the_post_password(); ?>" />788 <input type="text" name="post_password" value="" /> 743 789 <label title="<?php _e('Privacy'); ?>"> 744 790 <input type="checkbox" name="keep_private" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php echo $is_page ? __('Keep this page private') : __('Keep this post private'); ?></label> 745 791 </div> 746 792 </div> 747 <?php 793 <?php } 748 794 break; 749 795 … … 753 799 <div class="in"> 754 800 <select name="_status"> 755 <?php if ( current_user_can('publish_posts') ) { // Contributors only get "Unpublished" and "Pending Review" ?> 756 <option value='publish'><?php _e('Published') ?></option> 757 <option value='future'><?php _e('Scheduled') ?></option> 801 <?php if ( $bulk ) { ?> 802 <option value=""><?php _e('- No Change -'); ?></option> 803 <?php if ( $can_publish ) { ?> 804 <option value="private"><?php _e('Private') ?></option> 805 <?php } ?> 758 806 <?php } ?> 759 <option value='pending'><?php _e('Pending Review') ?></option> 760 <option value='draft'><?php _e('Unpublished') ?></option> 807 <?php if ( $can_publish ) { // Contributors only get "Unpublished" and "Pending Review" ?> 808 <option value="publish"><?php _e('Published') ?></option> 809 <option value="future"><?php _e('Scheduled') ?></option> 810 <?php } ?> 811 <option value="pending"><?php _e('Pending Review') ?></option> 812 <option value="draft"><?php _e('Unpublished') ?></option> 761 813 </select> 762 814 </div> 763 815 </div> 764 816 765 <?php if ( current_user_can( 'edit_others_posts' ) && ! $is_page) { ?>817 <?php if ( ! $is_page && ! $bulk && current_user_can( 'edit_others_posts' ) ) { ?> 766 818 <div class="sticky quick-edit-div" <?php echo $style; ?> title="<?php _e('Sticky') ?>"> 767 819 <div class="title"><?php _e('Sticky'); ?></div> … … 774 826 break; 775 827 776 case 'control_view': ?> 777 <div><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></div> 778 <?php 779 break; 780 781 case 'control_edit': ?> 782 <div><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></div> 783 <?php 784 break; 785 786 case 'control_delete': ?> 787 <div><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></div> 788 <?php 789 break; 790 791 default: ?> 792 <div><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></div> 793 <?php 828 default: 829 if ( $bulk ) 830 do_action('bulk_edit_custom_box', $column_name, $type); 831 else 832 do_action('quick_edit_custom_box', $column_name, $type); 833 794 834 break; 795 835 } … … 800 840 <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a> 801 841 <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a> 802 <?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false )?>842 <?php if ( ! $bulk ) wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?> 803 843 <input type="hidden" name="post_view" value="<?php echo $m; ?>" /> 804 844 </div> 805 845 </td></tr> 846 <?php 847 $bulk++; 848 } ?> 849 </tbody></table></form> 806 850 <?php 807 851 } … … 845 889 846 890 echo ' 847 <div id="inline_' . $post->ID . '">848 < input type="hidden" name="" class="post_title" value="' . $title . '" />849 < input type="hidden" name="" class="post_name" value="' . $post->post_name . '" />850 < input type="hidden" name="" class="post_author" value="' . $post->post_author . '" />851 < input type="hidden" name="" class="comment_status" value="' . $post->comment_status . '" />852 < input type="hidden" name="" class="ping_status" value="' . $post->ping_status . '" />853 < input type="hidden" name="" class="_status" value="' . $post->post_status . '" />854 < input type="hidden" name="" class="jj" value="' . mysql2date( 'd', $post->post_date ) . '" />855 < input type="hidden" name="" class="mm" value="' . mysql2date( 'm', $post->post_date ) . '" />856 < input type="hidden" name="" class="aa" value="' . mysql2date( 'Y', $post->post_date ) . '" />857 < input type="hidden" name="" class="hh" value="' . mysql2date( 'H', $post->post_date ) . '" />858 < input type="hidden" name="" class="mn" value="' . mysql2date( 'i', $post->post_date ) . '" />859 < input type="hidden" name="" class="post_password" value="' . wp_specialchars($post->post_password, 1) . '" />';891 <div class="hidden" id="inline_' . $post->ID . '"> 892 <div class="post_title">' . $title . '</div> 893 <div class="post_name">' . $post->post_name . '</div> 894 <div class="post_author">' . $post->post_author . '</div> 895 <div class="comment_status">' . $post->comment_status . '</div> 896 <div class="ping_status">' . $post->ping_status . '</div> 897 <div class="_status">' . $post->post_status . '</div> 898 <div class="jj">' . mysql2date( 'd', $post->post_date ) . '</div> 899 <div class="mm">' . mysql2date( 'm', $post->post_date ) . '</div> 900 <div class="aa">' . mysql2date( 'Y', $post->post_date ) . '</div> 901 <div class="hh">' . mysql2date( 'H', $post->post_date ) . '</div> 902 <div class="mn">' . mysql2date( 'i', $post->post_date ) . '</div> 903 <div class="post_password">' . wp_specialchars($post->post_password, 1) . '</div>'; 860 904 861 905 if( $post->post_type == 'page' ) 862 906 echo ' 863 < input type="hidden" name="" class="post_parent" value="' . $post->post_parent . '" />864 < input type="hidden" name="" class="page_template" value="' . wp_specialchars(get_post_meta( $post->ID, '_wp_page_template', true ), 1) . '" />865 < input type="hidden" name="" class="menu_order" value="' . $post->menu_order . '" />';907 <div class="post_parent">' . $post->post_parent . '</div> 908 <div class="page_template">' . wp_specialchars(get_post_meta( $post->ID, '_wp_page_template', true ), 1) . '</div> 909 <div class="menu_order">' . $post->menu_order . '</div>'; 866 910 867 911 if( $post->post_type == 'post' ) 868 912 echo ' 869 < input type="hidden" name="" class="tags_input" value="' . wp_specialchars( str_replace( ',', ', ', get_tags_to_edit($post->ID) ), 1) . '" />870 < input type="hidden" name="" class="post_category" value="' . implode( ',', wp_get_post_categories( $post->ID ) ) . '" />871 < input type="hidden" name="" class="sticky" value="' . (is_sticky($post->ID) ? 'sticky' : '') . '" />';913 <div class="tags_input">' . wp_specialchars( str_replace( ',', ', ', get_tags_to_edit($post->ID) ), 1) . '</div> 914 <div class="post_category">' . implode( ',', wp_get_post_categories( $post->ID ) ) . '</div> 915 <div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>'; 872 916 873 917 echo '</div>'; … … 1036 1080 1037 1081 case 'comments': 1038 $attributes = 'class="comments column-comments num"' . $style;1039 1082 ?> 1040 1083 <td <?php echo $attributes ?>><div class="post-com-count-wrapper"> … … 1211 1254 1212 1255 case 'comments': 1213 $attributes = 'class="comments column-comments num"' . $style;1214 1256 ?> 1215 1257 <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
Note:
See TracChangeset
for help on using the changeset viewer.