Changeset 8943
- Timestamp:
- 09/21/2008 07:45:45 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r8917 r8943 716 716 if ( is_array($hidden) ) 717 717 update_usermeta($current_user->ID, "manage-$page-columns-hidden", $hidden); 718 break; 718 719 case 'get-permalink': 719 720 check_ajax_referer( 'getpermalink', 'getpermalinknonce' ); … … 728 729 die(get_sample_permalink_html($post_id, $title, $slug)); 729 730 break; 730 case 'inline-data':731 check_ajax_referer( 'inlineeditnonce', 'inline_edit_nonce' );732 733 if ( isset($_POST['posts']) )734 get_inline_data( explode(',', $_POST['posts']) );735 736 die();737 break;738 731 case 'inline-save': 739 check_ajax_referer( 'inlineeditnonce', ' inline_edit_nonce' );732 check_ajax_referer( 'inlineeditnonce', '_inline_edit' ); 740 733 741 734 if ( ! isset($_POST['post_ID']) ) … … 754 747 } 755 748 die(); 756 break;749 break; 757 750 case 'meta-box-order': 758 751 check_ajax_referer( 'meta-box-order' ); -
trunk/wp-admin/css/colors-classic.css
r8909 r8943 807 807 } 808 808 809 #replydiv { 809 #replydiv, 810 .inline-editor .quick-edit-div { 810 811 border-color: #EBEBEB #CCC #CCC #EBEBEB; 811 812 background-color: #fff; … … 822 823 } 823 824 824 /* table vim shor cuts */825 /* table vim shortcuts */ 825 826 .vim-current { 826 827 background-color: #CFEBF7 !important; … … 844 845 background-color: #cee1ef; 845 846 } 847 848 /* inline editor */ 849 .inline-editor input, 850 .inline-editor textarea { 851 border-color: #ddd; 852 } 853 854 .inline-editor div.title { 855 background-color: #CFEBF7; 856 } 857 858 .inline-editor ul.cat-checklist { 859 background-color: #FFFFFF; 860 } 861 862 .inline-editor .categories .catshow, 863 .inline-editor .categories .cathide { 864 color: #2583AD; 865 } 866 867 .inline-editor .quick-edit-save { 868 background-color: #CFEBF7; 869 } -
trunk/wp-admin/css/colors-fresh.css
r8909 r8943 790 790 } 791 791 792 #replydiv { 792 #replydiv, 793 .inline-editor .quick-edit-div { 793 794 border-color: #EBEBEB #CCC #CCC #EBEBEB; 794 795 background-color: #fff; … … 805 806 } 806 807 807 /* table vim shor cuts */808 /* table vim shortcuts */ 808 809 .vim-current { 809 810 background-color: #E4F2FD !important; … … 827 828 background-color: #cee1ef; 828 829 } 830 831 /* inline editor */ 832 .inline-editor input, 833 .inline-editor textarea { 834 border-color: #ddd; 835 } 836 837 .inline-editor div.title { 838 background-color: #EAF3FA; 839 } 840 841 .inline-editor ul.cat-checklist { 842 background-color: #FFFFFF; 843 } 844 845 .inline-editor .categories .catshow, 846 .inline-editor .categories .cathide { 847 color: #2583AD; 848 } 849 850 .inline-editor .quick-edit-save { 851 background-color: #EAF3FA; 852 } -
trunk/wp-admin/edit-pages.php
r8923 r8943 190 190 if ($posts) { 191 191 ?> 192 <table class="widefat ">192 <table class="widefat page"> 193 193 <thead> 194 194 <tr> -
trunk/wp-admin/edit-post-rows.php
r8923 r8943 9 9 if ( ! defined('ABSPATH') ) die(); 10 10 ?> 11 <table class="widefat ">11 <table class="widefat post"> 12 12 <thead> 13 13 <tr> -
trunk/wp-admin/edit.php
r8883 r8943 186 186 <div class="alignleft"> 187 187 <select name="action"> 188 <option value="" selected ><?php _e('Actions'); ?></option>188 <option value="" selected="selected"><?php _e('Actions'); ?></option> 189 189 <option value="edit"><?php _e('Edit'); ?></option> 190 190 <option value="delete"><?php _e('Delete'); ?></option> -
trunk/wp-admin/includes/template.php
r8940 r8943 87 87 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 88 88 if ( $default_cat_id != $category->term_id ) 89 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 89 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 90 90 $action_count = count($actions); 91 91 $i = 0; … … 158 158 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 159 159 if ( $default_cat_id != $category->term_id ) 160 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 160 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 161 161 $action_count = count($actions); 162 162 $i = 0; … … 188 188 switch ($column_name) { 189 189 case 'cb': 190 191 192 193 194 195 196 197 190 $output .= "<th scope='row' class='check-column'>"; 191 if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) { 192 $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />"; 193 } else { 194 $output .= " "; 195 } 196 $output .= "</th>"; 197 break; 198 198 case 'name': 199 199 $output .= "<td $attributes>$edit</td>"; … … 250 250 251 251 $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; 252 $output .= "\n<li id='category-$category->term_id'$class>" . '<label for="in-category-' . $category->term_id . '"class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="post_category[]" id="in-category-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . wp_specialchars( apply_filters('the_category', $category->name )) . '</label>';252 $output .= "\n<li id='category-$category->term_id'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="post_category[]" id="in-category-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . wp_specialchars( apply_filters('the_category', $category->name )) . '</label>'; 253 253 } 254 254 … … 316 316 317 317 <li id="<?php echo $id; ?>" class="popular-category"> 318 <label class="selectit" for="in-<?php echo $id; ?>">318 <label class="selectit"> 319 319 <input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" /> 320 320 <?php echo wp_specialchars( apply_filters( 'the_category', $category->name ) ); ?> … … 370 370 371 371 $name = apply_filters( 'term_name', $tag->name ); 372 $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id"; 372 $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id"; 373 373 $out = ''; 374 374 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; … … 389 389 break; 390 390 case 'name': 391 $out .= '<td ' . 391 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />'; 392 392 $actions = array(); 393 393 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 394 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 394 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 395 395 $action_count = count($actions); 396 396 $i = 0; … … 572 572 573 573 function print_column_headers( $type ) { 574 $columns = get_column_headers( $type ); 574 $columns = get_column_headers( $type ); 575 575 $hidden = (array) get_user_option( "manage-$type-columns-hidden" ); 576 576 $styles = array(); … … 603 603 $style = ' style="' . $style . '"'; 604 604 ?> 605 <th scope="col" <?php echo "id=\"$column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th>605 <th scope="col" <?php echo "id=\"$column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th> 606 606 <?php } 607 607 } 608 608 609 609 function inline_edit_row( $type ) { 610 global $current_user ;611 612 if ( 'post' == $type )613 $post = get_default_post_to_edit();614 else615 $post = get_default_page_to_edit();616 617 echo '<tr id="inline-edit" style="display: none">'; 618 $columns = $ type == 'post' ? wp_manage_posts_columns() : wp_manage_pages_columns();610 global $current_user, $mode; 611 612 $is_page = 'page' == $type; 613 if ( $is_page ) 614 $post = get_default_page_to_edit(); 615 else 616 $post = get_default_post_to_edit(); 617 618 $columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns(); 619 619 $hidden = (array) get_user_option( "manage-$type-columns-hidden" ); 620 $hidden_count = empty($hidden[0]) ? 0 : count($hidden); 621 $col_count = count($columns) - $hidden_count; 622 $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list'; 623 ?> 624 <tr title="<?php _e('Double-click to cancel'); ?>" id="inline-edit" style="display: none"><td colspan="<?php echo $col_count; ?>"> 625 <?php 620 626 foreach($columns as $column_name=>$column_display_name) { 621 $class = "class=\"$column_name column-$column_name \"";627 $class = "class=\"$column_name column-$column_name quick-edit-div\""; 622 628 623 629 $style = ''; … … 628 634 629 635 switch($column_name) { 630 631 case 'cb': ?> 632 <th class="check-column"></th> 633 <?php 634 break; 636 case 'cb': 637 break; 635 638 636 639 case 'modified': 637 640 case 'date': 638 $attributes = 'class="date column-date"' . $style;639 641 ?> 640 <td class="date"<?php echo $style ?>> 642 <div <?php echo $attributes; ?> title="<?php _e('Timestamp'); ?>"> 643 <div class="title"><?php _e('Timestamp'); ?></div> 644 <div class="in"> 641 645 <?php touch_time(1, 1, 4, 1); ?> 642 </td> 646 </div> 647 </div> 643 648 <?php 644 649 break; 645 650 646 651 case 'title': 647 $attributes = "class=\"$type-title column-title \"" . $style;648 ?>649 <td <?php echo $attributes ?>>650 < ?php wp_nonce_field( 'inlineeditnonce', 'inline_edit_nonce', false ) ?>651 < div class="title">652 <input type="text" name="post_title" class="title" value="" /><br />653 <label><?php _e('Slug'); ?></label><input type="text" name="post_name" value="" class="slug" />652 $attributes = "class=\"$type-title column-title quick-edit-div\"" . $style; ?> 653 <div <?php echo $attributes ?>> 654 <div class="title"><?php _e('Title'); ?></div> 655 <div class="in"> 656 <label title="<?php _e('Title'); ?>"><input type="text" name="post_title" class="ptitle" value="" /></label><br /> 657 <div class="slug"> 658 <label title="<?php _e('Slug'); ?>"><?php _e('Slug'); ?><input type="text" name="post_name" value="" /></label></div> 654 659 </div> 655 <?php if ($type == 'page'): ?> 656 <div class="other"> 657 <label><?php _e('Parent'); ?></label> 658 <select name="post_parent"> 659 <option value="0"><?php _e('Main Page (no parent)'); ?></option> 660 <?php parent_dropdown(); ?> 661 </select><br /> 662 <label><?php _e('Template'); ?></label> 663 <select name="page_template"> 664 <option value='default'><?php _e('Default Template'); ?></option> 665 <?php page_template_dropdown() ?> 666 </select> 660 </div> 661 <?php if ( $is_page ) { ?> 662 <div class="parent quick-edit-div" title="<?php _e('Page Parent'); ?>"> 663 <div class="title"><?php _e('Page Parent'); ?></div> 664 <div class="in"> 665 <select name="post_parent"> 666 <option value="0"><?php _e('Main Page (no parent)'); ?></option> 667 <?php parent_dropdown(); ?> 668 </select> 667 669 </div> 668 <div class="more"> 669 <label><?php _e('Order'); ?></label><input type="text" name="menu_order" value="<?php echo $post->menu_order ?>" /> 670 <label><?php _e('Password'); ?></label><input type="text" name="post_password" value="<?php echo $post->post_password ?>" /> 670 </div> 671 <div class="template quick-edit-div" title="<?php _e('Page Template'); ?>"> 672 <div class="title"><?php _e('Page Template'); ?></div> 673 <div class="in"> 674 <select name="page_template"> 675 <option value='default'><?php _e('Default Template'); ?></option> 676 <?php page_template_dropdown() ?> 677 </select> 671 678 </div> 672 <?php endif; ?> 673 <div class="clear"></div> 674 <div class="save"> 675 <?php 676 $actions = array(); 677 $actions['save'] = '<a href="#">' . __('Save') . '</a>'; 678 $actions['cancel'] = '<a href="#">' . __('Cancel') . '</a>'; 679 $action_count = count($actions); 680 $i = 0; 681 foreach ( $actions as $action => $link ) { 682 ++$i; 683 ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 684 echo "<span class='$action'>$link$sep</span>"; 685 } 686 ?> 679 </div> 680 <div class="order quick-edit-div" title="<?php _e('Page Order'); ?>"> 681 <div class="title"><?php _e('Page Order'); ?></div> 682 <div class="in"> 683 <input type="text" name="menu_order" value="<?php echo $post->menu_order ?>" /> 687 684 </div> 688 </td> 685 </div> 686 <?php } 687 688 break; 689 690 case 'categories': ?> 691 <div <?php echo $attributes ?> title="<?php _e('Categories'); ?>"> 692 <div class="title"><?php _e('Categories'); ?> 693 <span class="catshow"><?php _e('(expand)'); ?></span> 694 <span class="cathide" style="display:none;"><?php _e('(fold)'); ?></span></div> 695 <ul class="cat-checklist"> 696 <?php wp_category_checklist(); ?> 697 </ul> 698 </div> 689 699 <?php 690 700 break; 691 701 692 case 'categories': ?> 693 <td <?php echo $attributes ?>> 694 <ul class="categories"> 695 <?php wp_category_checklist() ?> 696 </ul> 697 </td> 702 case 'tags': ?> 703 <div <?php echo $attributes ?> title="<?php _e('Tags'); ?>"> 704 <div class="title"><?php _e('Tags'); ?></div> 705 <div class="in"> 706 <textarea cols="22" rows="1" type="text" name="tags_input" class="tags_input"></textarea> 707 </div> 708 </div> 698 709 <?php 699 710 break; 700 711 701 case 'tags': ?> 702 <td <?php echo $attributes ?>> 703 <textarea name="tags_input"></textarea> 704 </td> 712 case 'comments': 713 $attributes = 'class="comments column-comments num quick-edit-div"' . $style; ?> 714 <div <?php echo $attributes ?> title="<?php _e('Comments and Pings'); ?>"> 715 <div class="title"><?php _e('Comments and Pings'); ?></div> 716 <div class="in"> 717 <label><input type="checkbox" name="comment_status" value="open" /> 718 <?php _e('Allow Comments'); ?></label><br /> 719 <label><input type="checkbox" name="ping_status" value="open" /> 720 <?php _e('Allow Pings'); ?></label> 721 </div> 722 </div> 705 723 <?php 706 724 break; 707 725 708 case 'comments': 709 $attributes = 'class="comments column-comments num"' . $style; 710 ?> 711 <td <?php echo $attributes ?>> 712 <input title="Allow Comments" type="checkbox" name="comment_status" value="open" /><br /> 713 <input title="Allow Pings" type="checkbox" name="ping_status" value="open" /> 714 </td> 726 case 'author': 727 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM 728 if ( $authors && count( $authors ) > 1 ) { ?> 729 <div <?php echo $attributes ?> title="<?php _e('Author'); ?>"> 730 <div class="title"><?php _e('Author'); ?></div> 731 <div class="in"> 732 <?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'selected' => $post->post_author) ); ?> 733 </div> 734 </div> 735 <?php } ?> 736 737 <div class="password quick-edit-div" title="<?php _e('Password'); ?>"> 738 <div class="title"><?php _e('Password'); ?></div> 739 <div class="in"> 740 <input type="text" name="post_password" value="<?php echo $post->post_password ?>" /> 741 <label title="<?php _e('Privacy'); ?>"> 742 <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> 743 </div> 744 </div> 715 745 <?php 716 746 break; 717 747 718 case 'author': ?>719 <td <?php echo $attributes ?>>720 <?php721 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM722 if ( $authors && count( $authors ) > 1 ) {723 wp_dropdown_users( array('include' => $authors, 'name' => 'post_author', 'class'=> 'author', 'selected' => $post->post_author) );724 } else {725 echo $current_user->user_nicename.'<input type="hidden" value="'.$post->post_author.'" class="author" />';726 }727 ?>728 </td>729 <?php730 break;731 732 748 case 'status': ?> 733 <td <?php echo $attributes ?>> 749 <div <?php echo $attributes ?> title="<?php _e('Status'); ?>"> 750 <div class="title"><?php _e('Status'); ?></div> 751 <div class="in"> 734 752 <select name="post_status"> 735 <?php if ( current_user_can('publish_posts') ) :// Contributors only get "Unpublished" and "Pending Review" ?>753 <?php if ( current_user_can('publish_posts') ) { // Contributors only get "Unpublished" and "Pending Review" ?> 736 754 <option value='publish'><?php _e('Published') ?></option> 737 755 <option value='future'><?php _e('Scheduled') ?></option> 738 <?php endif;?>756 <?php } ?> 739 757 <option value='pending'><?php _e('Pending Review') ?></option> 740 758 <option value='draft'><?php _e('Unpublished') ?></option> 741 759 </select> 742 <?php if($type == 'page'): ?> 743 <br /><label><input type="checkbox" name="page_private" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></p> 744 <?php else: ?> 745 <?php if ( current_user_can( 'edit_others_posts' ) ) : ?> 746 <br /><label><input type="checkbox" name="sticky" value="sticky" /> <?php _e('Sticky') ?></label></p> 747 <?php endif; ?> 748 <?php endif; ?> 749 </td> 760 </div> 761 </div> 762 763 <?php if ( current_user_can( 'edit_others_posts' ) && ! $is_page ) { ?> 764 <div class="sticky quick-edit-div" <?php echo $style; ?> title="<?php _e('Sticky') ?>"> 765 <div class="title"><?php _e('Sticky'); ?></div> 766 <div class="in"> 767 <label title="<?php _e('Sticky') ?>"> 768 <input type="checkbox" name="sticky" value="sticky" /> <?php _e('Stick this post to the front page') ?></label> 769 </div> 770 </div> 771 <?php } 772 break; 773 774 case 'control_view': ?> 775 <div><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></div> 750 776 <?php 751 777 break; 752 778 753 case 'control_ view': ?>754 < td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>779 case 'control_edit': ?> 780 <div><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></div> 755 781 <?php 756 782 break; 757 783 758 case 'control_ edit': ?>759 < td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>784 case 'control_delete': ?> 785 <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> 760 786 <?php 761 787 break; 762 788 763 case 'control_delete': ?>764 < td><?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>"; } ?></td>789 default: ?> 790 <div><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></div> 765 791 <?php 766 792 break; 767 768 default: ?> 769 <td><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></td> 770 <?php 771 break; 772 } 773 } 774 775 echo '</tr>'; 776 } 777 778 function inline_save_row( $data ) { 793 } 794 } ?> 795 796 <div class="clear"></div> 797 <div class="quick-edit-save"> 798 <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a> 799 <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a> 800 <?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ) ?> 801 <input type="hidden" name="post_view" value="<?php echo $m; ?>" /> 802 </div> 803 </td></tr> 804 <?php 805 } 806 807 function inline_save_row( $data ) { 779 808 // get the original post content 780 809 $post = get_post( $data['post_ID'], ARRAY_A ); … … 782 811 783 812 // statuses 784 if ( 'p age' == $data['post_type'] && 'private' == $data['page_private'] )813 if ( 'private' == $data['keep_private'] ) 785 814 $data['post_status'] = 'private'; 786 if ( empty($data['comment_status']) ) 815 if ( empty($data['comment_status']) ) 787 816 $data['comment_status'] = 'closed'; 788 817 if ( empty($data['ping_status']) ) … … 800 829 } 801 830 802 // outputs XML of the post/page data ready for use in the inline editor 803 // accepts array of post IDs 804 function get_inline_data($posts) { 805 global $post; 806 807 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); 808 echo "<?xml version='1.0' ?>\n"; 809 echo "<posts>\n"; 810 811 foreach ($posts as $ID) { 812 $GLOBALS['post'] = get_post($ID); 813 $GLOBALS['post_ID'] = $ID; 814 815 if ( ($post->post_type == 'post' && !current_user_can('edit_post', $ID)) || 816 ($post->post_type == 'page' && !current_user_can('edit_page', $ID)) || 817 ($post->post_type != 'post' && $post->post_type != 'page')) 818 continue; 819 820 echo " <post id='$ID'>\n"; 821 echo " <post_title>" . wp_specialchars($post->post_title, 1) . "</post_title>\n"; 822 echo " <post_name>$post->post_name</post_name>\n"; 823 echo " <post_author>$post->post_author</post_author>\n"; 824 echo " <comment_status>$post->comment_status</comment_status>\n"; 825 echo " <ping_status>$post->ping_status</ping_status>\n"; 826 echo " <post_status>$post->post_status</post_status>\n"; 827 echo " <jj>" . mysql2date( 'd', $post->post_date ) . "</jj>\n"; 828 echo " <mm>" . mysql2date( 'm', $post->post_date ) . "</mm>\n"; 829 echo " <aa>" . mysql2date( 'Y', $post->post_date ) . "</aa>\n"; 830 echo " <hh>" . mysql2date( 'H', $post->post_date ) . "</hh>\n"; 831 echo " <mn>" . mysql2date( 'i', $post->post_date ) . "</mn>\n"; 832 if( $post->post_type == 'post' ) { 833 echo ' <tags_input>' . wp_specialchars(get_tags_to_edit( $post->ID ), 1) . "</tags_input>\n"; 834 echo ' <post_category>' . implode( ',', wp_get_post_categories( $post->ID ) ) . "</post_category>\n"; 835 echo ' <sticky>' . (is_sticky($post->ID) ? 'sticky' : '') . "</sticky>\n"; 836 } 837 if( $post->post_type == 'page' ) { 838 echo " <post_parent>$post->post_parent</post_parent>\n"; 839 echo ' <page_template>' . wp_specialchars(get_post_meta( $post->ID, '_wp_page_template', true ), 1) . "</page_template>\n"; 840 echo " <post_password>" . wp_specialchars($post->post_password, 1) . "</post_password>\n"; 841 echo " <menu_order>$post->menu_order</menu_order>\n"; 842 } 843 echo " </post>\n"; 844 } 845 846 echo '</posts>'; 831 // adds hidden fields with the data for use in the inline editor 832 function get_inline_data($post) { 833 834 if ( ! current_user_can('edit_' . $post->post_type, $post->ID) ) 835 return; 836 837 $title = apply_filters( 'the_title', $post->post_title ); 838 if ( empty($title) ) 839 $title = __('(no title)'); 840 841 echo ' 842 <div id="inline_' . $post->ID . '"> 843 <input type="hidden" name="" class="post_title" value="' . $title . '" /> 844 <input type="hidden" name="" class="post_name" value="' . $post->post_name . '" /> 845 <input type="hidden" name="" class="post_author" value="' . $post->post_author . '" /> 846 <input type="hidden" name="" class="comment_status" value="' . $post->comment_status . '" /> 847 <input type="hidden" name="" class="ping_status" value="' . $post->ping_status . '" /> 848 <input type="hidden" name="" class="post_status" value="' . $post->post_status . '" /> 849 <input type="hidden" name="" class="jj" value="' . mysql2date( 'd', $post->post_date ) . '" /> 850 <input type="hidden" name="" class="mm" value="' . mysql2date( 'm', $post->post_date ) . '" /> 851 <input type="hidden" name="" class="aa" value="' . mysql2date( 'Y', $post->post_date ) . '" /> 852 <input type="hidden" name="" class="hh" value="' . mysql2date( 'H', $post->post_date ) . '" /> 853 <input type="hidden" name="" class="mn" value="' . mysql2date( 'i', $post->post_date ) . '" /> 854 <input type="hidden" name="" class="post_password" value="' . wp_specialchars($post->post_password, 1) . '" />'; 855 856 if( $post->post_type == 'page' ) 857 echo ' 858 <input type="hidden" name="" class="post_parent" value="' . $post->post_parent . '" /> 859 <input type="hidden" name="" class="page_template" value="' . wp_specialchars(get_post_meta( $post->ID, '_wp_page_template', true ), 1) . '" /> 860 <input type="hidden" name="" class="menu_order" value="' . $post->menu_order . '" />'; 861 862 if( $post->post_type == 'post' ) 863 echo ' 864 <input type="hidden" name="" class="tags_input" value="' . wp_specialchars( str_replace( ',', ', ', get_tags_to_edit($post->ID) ), 1) . '" /> 865 <input type="hidden" name="" class="post_category" value="' . implode( ',', wp_get_post_categories( $post->ID ) ) . '" /> 866 <input type="hidden" name="" class="sticky" value="' . (is_sticky($post->ID) ? 'sticky' : '') . '" />'; 867 868 echo '</div>'; 847 869 } 848 870 … … 875 897 function _post_row($a_post, $pending_comments, $mode) { 876 898 global $post; 877 static $ class;899 static $rowclass; 878 900 879 901 $global_post = $post; … … 881 903 setup_postdata($post); 882 904 883 $ class = 'alternate' == $class ? '' : 'alternate';905 $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 884 906 global $current_user; 885 907 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); … … 889 911 $title = __('(no title)'); 890 912 ?> 891 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $ class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">913 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top"> 892 914 <?php 893 915 $posts_columns = wp_manage_posts_columns(); … … 935 957 } 936 958 937 if ( 'excerpt' == $mode ) { ?> 938 <td <?php echo $attributes ?>><?php echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode) ?></td> 939 <?php } else { ?> 940 <td <?php echo $attributes ?>><abbr title="<?php echo $t_time ?>"><?php echo apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) ?></abbr></td> 941 <?php } 959 echo '<td ' . $attributes . '>'; 960 if ( 'excerpt' == $mode ) 961 echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode); 962 else 963 echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; 964 965 echo '</td>'; 942 966 break; 943 967 … … 955 979 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>'; 956 980 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 957 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";981 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 958 982 if ( in_array($post->post_status, array('pending', 'draft')) ) 959 983 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; … … 967 991 echo "<span class='$action'>$link$sep</span>"; 968 992 } 993 994 get_inline_data($post); 969 995 ?> 970 996 </td> … … 1089 1115 function display_page_row( $page, $level = 0 ) { 1090 1116 global $post; 1091 static $ class;1117 static $rowclass; 1092 1118 1093 1119 $post = $page; … … 1097 1123 $pad = str_repeat( '— ', $level ); 1098 1124 $id = (int) $page->ID; 1099 $ class = ('alternate' == $class )? '' : 'alternate';1125 $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 1100 1126 $posts_columns = wp_manage_pages_columns(); 1101 1127 $hidden = (array) get_user_option( 'manage-page-columns-hidden' ); … … 1104 1130 $title = __('(no title)'); 1105 1131 ?> 1106 <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> 1107 1108 1109 <?php 1132 <tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit"> 1133 <?php 1110 1134 1111 1135 foreach ($posts_columns as $column_name=>$column_display_name) { … … 1164 1188 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 1165 1189 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1166 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";1190 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1167 1191 if ( in_array($post->post_status, array('pending', 'draft')) ) 1168 1192 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; … … 1176 1200 echo "<span class='$action'>$link$sep</span>"; 1177 1201 } 1178 ?>1179 </td>1180 <?php1202 1203 get_inline_data($post); 1204 echo '</td>'; 1181 1205 break; 1182 1206 … … 1237 1261 } 1238 1262 } 1239 1240 1241 1263 ?> 1264 1265 </tr> 1242 1266 1243 1267 <?php … … 1266 1290 * If searching, ignore hierarchy and treat everything as top level 1267 1291 */ 1268 if ( empty($_GET['s']) ) 1292 if ( empty($_GET['s']) ) { 1269 1293 1270 1294 $top_level_pages = array(); 1271 $children_pages 1295 $children_pages = array(); 1272 1296 1273 1297 foreach ( $pages as $page ) { … … 1380 1404 $short_url = substr( $short_url, 0, -1 ); 1381 1405 if ( strlen( $short_url ) > 35 ) 1382 $short_url = 1406 $short_url = substr( $short_url, 0, 32 ).'...'; 1383 1407 $numposts = get_usernumposts( $user_object->ID ); 1384 1408 if ( current_user_can( 'edit_user', $user_object->ID ) ) { … … 1391 1415 $actions = array(); 1392 1416 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 1393 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this user '%s'\n 1417 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this user '%s'\n 'Cancel' to stop, 'OK' to delete."), $user_object->user_login )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1394 1418 $action_count = count($actions); 1395 1419 $i = 0; … … 1512 1536 $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date ); 1513 1537 1514 $delete_url 1515 $approve_url 1538 $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); 1539 $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); 1516 1540 $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); 1517 $spam_url 1541 $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); 1518 1542 1519 1543 ?> 1520 1544 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $the_comment_status; ?>'> 1521 1545 <?php if ( $checkbox ) : ?> 1522 1546 <td class="check-column"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 1523 1547 <?php endif; ?> 1524 1525 1526 1548 <td class="comment-column"> 1549 <?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?> 1550 1527 1551 <?php 1528 1552 $actions = array(); 1529 1553 1530 1554 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 1531 $actions['approve'] 1555 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 1532 1556 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 1533 1557 if ( $comment_status ) { // not looking at all comments … … 1541 1565 } 1542 1566 if ( 'spam' != $the_comment_status ) 1543 $actions['spam'] 1567 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>'; 1544 1568 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 1545 1569 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>'; … … 1565 1589 } 1566 1590 ?> 1567 1591 </td> 1568 1592 <td class="author-column"> 1569 1593 <strong><?php comment_author(); ?></strong><br /> 1570 1571 1572 1573 1574 1575 1576 1577 1578 <?php endif; //current_user_can?> 1594 <?php if ( !empty($author_url) ) : ?> 1595 <a href="<?php echo $author_url ?>"><?php echo $author_url_display; ?></a><br /> 1596 <?php endif; ?> 1597 <?php if ( current_user_can( 'edit_post', $post->ID ) ) : ?> 1598 <?php if ( !empty($comment->comment_author_email) ): ?> 1599 <?php comment_author_email_link() ?><br /> 1600 <?php endif; ?> 1601 <a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=detail"><?php comment_author_IP() ?></a> 1602 <?php endif; //current_user_can?> 1579 1603 </td> 1580 1604 <td class="date-column"><?php comment_date(__('Y/m/d \a\t g:ia')); ?></td> 1581 1605 <?php if ( 'single' !== $mode ) : ?> 1582 1583 1584 1585 1606 <td class="response-column"> 1607 "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br /> 1608 <?php echo get_the_time(__('Y/m/d \a\t g:ia')); ?> 1609 </td> 1586 1610 <?php endif; ?> 1587 1611 </tr> 1588 1612 <?php 1589 1613 } … … 1594 1618 // allow plugin to replace the popup content 1595 1619 $content = apply_filters( 'wp_comment_reply', '', array('position'=>$position, 'checkbox'=>$checkbox, 'mode'=>$mode) ); 1596 1620 1597 1621 if ( ! empty($content) ) { 1598 1622 echo $content; … … 1607 1631 <button id="back-button" onclick="commentReply.back();" class="button"><?php _e('Go back'); ?></button></p> 1608 1632 </div> 1609 1633 1610 1634 <div id="replydiv" style="display:none;"> 1611 1635 <p id="replyhandle"><?php _e('Reply'); ?></p> … … 1700 1724 } 1701 1725 1702 $entry['meta_key'] 1726 $entry['meta_key'] = attribute_escape($entry['meta_key']); 1703 1727 $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a <textarea /> 1704 1728 $entry['meta_id'] = (int) $entry['meta_id']; … … 1793 1817 $month .= '</select>'; 1794 1818 1795 $day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" 1796 $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off" 1797 $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" 1798 $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" 1819 $day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 1820 $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off" />'; 1821 $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 1822 $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 1799 1823 printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute); 1800 1824 1801 1825 if ( $multi ) return; 1802 1826 1803 1827 echo "\n\n"; 1804 1828 foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) … … 1892 1916 <tr> 1893 1917 <th scope="row"><?php _e( 'Link to file' ) ?></th> 1894 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() ); 1918 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() ); ?></a></textarea></td> 1895 1919 </tr> 1896 1920 <tr> … … 1978 2002 * @param string $id String for use in the 'id' attribute of tags. 1979 2003 * @param string $title Title of the meta box 1980 * @param string $callback Function that fills the box with the desired content. 2004 * @param string $callback Function that fills the box with the desired content. The function should echo its output. 1981 2005 * @param string $page The type of edit page on which to show the box (post, page, link) 1982 2006 * @param string $context The context within the page where the boxes should show ('normal', 'advanced') … … 1986 2010 global $wp_meta_boxes; 1987 2011 1988 if 2012 if ( !isset($wp_meta_boxes) ) 1989 2013 $wp_meta_boxes = array(); 1990 2014 if ( !isset($wp_meta_boxes[$page]) ) … … 2013 2037 if ( empty($priority) ) { 2014 2038 $priority = $a_priority; 2015 // else if we're adding to the sorted priortiy, we don't know the title or callback. 2039 // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority. 2016 2040 } elseif ( 'sorted' == $priority ) { 2017 2041 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; … … 2044 2068 2045 2069 $i = 0; 2046 do { 2047 // Grab the ones the user has manually sorted. 2070 do { 2071 // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose 2048 2072 if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { 2049 2073 foreach ( $sorted as $box_context => $ids ) … … 2095 2119 global $wp_meta_boxes; 2096 2120 2097 if 2121 if ( !isset($wp_meta_boxes) ) 2098 2122 $wp_meta_boxes = array(); 2099 2123 if ( !isset($wp_meta_boxes[$page]) ) … … 2138 2162 * @param string $id String for use in the 'id' attribute of tags. 2139 2163 * @param string $title Title of the section 2140 * @param string $callback Function that fills the section with the desired content. 2164 * @param string $callback Function that fills the section with the desired content. The function should echo its output. 2141 2165 * @param string $page The type of settings page on which to show the section (general, reading, writing, ...) 2142 2166 */ … … 2144 2168 global $wp_settings_sections; 2145 2169 2146 if 2170 if ( !isset($wp_settings_sections) ) 2147 2171 $wp_settings_sections = array(); 2148 2172 if ( !isset($wp_settings_sections[$page]) ) … … 2161 2185 * @param string $id String for use in the 'id' attribute of tags. 2162 2186 * @param string $title Title of the field 2163 * @param string $callback Function that fills the field with the desired content. 2187 * @param string $callback Function that fills the field with the desired content. The function should echo its output. 2164 2188 * @param string $page The type of settings page on which to show the field (general, reading, writing, ...) 2165 2189 * @param string $section The section of the settingss page in which to show the box (default, ...) … … 2169 2193 global $wp_settings_fields; 2170 2194 2171 if 2195 if ( !isset($wp_settings_fields) ) 2172 2196 $wp_settings_fields = array(); 2173 2197 if ( !isset($wp_settings_fields[$page]) ) … … 2212 2236 echo '</td>'; 2213 2237 echo '</tr>'; 2214 } 2238 } 2215 2239 } 2216 2240 … … 2245 2269 <input type="hidden" name="found_action" value="<?php echo $found_action; ?>" /> 2246 2270 <?php } ?> 2247 2271 2248 2272 <input type="hidden" name="affected" id="affected" value="" /> 2249 2273 <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?> … … 2280 2304 minWidth: 280 2281 2305 }).css({'top':st+'px','left':'50%','marginLeft':'-200px'}); 2282 2306 2283 2307 $('.ui-resizable-handle').css({ 2284 2308 'backgroundColor': '#e5e5e5' 2285 2309 }); 2286 2310 2287 2311 $('.ui-resizable-se').css({ 2288 2312 'border': '0 none', … … 2291 2315 'background': 'transparent url(images/se.png) no-repeat scroll 0 0' 2292 2316 }); 2293 2317 2294 2318 $('#find-posts-input').focus().keyup(function(e){ 2295 2319 if (e.which == 27) findPosts.close(); // close on Escape 2296 2320 }); 2297 2321 2298 2322 return false; 2299 2323 }, 2300 2324 2301 2325 close : function() { 2302 2326 $('#find-posts-response').html(''); 2303 2327 $('#find-posts').draggable('destroy').resizable('destroy').hide(); 2304 2328 }, 2305 2329 2306 2330 send : function() { 2307 2331 var post = {}; … … 2310 2334 post['action'] = 'find_posts'; 2311 2335 post['_ajax_nonce'] = $('#_ajax_nonce').val(); 2312 2336 2313 2337 if ( $('#find-posts-pages:checked').val() ) 2314 2338 post['pages'] = 1; 2315 2339 else 2316 2340 post['posts'] = 1; 2317 2341 2318 2342 $.ajax({ 2319 2343 type : 'POST', … … 2324 2348 }); 2325 2349 }, 2326 2350 2327 2351 show : function(x) { 2328 2352 … … 2336 2360 if ( r.errors ) 2337 2361 this.error({'responseText': wpAjax.broken}); 2338 2362 2339 2363 r = r.responses[0]; 2340 2364 $('#find-posts-response').html(r.data); 2341 2365 }, 2342 2366 2343 2367 error : function(r) { 2344 2368 var er = r.statusText; … … 2346 2370 if ( r.responseText ) 2347 2371 er = r.responseText.replace( /<.[^<>]*?>/g, '' ); 2348 2372 2349 2373 if ( er ) 2350 2374 $('#find-posts-response').html(er); 2351 2375 } 2352 2376 }; 2353 2377 2354 2378 $(document).ready(function(){ 2355 2379 $('#find-posts-submit').click(function(e) { -
trunk/wp-admin/js/inline-edit.js
r8917 r8943 1 var postType = null;2 var postView = null;3 var postsXml = null;4 var inlineRows = null;5 1 6 jQuery(document).ready(function() { 7 postType = window.location.href.indexOf('edit.php') == -1 ? 'page' : 'post'; 8 postView = window.location.href.indexOf('mode=excerpt') == -1 ? 'list' : 'excerpt'; 2 (function($) { 3 inlineEdit = { 4 type : '', 5 rows : '', 9 6 10 // get IDs of all editable rows11 inlineRows = jQuery('table.widefat .check-column :checkbox[name="post[]"]').parents('tr');7 init : function() { 8 var t = this, blankRow = $('#inline-edit'); 12 9 13 // prepare the edit row 14 var blankRow = jQuery('#inline-edit'); 15 jQuery('ul.categories *', blankRow).removeAttr('id'); 16 jQuery('ul.categories label', blankRow).removeAttr('for'); 17 blankRow.attr('title', 'Double-click to cancel') 18 .dblclick(function() { toggleRow(this); }) 19 .keypress(function(event) { if(event.which == 13) return saveRow(this); }); 20 jQuery('span.cancel a', blankRow).click(function() { return revertRow(this); }); 21 jQuery('span.save a', blankRow).click(function() { return saveRow(this); }); 10 t.type = $('table.widefat').hasClass('page') ? 'page' : 'post'; 22 11 23 // add events and get data 24 inlineRows.dblclick(function() { toggleRow(this); }); 25 addEvents(inlineRows); 12 // get all editable rows 13 t.rows = $('tr.iedit'); 26 14 27 // get data28 getInlineData('all');29 });15 // prepare the edit row 16 blankRow.dblclick(function() { inlineEdit.toggle(this); }) 17 .keyup(function(e) { if(e.which == 27) return inlineEdit.revert(this); }); 30 18 31 function toggleRow(el) { 32 jQuery('#'+postType+'-'+getRowId(el)).css('display') == 'none' ? revertRow(el) : editRow(el); 33 } 19 $('a.cancel', blankRow).click(function() { return inlineEdit.revert(this); }); 20 $('a.save', blankRow).click(function() { return inlineEdit.save(this); }); 34 21 35 // add events to links and make rows double-clickable 36 function addEvents(rows) { 37 rows.each(function() { 38 var row = jQuery(this); 39 jQuery('a.editinline', row).click(function() { editRow(this); return false; }); 40 row.attr('title', 'Double-click to edit'); 41 }); 42 } 22 // add events 23 t.rows.dblclick(function() { inlineEdit.toggle(this); }); 24 t.addEvents(t.rows); 25 }, 43 26 44 function getInlineData(id) { 45 if(id == 'all') { 46 var editable = []; 47 inlineRows.each(function(i) { editable[i] = getRowId(this); }); 48 id = editable.join(','); 27 toggle : function(el) { 28 var t = this; 29 30 $('#'+t.type+'-'+t.getId(el)).css('display') == 'none' ? t.revert(el) : t.edit(el); 31 }, 32 33 addEvents : function(r) { 34 r.each(function() { 35 var row = $(this); 36 $('a.editinline', row).click(function() { inlineEdit.edit(this); return false; }); 37 row.attr('title', inlineEditL10n.edit); 38 }); 39 }, 40 41 edit : function(id) { 42 var t = this, type = t.type, old = $('tr.inline-editor').attr('id'); 43 44 if( typeof(id) == 'object' ) 45 id = t.getId(id); 46 47 if ( old ) { 48 old = old.split('-')[1]; 49 t.revert(old); 50 } 51 52 var fields = ['post_title', 'post_name', 'post_author', 'post_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'post_password']; 53 if ( type == 'page' ) fields.push('post_parent', 'menu_order', 'page_template'); 54 if ( type == 'post' ) fields.push('tags_input'); 55 56 // add the new blank row 57 var editRow = $('#inline-edit').clone(true); 58 59 if ( $('#'+type+'-'+id).hasClass('alternate') ) 60 $(editRow).addClass('alternate'); 61 $('#'+type+'-'+id).hide().after(editRow); 62 63 // populate the data 64 var rowData = $('#inline_'+id); 65 for ( var f = 0; f < fields.length; f++ ) { 66 $(':input[name="'+fields[f]+'"]', editRow).val( $('.'+fields[f], rowData).val() ); 67 } 68 69 if ( $('.comment_status', rowData).val() == 'open' ) 70 $('input[name="comment_status"]', editRow).attr("checked", "checked"); 71 if ( $('.ping_status', rowData).val() == 'open' ) 72 $('input[name="ping_status"]', editRow).attr("checked", "checked"); 73 if ( $('.sticky', rowData).val() == 'sticky' ) 74 $('input[name="sticky"]', editRow).attr("checked", "checked"); 75 76 // categories 77 var cats; 78 if ( cats = $('.post_category', rowData).val() ) 79 $('ul.cat-checklist :checkbox').val(cats.split(',')); 80 81 // handle the post status 82 var status = $('.post_status', rowData).val(); 83 if ( status != 'future' ) $('select[name="post_status"] option[value="future"]', editRow).remove(); 84 if ( status == 'private' ) $('input[name="keep_private"]', editRow).attr("checked", "checked"); 85 86 // remove the current page and children from the parent dropdown 87 var pageOpt = $('select[name="post_parent"] option[value="'+id+'"]', editRow); 88 if ( pageOpt.length > 0 ) { 89 var pageLevel = pageOpt[0].className.split('-')[1], nextPage = pageOpt, pageLoop = true; 90 while ( pageLoop ) { 91 var nextPage = nextPage.next('option'), nextLevel = nextPage[0].className.split('-')[1]; 92 if ( nextLevel <= pageLevel ) { 93 pageLoop = false; 94 } else { 95 nextPage.remove(); 96 nextPage = pageOpt; 97 } 98 } 99 pageOpt.remove(); 100 } 101 102 // categories expandable? 103 $('span.catshow', editRow).click(function() { 104 $('ul.cat-checklist', editRow).addClass("cat-hover"); 105 $('span.cathide', editRow).show(); 106 $(this).hide(); 107 }); 108 109 $('span.cathide', editRow).click(function() { 110 $('ul.cat-checklist', editRow).removeClass("cat-hover"); 111 $('span.catshow', editRow).show(); 112 $(this).hide(); 113 }); 114 115 $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); 116 $('.ptitle', editRow).focus(); 117 118 // enable autocomplete for tags 119 if ( type == 'post' ) 120 $('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); 121 122 return false; 123 }, 124 125 save : function(id) { 126 if( typeof(id) == 'object' ) 127 id = this.getId(id); 128 129 $('#edit-'+id+' .check-column').html('<img src="images/loading.gif" alt="" />'); 130 131 var params = { 132 action: 'inline-save', 133 post_type: this.type, 134 post_ID: id, 135 edit_date: 'true' 136 }; 137 138 var fields = $('#edit-'+id+' :input').fieldSerialize(); 139 params = fields + '&' + $.param(params); 140 141 // make ajax request 142 $.post('admin-ajax.php', params, 143 function(html) { 144 var row = $('#'+inlineEdit.type+'-'+id); 145 $('#edit-'+id).hide(); 146 html = $(html).html(); 147 row.html(html).show(); 148 row.animate( { backgroundColor: '#FFFBCC' }, 200) 149 .animate( { backgroundColor: row.css('background-color') }, 500); 150 inlineEdit.addEvents(row); 151 } 152 ); 153 return false; 154 }, 155 156 revert : function(id) { 157 if ( typeof(id) == 'object' ) 158 id = this.getId(id); 159 160 $('#edit-'+id).remove(); 161 $('#'+this.type+'-'+id).show(); 162 163 return false; 164 }, 165 166 getId : function(o) { 167 var id = o.tagName == 'TR' ? o.id : $(o).parents('tr').attr('id'); 168 var parts = id.split('-'); 169 return parts[parts.length - 1]; 49 170 } 171 }; 50 172 51 if(id == '') 52 return false; 53 54 jQuery.post('admin-ajax.php', { 55 'inline_edit_nonce': jQuery('#inline_edit_nonce').val(), 56 action: 'inline-data', 57 posts: id 58 }, 59 function(xml) { 60 if(id.indexOf(',') == -1) { 61 var newData = jQuery(xml).find('post[id="'+id+'"]'); 62 jQuery(postsXml).find('post[id="'+id+'"]').replaceWith(newData); 63 } else { 64 postsXml = xml; 65 } 66 }, 'xml' 67 ); 68 } 69 70 function editRow(id) { 71 if(typeof(id) == 'object') 72 id = getRowId(id); 73 74 var blankRow = jQuery('#inline-edit'); 75 76 var fields = ['post_title', 'post_name', 'post_author', 'post_status', 'jj', 'mm', 'aa', 'hh', 'mn']; 77 if(postType == 'page') fields.push('post_parent', 'menu_order', 'page_template', 'post_password'); 78 if(postType == 'post') fields.push('tags_input'); 79 80 // add the new blank row 81 var editRow = blankRow.clone(true); 82 jQuery(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); 83 if(jQuery('#'+postType+'-'+id).hasClass('alternate')) 84 jQuery(editRow).addClass('alternate'); 85 jQuery('#'+postType+'-'+id).hide().after(editRow); 86 87 // populate the data 88 var rowData = jQuery(postsXml).find('post[id="'+id+'"]'); 89 for(var f = 0; f < fields.length; f++) { 90 jQuery(':input[name="'+fields[f]+'"]', editRow).val(jQuery(fields[f], rowData).text()); 91 } 92 93 // ping, comments, and privacy 94 if(jQuery('comment_status', rowData).text() == 'open') 95 jQuery('input[name="comment_status"]', editRow).select(); 96 if(jQuery('ping_status', rowData).text() == 'open') 97 jQuery('input[name="ping_status"]', editRow).select(); 98 if(jQuery('sticky', rowData).text() == 'sticky') 99 jQuery('input[name="sticky"]', editRow).select(); 100 101 // categories 102 var categories = jQuery('post_category', rowData).text().split(','); 103 jQuery(categories).each(function() { 104 jQuery('ul.categories :checkbox[value="'+this+'"]', editRow).select(); 105 }); 106 107 // handle the post status 108 var status = jQuery('post_status', rowData).text(); 109 if(status != 'future') jQuery('select[name="post_status"] option[value="future"]', editRow).remove(); 110 if(status == 'private') jQuery('input[name="page_private"]', editRow).select(); 111 112 // enable autocomplete for tags 113 if(postType == 'post') { 114 jQuery('tr.inline textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); 115 } 116 117 // remove the current page and children from the parent dropdown 118 var pageOpt = jQuery('select[name="post_parent"] option[value="'+id+'"]', editRow); 119 if(pageOpt.length > 0) { 120 var pageLevel = pageOpt[0].className.split('-')[1]; 121 var nextPage = pageOpt; var pageLoop = true; 122 while(pageLoop) { 123 var nextPage = nextPage.next('option'); 124 var nextLevel = nextPage[0].className.split('-')[1]; 125 if(nextLevel <= pageLevel) 126 pageLoop = false; 127 else { 128 nextPage.remove(); 129 nextPage = pageOpt; 130 } 131 } 132 pageOpt.remove(); 133 } 134 135 return false; 136 } 137 138 function saveRow(id) { 139 if(typeof(id) == 'object') 140 id = getRowId(id); 141 142 jQuery('#edit-'+id+' .check-column').html('<img src="images/loading.gif" alt="" />'); 143 144 var params = { 145 'inline_edit_nonce': jQuery('#inline_edit_nonce').val(), 146 action: 'inline-save', 147 post_type: postType, 148 post_ID: id, 149 edit_date: 'true', 150 post_view: postView 151 }; 152 153 var fields = jQuery('#edit-'+id+' :input').fieldSerialize(); 154 params = fields + '&' + jQuery.param(params); 155 156 // make ajax request 157 jQuery.post('admin-ajax.php', params, 158 function(html) { 159 var row = jQuery('#'+postType+'-'+id); 160 jQuery('#edit-'+id).hide(); 161 html = jQuery(html).html(); 162 row.html(html).show(); 163 row.animate( { backgroundColor: '#FFFBCC' }, 200) 164 .animate( { backgroundColor: row.css('background-color') }, 500); 165 getInlineData(id); 166 addEvents(row); 167 } 168 ); 169 170 return false; 171 } 172 173 function revertRow(id) { 174 if(typeof(id) == 'object') 175 id = getRowId(id); 176 177 jQuery('#edit-'+id).remove(); 178 jQuery('#'+postType+'-'+id).show(); 179 180 return false; 181 } 182 183 function getRowId(obj) { 184 var id = obj.tagName == 'TR' ? obj.id : jQuery(obj).parents('tr').attr('id'); 185 var parts = id.split('-'); 186 return parts[parts.length - 1]; 187 } 173 $(document).ready(function(){inlineEdit.init();}); 174 })(jQuery); -
trunk/wp-admin/wp-admin.css
r8917 r8943 2160 2160 } 2161 2161 2162 .inline-editor .save {2163 padding-top: 5px;2164 }2165 2166 2162 .inline-editor td { 2167 padding-right: 4px; 2168 padding-left: 7px; 2169 } 2170 2171 .inline-editor input, .inline-editor select, .inline-editor textarea { 2172 font-size: 10px !important; 2163 padding: 3px; 2164 } 2165 2166 .inline-editor .save, 2167 .inline-editor .cancel { 2168 margin-right: 5px; 2169 } 2170 2171 .inline-editor .quick-edit-div { 2172 float: left; 2173 height: 85px; 2174 margin: 0 5px 3px 0; 2175 width: 130px; 2176 border-style: solid; 2177 border-width: 1px; 2173 2178 padding: 2px; 2174 border: 1px solid #ddd; 2175 } 2176 2177 .inline-editor td.date { 2178 width: 87px; 2179 } 2180 2181 .inline-editor td.page-title { 2182 width: 495px; 2183 } 2184 2185 .inline-editor td.post-title input.title { 2186 width: 250px; 2187 } 2188 2189 .inline-editor td.post-title input.slug { 2190 width: 222px; 2191 float: right; 2179 } 2180 2181 .inline-editor .in { 2182 padding: 4px; 2183 margin: 2px 0 0; 2184 line-height: 15px; 2185 } 2186 2187 .inline-editor input { 2188 font-size: 11px !important; 2189 padding: 2px; 2190 border-width: 1px; 2191 border-style: solid; 2192 } 2193 2194 #wpbody-content .inline-editor select { 2195 padding: 0; 2196 height: auto; 2197 width: 120px; 2198 font-size: 11px !important; 2192 2199 } 2193 2200 2194 2201 .inline-editor div.title { 2195 float: left; 2196 } 2197 2198 .inline-editor div.title input.title { 2202 padding: 2px 5px; 2203 cursor: default; 2204 } 2205 2206 .inline-editor .post-title, 2207 .inline-editor .page-title { 2208 width: 260px; 2209 } 2210 2211 .inline-editor .post-title .ptitle, 2212 .inline-editor .page-title .ptitle { 2213 width: 245px; 2214 margin-bottom: 5px; 2199 2215 font-size: 12px !important; 2200 2216 } 2201 2217 2202 .inline-editor div.title label { 2203 float: left; 2204 margin-top: 4px; 2205 } 2206 2207 .inline-editor td.page-title input.slug { 2208 width: 123px; 2209 float: right; 2210 } 2211 2212 .inline-editor div.other, .inline-editor div.more { 2213 width: 190px; 2214 float: left; 2215 padding-left: 5px; 2216 } 2217 2218 .inline-editor div.other label, .inline-editor div.more label { 2219 display: block; float: left; 2220 width: 54px; 2221 margin-top: 4px; 2222 } 2223 2224 .inline-editor div.other select { 2225 width: 133px; 2226 } 2227 2228 .inline-editor div.more { 2229 width: 125px; 2230 } 2231 2232 .inline-editor div.more input { 2233 width: 60px; 2234 } 2235 2236 .inline-editor td.author select { 2237 width: 110px; 2238 } 2239 2240 .inline-editor ul.categories { 2218 .inline-editor .post-title .slug, 2219 .inline-editor .page-title .slug { 2220 text-align: right; 2221 } 2222 2223 .inline-editor .slug input { 2224 width: 170px; 2225 margin: 0 2px 0 4px; 2226 } 2227 2228 .inline-editor .password input, 2229 .inline-editor .order input { 2230 width: 112px; 2231 } 2232 2233 .inline-editor .password label input { 2234 width: auto; 2235 margin: 3px 0 0; 2236 } 2237 2238 .inline-editor .date { 2239 width: 160px; 2240 } 2241 2242 .inline-editor .date input { 2243 padding: 2px 1px; 2244 margin: 1px; 2245 width: 18px; 2246 } 2247 2248 .inline-editor .date input[name="aa"] { 2249 width: 30px; 2250 } 2251 2252 #wpbody-content .inline-editor .date select { 2253 width: 80px; 2254 } 2255 2256 .inline-editor .categories { 2257 width: 180px; 2258 } 2259 2260 .inline-editor .categories ul.cat-checklist { 2241 2261 list-style: none; 2242 padding: 0; margin: 0; 2262 padding: 0 0 0 4px; 2263 margin: 0; 2243 2264 height: 65px; 2244 2265 overflow: auto; 2245 font-size: 10px; 2246 } 2247 2248 .inline-editor ul.categories ul.children { 2266 font-size: 11px; 2267 z-index: 5; 2268 position: relative; 2269 overflow-x: hidden; 2270 } 2271 2272 .inline-editor .categories ul.cat-hover { 2273 height: 200px; 2274 overflow: auto; 2275 } 2276 2277 .inline-editor .categories ul.children { 2249 2278 list-style: none; 2250 2279 padding-left: 15px; 2251 2280 } 2252 2281 2253 .inline-editor ul.categories li { 2254 margin-bottom: 2px; 2255 } 2256 2257 .inline-editor ul.categories input { 2282 .inline-editor .categories li { 2283 margin-bottom: 3px; 2284 line-height: auto; 2285 } 2286 2287 .inline-editor .categories input { 2258 2288 vertical-align: middle; 2259 padding: 0; border: 0; 2260 } 2261 2262 .inline-editor td.tags textarea { 2263 height: 58px; width: 100%; 2264 } 2265 2266 .inline-editor td.comments { 2267 padding-left: 0; 2268 } 2269 2270 .inline-editor td.status select { 2271 width: 98px; 2272 } 2273 2274 .inline-editor td.status input { 2275 vertical-align: middle; 2289 padding: 0; 2290 border: 0; 2291 } 2292 2293 .inline-editor .categories .catshow, 2294 .inline-editor .categories .cathide { 2295 font-size: 9px; 2296 cursor: pointer; 2297 } 2298 2299 .inline-editor .tags { 2300 width: 220px; 2301 } 2302 2303 .inline-editor textarea { 2304 border-width: 1px; 2305 border-style: solid; 2306 height: 45px; 2307 width: 200px; 2308 font-size: 11px; 2309 } 2310 2311 .inline-editor .comments { 2312 text-align: left; 2313 width: 160px; 2314 } 2315 2316 .inline-editor .quick-edit-save { 2317 padding: 8px 10px; 2276 2318 } 2277 2319 -
trunk/wp-includes/script-loader.php
r8936 r8943 245 245 $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); 246 246 247 $scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080812' ); 247 $scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080920' ); 248 $scripts->localize( 'inline-edit', 'inlineEditL10n', array( 249 'edit' => __('Double-click to edit') 250 ) ); 248 251 249 252 $scripts->add( 'plugin-install', '/wp-admin/js/plugin-install.js', array( 'thickbox', 'jquery' ), '20080803' );
Note: See TracChangeset
for help on using the changeset viewer.